diff --git a/README.md b/README.md index e104f6da..a2be1f0f 100644 --- a/README.md +++ b/README.md @@ -138,9 +138,9 @@ pacman -S mingw-w64-ucrt-x86_64-{go,gcc,qt5-base,pkg-config} GOROOT=/ucrt64/lib/go go build -ldflags "-s -w -H windowsgui" ``` -Static builds are also available by installing the `mingw-w64-ucrt-x86_64-qt5-static` package and building with `--tags=windowsqtstatic`. +For dynamic linking, the MSYS2 `qt5-base` package [links against `libicu`](https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-qt5-base/PKGBUILD#L241), whereas the Fsu0413 Qt packages do not. When using MSYS2, your distribution size including `.dll` files will be larger. -The MSYS2 Qt packages in MSYS2 link against `libicu`, whereas the Fsu0413 Qt packages do not. When using MSYS2, your distribution size including `.dll` files will be larger. +Static builds are also available by installing the `mingw-w64-ucrt-x86_64-qt5-static` package and building with `--tags=windowsqtstatic`. The static build will also be smaller as it [does not link to `libicu`](https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-qt5-static/PKGBUILD#L280). ### Windows (Docker) diff --git a/cmd/genbindings/clang2il.go b/cmd/genbindings/clang2il.go index 802c6186..1c6cc16e 100644 --- a/cmd/genbindings/clang2il.go +++ b/cmd/genbindings/clang2il.go @@ -525,7 +525,7 @@ nextEnumEntry: } kind, ok := entry["kind"].(string) - if kind == "DeprecatedAttr" { + if kind == "DeprecatedAttr" || kind == "FullComment" { continue nextEnumEntry // skip } else if kind == "EnumConstantDecl" { // allow @@ -545,56 +545,69 @@ nextEnumEntry: // Try to find the enum value ei1, ok := entry["inner"].([]interface{}) - if !ok || len(ei1) == 0 { - // Enum case without definition e.g. QCalendar::Gregorian - // This means one more than the last value - cee.EntryValue = fmt.Sprintf("%d", lastImplicitValue+1) + if !ok { + // No inner value on the enum = autoincrement + // Fall through as if a blank ei1, this will be handled + } - } else if len(ei1) >= 1 { + // There may be more than one RHS `inner` expression if one of them + // is a comment + // Iterate through each of the ei1 entries and see if any of them + // work for the purposes of enum constant value parsing + foundValidInner := false + for _, ei1_0 := range ei1 { - // There may be more than one RHS `inner` expression if one of them - // is a comment - // Iterate through each of the ei1 entries and see if any of them - // work for the purposes of enum constant value parsing - for _, ei1_0 := range ei1 { + ei1_0 := ei1_0.(map[string]interface{}) + ei1Kind, ok := ei1_0["kind"].(string) + if !ok { + panic("inner with no kind (1)") + } - ei1_0 := ei1_0.(map[string]interface{}) + if ei1Kind == "FullComment" { + continue + } + foundValidInner = true - // Best case: .inner -> kind=ConstantExpr value=xx - // e.g. qabstractitemmodel - if ei1Kind, ok := ei1_0["kind"].(string); ok && ei1Kind == "ConstantExpr" { - log.Printf("Got ConstantExpr OK") - if ei1Value, ok := ei1_0["value"].(string); ok { - cee.EntryValue = ei1Value - goto afterParse - } + // Best case: .inner -> kind=ConstantExpr value=xx + // e.g. qabstractitemmodel + if ei1Kind == "ConstantExpr" { + log.Printf("Got ConstantExpr OK") + if ei1Value, ok := ei1_0["value"].(string); ok { + cee.EntryValue = ei1Value + goto afterParse } + } - // Best case: .inner -> kind=ImplicitCastExpr .inner -> kind=ConstantExpr value=xx - // e.g. QCalendar (when there is a int typecast) - if ei1Kind, ok := ei1_0["kind"].(string); ok && ei1Kind == "ImplicitCastExpr" { - log.Printf("Got ImplicitCastExpr OK") - if ei2, ok := ei1_0["inner"].([]interface{}); ok && len(ei2) > 0 { - ei2_0 := ei2[0].(map[string]interface{}) - if ei2Kind, ok := ei2_0["kind"].(string); ok && ei2Kind == "ConstantExpr" { - log.Printf("Got ConstantExpr OK") - if ei2Value, ok := ei2_0["value"].(string); ok { - cee.EntryValue = ei2Value - goto afterParse - } + // Best case: .inner -> kind=ImplicitCastExpr .inner -> kind=ConstantExpr value=xx + // e.g. QCalendar (when there is a int typecast) + if ei1Kind == "ImplicitCastExpr" { + log.Printf("Got ImplicitCastExpr OK") + if ei2, ok := ei1_0["inner"].([]interface{}); ok && len(ei2) > 0 { + ei2_0 := ei2[0].(map[string]interface{}) + if ei2Kind, ok := ei2_0["kind"].(string); ok && ei2Kind == "ConstantExpr" { + log.Printf("Got ConstantExpr OK") + if ei2Value, ok := ei2_0["value"].(string); ok { + cee.EntryValue = ei2Value + goto afterParse } } } - - if ei1Kind, ok := ei1_0["kind"].(string); ok && ei1Kind == "DeprecatedAttr" { - log.Printf("Enum entry %q is deprecated, skipping", ret.EnumName+"::"+entryname) - continue nextEnumEntry - } - } - // If we made it here, we did not hit any of the `goto afterParse` cases + + if ei1Kind == "DeprecatedAttr" { + log.Printf("Enum entry %q is deprecated, skipping", ret.EnumName+"::"+entryname) + continue nextEnumEntry + } } + + // If we made it here, we did not hit any of the `goto afterParse` cases + if !foundValidInner { + // Enum case without definition e.g. QCalendar::Gregorian + // This means one more than the last value + cee.EntryValue = fmt.Sprintf("%d", lastImplicitValue+1) + } + afterParse: if cee.EntryValue == "" { return ret, fmt.Errorf("Complex enum %q entry %q", ret.EnumName, entryname) diff --git a/cmd/genbindings/clangexec.go b/cmd/genbindings/clangexec.go index 0501a8d6..5a105af6 100644 --- a/cmd/genbindings/clangexec.go +++ b/cmd/genbindings/clangexec.go @@ -39,27 +39,22 @@ func clangExec(ctx context.Context, clangBin, inputHeader string, cflags []strin var wg sync.WaitGroup var inner []interface{} + var innerErr error wg.Add(1) go func() { defer wg.Done() - - inner__, err := clangStripUpToFile(pr, inputHeader) - if err != nil { - panic(err) - } - - inner = inner__ + inner, innerErr = clangStripUpToFile(pr, inputHeader) }() err = cmd.Wait() if err != nil { - panic(err) + return nil, fmt.Errorf("Command: %w", err) } wg.Wait() - return inner, nil + return inner, innerErr } func mustClangExec(ctx context.Context, clangBin, inputHeader string, cflags []string) []interface{} { @@ -71,6 +66,7 @@ func mustClangExec(ctx context.Context, clangBin, inputHeader string, cflags []s log.Printf("WARNING: Clang execution failed: %v", err) time.Sleep(ClangRetryDelay) log.Printf("Retrying...") + continue } // Success diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index 03541721..24e217d9 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -70,13 +70,13 @@ func (p CppParameter) RenderTypeCabi() string { if ft, ok := p.QFlagsOf(); ok { if e, ok := KnownEnums[ft.ParameterType]; ok { - ret = e.UnderlyingType.RenderTypeCabi() + ret = e.Enum.UnderlyingType.RenderTypeCabi() } else { ret = "int" } } else if e, ok := KnownEnums[p.ParameterType]; ok { - ret = e.UnderlyingType.RenderTypeCabi() + ret = e.Enum.UnderlyingType.RenderTypeCabi() } @@ -204,7 +204,7 @@ func emitCABI2CppForwarding(p CppParameter, indent string) (preamble string, for } else if listType, ok := p.QListOf(); ok { - preamble += indent + p.ParameterType + " " + nameprefix + "_QList;\n" + preamble += indent + p.GetQtCppType().ParameterType + " " + nameprefix + "_QList;\n" preamble += indent + nameprefix + "_QList.reserve(" + p.ParameterName + "->len);\n" preamble += indent + listType.RenderTypeCabi() + "* " + nameprefix + "_arr = static_cast<" + listType.RenderTypeCabi() + "*>(" + p.ParameterName + "->data);\n" @@ -343,7 +343,7 @@ func emitAssignCppToCabi(assignExpression string, p CppParameter, rvalue string) shouldReturn = p.RenderTypeQtCpp() + " " + namePrefix + "_ret = " - afterCall += indent + "// Convert QList<> from C++ memory to manually-managed C memory\n" + afterCall += indent + "// Convert QSet<> from C++ memory to manually-managed C memory\n" afterCall += indent + "" + t.RenderTypeCabi() + "* " + namePrefix + "_arr = static_cast<" + t.RenderTypeCabi() + "*>(malloc(sizeof(" + t.RenderTypeCabi() + ") * " + namePrefix + "_ret.size()));\n" afterCall += indent + "int " + namePrefix + "_ctr = 0;\n" afterCall += indent + "QSetIterator<" + t.RenderTypeQtCpp() + "> " + namePrefix + "_itr(" + namePrefix + "_ret);\n" @@ -448,7 +448,7 @@ func getReferencedTypes(src *CppParsedHeader) []string { // Convert to sorted list foundTypesList := make([]string, 0, len(foundTypes)) for ft := range foundTypes { - if strings.HasPrefix(ft, "QList<") || strings.HasPrefix(ft, "QVector<") { + if strings.HasPrefix(ft, "QList<") || strings.HasPrefix(ft, "QVector<") { // TODO properly exclude via the QListOf() check above continue } if strings.HasSuffix(ft, "Private") { // qbrush.h finds QGradientPrivate @@ -475,11 +475,16 @@ func cabiClassName(className string) string { return strings.Replace(className, `::`, `__`, -1) } -func emitBindingHeader(src *CppParsedHeader, filename string) (string, error) { +func emitBindingHeader(src *CppParsedHeader, filename string, packageName string) (string, error) { ret := strings.Builder{} includeGuard := "GEN_" + strings.ToUpper(strings.Replace(filename, `.`, `_`, -1)) + bindingInclude := "../libmiqt/libmiqt.h" + if packageName != "qt" { + bindingInclude = "../" + bindingInclude + } + ret.WriteString(`#ifndef ` + includeGuard + ` #define ` + includeGuard + ` @@ -489,7 +494,7 @@ func emitBindingHeader(src *CppParsedHeader, filename string) (string, error) { #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "` + bindingInclude + `" #ifdef __cplusplus extern "C" { @@ -591,7 +596,7 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) { ret.WriteString(`#include <` + ref + ">\n") } - ret.WriteString(`#include "` + filename + "\"\n") + ret.WriteString(`#include <` + filename + ">\n") ret.WriteString(`#include "gen_` + filename + "\"\n") ret.WriteString("#include \"_cgo_export.h\"\n\n") diff --git a/cmd/genbindings/emitgo.go b/cmd/genbindings/emitgo.go index 79096ab0..229928cc 100644 --- a/cmd/genbindings/emitgo.go +++ b/cmd/genbindings/emitgo.go @@ -19,7 +19,7 @@ func goReservedWord(s string) bool { } } -func (p CppParameter) RenderTypeGo() string { +func (p CppParameter) RenderTypeGo(gfs *goFileState) string { if p.Pointer && p.ParameterType == "char" { return "string" } @@ -28,11 +28,11 @@ func (p CppParameter) RenderTypeGo() string { } if t, ok := p.QListOf(); ok { - return "[]" + t.RenderTypeGo() + return "[]" + t.RenderTypeGo(gfs) } if t, ok := p.QSetOf(); ok { - return "map[" + t.RenderTypeGo() + "]struct{}" + return "map[" + t.RenderTypeGo(gfs) + "]struct{}" } if p.ParameterType == "void" && p.Pointer { @@ -40,10 +40,6 @@ func (p CppParameter) RenderTypeGo() string { } ret := "" - if p.ByRef || p.Pointer { - ret += "*" - } - switch p.ParameterType { case "unsigned char", "uchar", "quint8": // Go byte is unsigned @@ -101,10 +97,25 @@ func (p CppParameter) RenderTypeGo() string { default: if ft, ok := p.QFlagsOf(); ok { - ret += cabiClassName(ft.ParameterType) - } else if p.IsKnownEnum() { - ret += cabiClassName(p.ParameterType) + if enumInfo, ok := KnownEnums[ft.ParameterType]; ok && enumInfo.PackageName != gfs.currentPackageName { + // Cross-package + ret += enumInfo.PackageName + "." + cabiClassName(ft.ParameterType) + gfs.imports[importPathForQtPackage(enumInfo.PackageName)] = struct{}{} + } else { + // Same package + ret += cabiClassName(ft.ParameterType) + } + + } else if enumInfo, ok := KnownEnums[p.ParameterType]; ok { + if enumInfo.PackageName != gfs.currentPackageName { + // Cross-package + ret += enumInfo.PackageName + "." + cabiClassName(p.ParameterType) + gfs.imports[importPathForQtPackage(enumInfo.PackageName)] = struct{}{} + } else { + // Same package + ret += cabiClassName(p.ParameterType) + } } else if strings.Contains(p.ParameterType, `::`) { // Inner class @@ -117,6 +128,15 @@ func (p CppParameter) RenderTypeGo() string { } + if pkg, ok := KnownClassnames[p.ParameterType]; ok && pkg.PackageName != gfs.currentPackageName { + ret = pkg.PackageName + "." + ret + gfs.imports[importPathForQtPackage(pkg.PackageName)] = struct{}{} + } + + if p.ByRef || p.Pointer { + ret = "*" + ret + } + return ret // ignore const } @@ -134,7 +154,8 @@ func (p CppParameter) parameterTypeCgo() string { } tmp := strings.Replace(p.RenderTypeCabi(), `*`, "", -1) - if strings.HasPrefix(tmp, "const ") { + + if strings.HasPrefix(tmp, "const ") && tmp != "const char" { // Special typedef to make this work for const char* signal parameters tmp = tmp[6:] // Constness doesn't survive the CABI boundary } if strings.HasPrefix(tmp, "unsigned ") { @@ -153,7 +174,7 @@ func (p CppParameter) parameterTypeCgo() string { } } -func emitParametersGo(params []CppParameter) string { +func (gfs *goFileState) emitParametersGo(params []CppParameter) string { tmp := make([]string, 0, len(params)) skipNext := false @@ -170,7 +191,7 @@ func emitParametersGo(params []CppParameter) string { } else { // Ordinary parameter - tmp = append(tmp, p.ParameterName+" "+p.RenderTypeGo()) + tmp = append(tmp, p.ParameterName+" "+p.RenderTypeGo(gfs)) } } @@ -178,7 +199,8 @@ func emitParametersGo(params []CppParameter) string { } type goFileState struct { - imports map[string]struct{} + imports map[string]struct{} + currentPackageName string } func (gfs *goFileState) emitParametersGo2CABIForwarding(m CppMethod) (preamble string, forwarding string) { @@ -234,7 +256,8 @@ func (gfs *goFileState) emitParameterGo2CABIForwarding(p CppParameter) (preamble // Go: convert string -> miqt_string* // CABI: convert miqt_string* -> real QString - preamble += nameprefix + "_ms := miqt_strdupg(" + p.ParameterName + ")\n" + gfs.imports["libmiqt"] = struct{}{} + preamble += nameprefix + "_ms := libmiqt.Strdupg(" + p.ParameterName + ")\n" preamble += "defer C.free(" + nameprefix + "_ms)\n" rvalue = "(*C.struct_miqt_string)(" + nameprefix + "_ms)" @@ -277,7 +300,16 @@ func (gfs *goFileState) emitParameterGo2CABIForwarding(p CppParameter) (preamble } else if /*(p.Pointer || p.ByRef) &&*/ p.QtClassType() { // The C++ type is a pointer to Qt class // We want our functions to accept the Go wrapper type, and forward as cPointer() - rvalue = p.ParameterName + ".cPointer()" + // cPointer() returns the cgo pointer which only works in the same package - + // anything cross-package needs to go via unsafe.Pointer + + if classInfo, ok := KnownClassnames[p.ParameterType]; ok && gfs.currentPackageName != classInfo.PackageName { + // Cross-package + rvalue = "(" + p.parameterTypeCgo() + ")(" + p.ParameterName + ".UnsafePointer())" + } else { + // Same package + rvalue = p.ParameterName + ".cPointer()" + } } else if p.IntType() || p.IsFlagType() || p.IsKnownEnum() || p.ParameterType == "bool" { if p.Pointer || p.ByRef { @@ -329,7 +361,7 @@ func (gfs *goFileState) emitCabiToGo(assignExpr string, rt CppParameter, rvalue shouldReturn = "var " + namePrefix + "_ma *C.struct_miqt_array = " - afterword += namePrefix + "_ret := make([]" + t.RenderTypeGo() + ", int(" + namePrefix + "_ma.len))\n" + afterword += namePrefix + "_ret := make([]" + t.RenderTypeGo(gfs) + ", int(" + namePrefix + "_ma.len))\n" afterword += namePrefix + "_outCast := (*[0xffff]" + t.parameterTypeCgo() + ")(unsafe.Pointer(" + namePrefix + "_ma.data)) // hey ya\n" afterword += "for i := 0; i < int(" + namePrefix + "_ma.len); i++ {\n" @@ -345,7 +377,7 @@ func (gfs *goFileState) emitCabiToGo(assignExpr string, rt CppParameter, rvalue shouldReturn = "var " + namePrefix + "_ma *C.struct_miqt_array = " - afterword += namePrefix + "_ret := make(map[" + t.RenderTypeGo() + "]struct{}, int(" + namePrefix + "_ma.len))\n" + afterword += namePrefix + "_ret := make(map[" + t.RenderTypeGo(gfs) + "]struct{}, int(" + namePrefix + "_ma.len))\n" afterword += namePrefix + "_outCast := (*[0xffff]" + t.parameterTypeCgo() + ")(unsafe.Pointer(" + namePrefix + "_ma.data)) // hey ya\n" afterword += "for i := 0; i < int(" + namePrefix + "_ma.len); i++ {\n" @@ -360,9 +392,15 @@ func (gfs *goFileState) emitCabiToGo(assignExpr string, rt CppParameter, rvalue // Construct our Go type based on this inner CABI type shouldReturn = "" + namePrefix + "_ret := " + crossPackage := "" + if pkg, ok := KnownClassnames[rt.ParameterType]; ok && pkg.PackageName != gfs.currentPackageName { + crossPackage = pkg.PackageName + "." + gfs.imports[importPathForQtPackage(pkg.PackageName)] = struct{}{} + } + if rt.Pointer || rt.ByRef { gfs.imports["unsafe"] = struct{}{} - return assignExpr + " new" + cabiClassName(rt.ParameterType) + "_U(unsafe.Pointer(" + rvalue + "))" + return assignExpr + " " + crossPackage + "UnsafeNew" + cabiClassName(rt.ParameterType) + "(unsafe.Pointer(" + rvalue + "))" } else { // This is return by value, but CABI has new'd it into a @@ -371,7 +409,13 @@ func (gfs *goFileState) emitCabiToGo(assignExpr string, rt CppParameter, rvalue // finalizer to automatically Delete once the type goes out // of Go scope - afterword += namePrefix + "_goptr := new" + cabiClassName(rt.ParameterType) + "(" + namePrefix + "_ret)\n" + if crossPackage == "" { + afterword += namePrefix + "_goptr := new" + cabiClassName(rt.ParameterType) + "(" + namePrefix + "_ret)\n" + } else { + gfs.imports["unsafe"] = struct{}{} + afterword += namePrefix + "_goptr := " + crossPackage + "UnsafeNew" + cabiClassName(rt.ParameterType) + "(unsafe.Pointer(" + namePrefix + "_ret))\n" + + } afterword += namePrefix + "_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer\n" // If this is a function return, we have converted value-returned Qt types to pointers @@ -387,17 +431,17 @@ func (gfs *goFileState) emitCabiToGo(assignExpr string, rt CppParameter, rvalue } else if rt.IntType() || rt.IsKnownEnum() || rt.IsFlagType() || rt.ParameterType == "bool" || rt.QtCppOriginalType != nil { // Need to cast Cgo type to Go int type // Optimize assignment to avoid temporary - return assignExpr + "(" + rt.RenderTypeGo() + ")(" + rvalue + ")\n" + return assignExpr + "(" + rt.RenderTypeGo(gfs) + ")(" + rvalue + ")\n" } return shouldReturn + " " + rvalue + "\n" + afterword } -func emitGo(src *CppParsedHeader, headerName string) (string, error) { +func emitGo(src *CppParsedHeader, headerName string, packageName string) (string, error) { ret := strings.Builder{} - ret.WriteString(`package qt + ret.WriteString(`package ` + packageName + ` /* @@ -411,7 +455,8 @@ import "C" `) gfs := goFileState{ - imports: map[string]struct{}{}, + imports: map[string]struct{}{}, + currentPackageName: packageName, } // Check if short-named enums are allowed. @@ -455,7 +500,7 @@ import "C" } ret.WriteString(` - type ` + goEnumName + ` ` + e.UnderlyingType.RenderTypeGo() + ` + type ` + goEnumName + ` ` + e.UnderlyingType.RenderTypeGo(&gfs) + ` `) if len(e.Entries) > 0 { @@ -481,7 +526,16 @@ import "C" // Embed all inherited types to directly allow calling inherited methods for _, base := range c.Inherits { - ret.WriteString("*" + cabiClassName(base) + "\n") + + if pkg, ok := KnownClassnames[base]; ok && pkg.PackageName != gfs.currentPackageName { + // Cross-package parent class + ret.WriteString("*" + pkg.PackageName + "." + cabiClassName(base) + "\n") + gfs.imports[importPathForQtPackage(pkg.PackageName)] = struct{}{} + } else { + // Same-package parent class + ret.WriteString("*" + cabiClassName(base) + "\n") + } + } ret.WriteString(` @@ -494,12 +548,26 @@ import "C" return this.h } + func (this *` + goClassName + `) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) + } + `) + gfs.imports["unsafe"] = struct{}{} localInit := "h: h" for _, base := range c.Inherits { gfs.imports["unsafe"] = struct{}{} - localInit += ", " + cabiClassName(base) + ": new" + cabiClassName(base) + "_U(unsafe.Pointer(h))" + + ctorPrefix := "" + if pkg, ok := KnownClassnames[base]; ok && pkg.PackageName != gfs.currentPackageName { + ctorPrefix = pkg.PackageName + "." + } + + localInit += ", " + cabiClassName(base) + ": " + ctorPrefix + "UnsafeNew" + cabiClassName(base) + "(unsafe.Pointer(h))" } ret.WriteString(` @@ -518,7 +586,7 @@ import "C" // that never happens in Go's type system. gfs.imports["unsafe"] = struct{}{} ret.WriteString(` - func new` + goClassName + `_U(h unsafe.Pointer) *` + goClassName + ` { + func UnsafeNew` + goClassName + `(h unsafe.Pointer) *` + goClassName + ` { return new` + goClassName + `( (*C.` + goClassName + `)(h) ) } @@ -531,7 +599,7 @@ import "C" gfs.imports["runtime"] = struct{}{} ret.WriteString(` // New` + goClassName + maybeSuffix(i) + ` constructs a new ` + c.ClassName + ` object. - func New` + goClassName + maybeSuffix(i) + `(` + emitParametersGo(ctor.Parameters) + `) *` + goClassName + ` { + func New` + goClassName + maybeSuffix(i) + `(` + gfs.emitParametersGo(ctor.Parameters) + `) *` + goClassName + ` { if runtime.GOOS == "linux" { ` + preamble + ` ret := C.` + goClassName + `_new` + maybeSuffix(i) + `(` + forwarding + `) return new` + goClassName + `(ret) @@ -544,7 +612,7 @@ import "C" } else { ret.WriteString(` // New` + goClassName + maybeSuffix(i) + ` constructs a new ` + c.ClassName + ` object. - func New` + goClassName + maybeSuffix(i) + `(` + emitParametersGo(ctor.Parameters) + `) *` + goClassName + ` { + func New` + goClassName + maybeSuffix(i) + `(` + gfs.emitParametersGo(ctor.Parameters) + `) *` + goClassName + ` { ` + preamble + ` ret := C.` + goClassName + `_new` + maybeSuffix(i) + `(` + forwarding + `) return new` + goClassName + `(ret) } @@ -556,7 +624,7 @@ import "C" for _, m := range c.Methods { preamble, forwarding := gfs.emitParametersGo2CABIForwarding(m) - returnTypeDecl := m.ReturnType.RenderTypeGo() + returnTypeDecl := m.ReturnType.RenderTypeGo(&gfs) if returnTypeDecl == "void" { returnTypeDecl = "" } @@ -578,7 +646,7 @@ import "C" } ret.WriteString(` - func ` + receiverAndMethod + `(` + emitParametersGo(m.Parameters) + `) ` + returnTypeDecl + ` {`) + func ` + receiverAndMethod + `(` + gfs.emitParametersGo(m.Parameters) + `) ` + returnTypeDecl + ` {`) if m.LinuxOnly { gfs.imports["runtime"] = struct{}{} ret.WriteString(` @@ -611,13 +679,13 @@ import "C" conversion += gfs.emitCabiToGo(fmt.Sprintf("slotval%d := ", i+1), pp, pp.ParameterName) + "\n" } - ret.WriteString(`func (this *` + goClassName + `) On` + m.SafeMethodName() + `(slot func(` + emitParametersGo(m.Parameters) + `)) { + ret.WriteString(`func (this *` + goClassName + `) On` + m.SafeMethodName() + `(slot func(` + gfs.emitParametersGo(m.Parameters) + `)) { C.` + goClassName + `_connect_` + m.SafeMethodName() + `(this.h, C.intptr_t(cgo.NewHandle(slot)) ) } //export miqt_exec_callback_` + goClassName + `_` + m.SafeMethodName() + ` func miqt_exec_callback_` + goClassName + `_` + m.SafeMethodName() + `(cb C.intptr_t` + ifv(len(m.Parameters) > 0, ", ", "") + strings.Join(cgoNamedParams, `, `) + `) { - gofunc, ok := cgo.Handle(cb).Value().(func(` + emitParametersGo(m.Parameters) + `)) + gofunc, ok := cgo.Handle(cb).Value().(func(` + gfs.emitParametersGo(m.Parameters) + `)) if !ok { panic("miqt: callback of non-callback type (heap corruption?)") } @@ -660,14 +728,17 @@ import "C" if len(gfs.imports) > 0 { allImports := make([]string, 0, len(gfs.imports)) for k, _ := range gfs.imports { - allImports = append(allImports, `"`+k+`"`) + if k == "libmiqt" { + allImports = append(allImports, `"`+BaseModule+`/libmiqt"`) + } else { + allImports = append(allImports, `"`+k+`"`) + } } + sort.Strings(allImports) goSrc = strings.Replace(goSrc, `%%_IMPORTLIBS_%%`, "import (\n\t"+strings.Join(allImports, "\n\t")+"\n)", 1) - } else { goSrc = strings.Replace(goSrc, `%%_IMPORTLIBS_%%`, "", 1) - } // Run gofmt over the result diff --git a/cmd/genbindings/exceptions.go b/cmd/genbindings/exceptions.go index 27ddc6cb..085b2ad7 100644 --- a/cmd/genbindings/exceptions.go +++ b/cmd/genbindings/exceptions.go @@ -10,20 +10,20 @@ func InsertTypedefs() { // Seed well-known typedefs // QString is deleted from this binding - KnownTypedefs["QStringList"] = CppTypedef{"QStringList", parseSingleTypeString("QList")} + KnownTypedefs["QStringList"] = lookupResultTypedef{"qt", CppTypedef{"QStringList", parseSingleTypeString("QList")}} // FIXME this isn't picked up automatically because QFile inherits QFileDevice and the name refers to its parent class - KnownTypedefs["QFile::FileTime"] = CppTypedef{"QFile::FileTime", parseSingleTypeString("QFileDevice::FileTime")} + KnownTypedefs["QFile::FileTime"] = lookupResultTypedef{"qt", CppTypedef{"QFile::FileTime", parseSingleTypeString("QFileDevice::FileTime")}} // n.b. Qt 5 only - KnownTypedefs["QLineF::IntersectionType"] = CppTypedef{"QLineF::IntersectionType", parseSingleTypeString("QLineF::IntersectType")} + KnownTypedefs["QLineF::IntersectionType"] = lookupResultTypedef{"qt", CppTypedef{"QLineF::IntersectionType", parseSingleTypeString("QLineF::IntersectType")}} // Not sure the reason for this one - KnownTypedefs["QSocketDescriptor::DescriptorType"] = CppTypedef{"QSocketDescriptor::DescriptorType", parseSingleTypeString("QSocketNotifier::Type")} + KnownTypedefs["QSocketDescriptor::DescriptorType"] = lookupResultTypedef{"qt", CppTypedef{"QSocketDescriptor::DescriptorType", parseSingleTypeString("QSocketNotifier::Type")}} // QFile doesn't see QFileDevice parent class enum - KnownTypedefs["QFile::Permissions"] = CppTypedef{"QFile::Permissions", parseSingleTypeString("QFileDevice::Permissions")} - KnownTypedefs["QFileDevice::Permissions"] = CppTypedef{"QFile::Permissions", parseSingleTypeString("QFlags")} + KnownTypedefs["QFile::Permissions"] = lookupResultTypedef{"qt", CppTypedef{"QFile::Permissions", parseSingleTypeString("QFileDevice::Permissions")}} + KnownTypedefs["QFileDevice::Permissions"] = lookupResultTypedef{"qt", CppTypedef{"QFile::Permissions", parseSingleTypeString("QFlags")}} } func AllowHeader(fullpath string) bool { diff --git a/cmd/genbindings/intermediate.go b/cmd/genbindings/intermediate.go index 1a3328ba..7f384963 100644 --- a/cmd/genbindings/intermediate.go +++ b/cmd/genbindings/intermediate.go @@ -5,16 +5,30 @@ import ( "strings" ) +type lookupResultClass struct { + PackageName string +} + +type lookupResultTypedef struct { + PackageName string + Typedef CppTypedef +} + +type lookupResultEnum struct { + PackageName string + Enum CppEnum +} + var ( - KnownClassnames map[string]struct{} // Entries of the form QFoo::Bar if it is an inner class - KnownTypedefs map[string]CppTypedef - KnownEnums map[string]CppEnum + KnownClassnames map[string]lookupResultClass // Entries of the form QFoo::Bar if it is an inner class + KnownTypedefs map[string]lookupResultTypedef + KnownEnums map[string]lookupResultEnum ) func init() { - KnownClassnames = make(map[string]struct{}) - KnownTypedefs = make(map[string]CppTypedef) - KnownEnums = make(map[string]CppEnum) + KnownClassnames = make(map[string]lookupResultClass) + KnownTypedefs = make(map[string]lookupResultTypedef) + KnownEnums = make(map[string]lookupResultEnum) } type CppParameter struct { diff --git a/cmd/genbindings/main.go b/cmd/genbindings/main.go index 37f428a5..45fe6286 100644 --- a/cmd/genbindings/main.go +++ b/cmd/genbindings/main.go @@ -15,78 +15,119 @@ import ( const ( ClangSubprocessCount = 3 + BaseModule = "github.com/mappu/miqt" ) +func importPathForQtPackage(packageName string) string { + switch packageName { + case "qt": + return BaseModule + "/qt" + default: + return BaseModule + "/qt/" + packageName + } +} + func cacheFilePath(inputHeader string) string { return filepath.Join("cachedir", strings.Replace(inputHeader, `/`, `__`, -1)+".json") } -func main() { - ctx := context.Background() +func findHeadersInDir(srcDir string) []string { + content, err := os.ReadDir(srcDir) + if err != nil { + panic(err) + } + var ret []string + + for _, includeFile := range content { + if includeFile.IsDir() { + continue + } + if !strings.HasSuffix(includeFile.Name(), `.h`) { + continue + } + fullPath := filepath.Join(srcDir, includeFile.Name()) + if !AllowHeader(fullPath) { + continue + } + ret = append(ret, fullPath) + } + + return ret +} + +func cleanGeneratedFilesInDir(dirpath string) { + log.Printf("Cleaning up output directory %q...", dirpath) + + _ = os.MkdirAll(dirpath, 0755) + + existing, err := os.ReadDir(dirpath) + if err != nil { + panic(err) + } + + cleaned := 0 + for _, e := range existing { + if e.IsDir() { + continue + } + if !strings.HasPrefix(e.Name(), `gen_`) { + continue + } + // One of ours, clean up + err := os.Remove(filepath.Join(dirpath, e.Name())) + if err != nil { + log.Printf("WARNING: Failed to remove existing file %q", e.Name()) + continue + } + + cleaned++ + } + + log.Printf("Removed %d file(s).", cleaned) +} + +func main() { clang := flag.String("clang", "clang", "Custom path to clang") - cflags := flag.String("cflags", `-DQT_WIDGETS_LIB -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -DQT_GUI_LIB -I/usr/include/x86_64-linux-gnu/qt5/QtGui -DQT_CORE_LIB`, "Cflags to pass to clang (e.g. `pkg-config --cflags Qt5Widgets`)") - outDir := flag.String("outdir", "../../qt", "Output directory for generated gen_** files") + outDir := flag.String("outdir", "../../", "Output directory for generated gen_** files") flag.Parse() + generate( + "qt", + []string{ + "/usr/include/x86_64-linux-gnu/qt5/QtCore", + "/usr/include/x86_64-linux-gnu/qt5/QtGui", + "/usr/include/x86_64-linux-gnu/qt5/QtWidgets", + }, + *clang, + // pkg-config --cflags Qt5Widgets + strings.Fields(`-DQT_WIDGETS_LIB -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -DQT_GUI_LIB -I/usr/include/x86_64-linux-gnu/qt5/QtGui -DQT_CORE_LIB`), + filepath.Join(*outDir, "qt"), + ) + + generate( + "qprintsupport", + []string{ + "/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport", + }, + *clang, + // pkg-config --cflags Qt5PrintSupport + strings.Fields(`-DQT_PRINTSUPPORT_LIB -I/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/x86_64-linux-gnu/qt5/QtGui -DQT_WIDGETS_LIB -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -DQT_GUI_LIB -DQT_CORE_LIB`), + filepath.Join(*outDir, "qt/qprintsupport"), + ) +} + +func generate(packageName string, srcDirs []string, clangBin string, cflags []string, outDir string) { + var includeFiles []string - - for _, srcDir := range []string{ - "/usr/include/x86_64-linux-gnu/qt5/QtCore", - "/usr/include/x86_64-linux-gnu/qt5/QtGui", - "/usr/include/x86_64-linux-gnu/qt5/QtWidgets", - } { - content, err := os.ReadDir(srcDir) - if err != nil { - panic(err) - } - - for _, includeFile := range content { - if includeFile.IsDir() { - continue - } - if !strings.HasSuffix(includeFile.Name(), `.h`) { - continue - } - fullPath := filepath.Join(srcDir, includeFile.Name()) - if !AllowHeader(fullPath) { - continue - } - includeFiles = append(includeFiles, fullPath) - } + for _, srcDir := range srcDirs { + includeFiles = append(includeFiles, findHeadersInDir(srcDir)...) } log.Printf("Found %d header files to process.", len(includeFiles)) - { - log.Printf("Cleaning up output directory %q...", *outDir) - - existing, err := os.ReadDir(*outDir) - if err != nil { - panic(err) - } - - cleaned := 0 - for _, e := range existing { - if e.IsDir() { - continue - } - if !strings.HasPrefix(e.Name(), `gen_`) { - continue - } - // One of ours, clean up - err := os.Remove(filepath.Join(*outDir, e.Name())) - if err != nil { - log.Printf("WARNING: Failed to remove existing file %q", e.Name()) - continue - } - - cleaned++ - } - - log.Printf("Removed %d file(s).", cleaned) - } + cleanGeneratedFilesInDir(outDir) var processHeaders []*CppParsedHeader atr := astTransformRedundant{ @@ -99,63 +140,7 @@ func main() { // PASS 0 (Fill clang cache) // - var clangChan = make(chan string, 0) - var clangWg sync.WaitGroup - - for i := 0; i < ClangSubprocessCount; i++ { - clangWg.Add(1) - go func() { - defer clangWg.Done() - log.Printf("Clang worker: starting") - - for { - inputHeader, ok := <-clangChan - if !ok { - return // Done - } - - log.Printf("Clang worker got message for file %q", inputHeader) - - // Parse the file - // This seems to intermittently fail, so allow retrying - astInner := mustClangExec(ctx, *clang, inputHeader, strings.Fields(*cflags)) - - // Write to cache - jb, err := json.MarshalIndent(astInner, "", "\t") - if err != nil { - panic(err) - } - - err = ioutil.WriteFile(cacheFilePath(inputHeader), jb, 0644) - if err != nil { - panic(err) - } - - astInner = nil - jb = nil - runtime.GC() - - } - log.Printf("Clang worker: exiting") - }() - } - - for _, inputHeader := range includeFiles { - - // Check if there is a matching cache hit - cacheFile := cacheFilePath(inputHeader) - - if _, err := os.Stat(cacheFile); err != nil && os.IsNotExist(err) { - - // Nonexistent cache file, regenerate from clang - log.Printf("No AST cache for file %q, running clang...", filepath.Base(inputHeader)) - clangChan <- inputHeader - } - } - - // Done with all clang workers - close(clangChan) - clangWg.Wait() + generateClangCaches(includeFiles, clangBin, cflags) // The cache should now be fully populated. @@ -179,6 +164,10 @@ func main() { panic(err) } + if astInner == nil { + panic("Null in cache file for " + inputHeader) + } + // Convert it to our intermediate format parsed, err := parseHeader(astInner, "") if err != nil { @@ -194,15 +183,14 @@ func main() { atr.Process(parsed) // Update global state tracker (AFTER astTransformChildClasses) - // Currently, this is only used for inner classes for _, c := range parsed.Classes { - KnownClassnames[c.ClassName] = struct{}{} + KnownClassnames[c.ClassName] = lookupResultClass{packageName} } for _, td := range parsed.Typedefs { - KnownTypedefs[td.Alias] = td // copy + KnownTypedefs[td.Alias] = lookupResultTypedef{packageName, td /* copy */} } for _, en := range parsed.Enums { - KnownEnums[en.EnumName] = en // copy + KnownEnums[en.EnumName] = lookupResultEnum{packageName, en /* copy */} } processHeaders = append(processHeaders, parsed) @@ -240,9 +228,9 @@ func main() { } // Emit 3 code files from the intermediate format - outputName := filepath.Join(*outDir, "gen_"+strings.TrimSuffix(filepath.Base(parsed.Filename), `.h`)) + outputName := filepath.Join(outDir, "gen_"+strings.TrimSuffix(filepath.Base(parsed.Filename), `.h`)) - goSrc, err := emitGo(parsed, filepath.Base(parsed.Filename)) + goSrc, err := emitGo(parsed, filepath.Base(parsed.Filename), packageName) if err != nil { panic(err) } @@ -262,7 +250,7 @@ func main() { panic(err) } - bindingHSrc, err := emitBindingHeader(parsed, filepath.Base(parsed.Filename)) + bindingHSrc, err := emitBindingHeader(parsed, filepath.Base(parsed.Filename), packageName) if err != nil { panic(err) } @@ -278,3 +266,65 @@ func main() { log.Printf("Processing %d file(s) completed", len(includeFiles)) } + +func generateClangCaches(includeFiles []string, clangBin string, cflags []string) { + + var clangChan = make(chan string, 0) + var clangWg sync.WaitGroup + ctx := context.Background() + + for i := 0; i < ClangSubprocessCount; i++ { + clangWg.Add(1) + go func() { + defer clangWg.Done() + log.Printf("Clang worker: starting") + + for { + inputHeader, ok := <-clangChan + if !ok { + return // Done + } + + log.Printf("Clang worker got message for file %q", inputHeader) + + // Parse the file + // This seems to intermittently fail, so allow retrying + astInner := mustClangExec(ctx, clangBin, inputHeader, cflags) + + // Write to cache + jb, err := json.MarshalIndent(astInner, "", "\t") + if err != nil { + panic(err) + } + + err = ioutil.WriteFile(cacheFilePath(inputHeader), jb, 0644) + if err != nil { + panic(err) + } + + astInner = nil + jb = nil + runtime.GC() + + } + log.Printf("Clang worker: exiting") + }() + } + + for _, inputHeader := range includeFiles { + + // Check if there is a matching cache hit + cacheFile := cacheFilePath(inputHeader) + + if _, err := os.Stat(cacheFile); err != nil && os.IsNotExist(err) { + + // Nonexistent cache file, regenerate from clang + log.Printf("No AST cache for file %q, running clang...", filepath.Base(inputHeader)) + clangChan <- inputHeader + } + } + + // Done with all clang workers + close(clangChan) + clangWg.Wait() +} diff --git a/cmd/genbindings/transformtypedefs.go b/cmd/genbindings/transformtypedefs.go index f5691f9f..eb111809 100644 --- a/cmd/genbindings/transformtypedefs.go +++ b/cmd/genbindings/transformtypedefs.go @@ -11,7 +11,7 @@ func applyTypedefs(p CppParameter) CppParameter { if !ok { break } - p.ApplyTypedef(td.UnderlyingType) + p.ApplyTypedef(td.Typedef.UnderlyingType) } if t, ok := p.QListOf(); ok { diff --git a/qt/binding.cpp b/libmiqt/libmiqt.cpp similarity index 78% rename from qt/binding.cpp rename to libmiqt/libmiqt.cpp index 15464ff2..5b786b34 100644 --- a/qt/binding.cpp +++ b/libmiqt/libmiqt.cpp @@ -1,7 +1,4 @@ -#include -#include - -#include "binding.h" +#include "libmiqt.h" struct miqt_string* miqt_strdup(const char* src, size_t len) { struct miqt_string* ret = (struct miqt_string*)( malloc(len + sizeof(size_t)) ); diff --git a/qt/binding.h b/libmiqt/libmiqt.h similarity index 79% rename from qt/binding.h rename to libmiqt/libmiqt.h index b9a087fa..73bbcf3b 100644 --- a/qt/binding.h +++ b/libmiqt/libmiqt.h @@ -1,6 +1,9 @@ #ifndef MIQT_BINDING_H #define MIQT_BINDING_H +#include +#include + #ifdef __cplusplus extern "C" { #endif @@ -15,10 +18,10 @@ struct miqt_array { void* data; // Separate, second allocation }; -// miqt_strdup allocates a miqt_string and copies C data into it. -// The function is defined in C++. struct miqt_string* miqt_strdup(const char* src, size_t len); +typedef const char const_char; + #ifdef __cplusplus } #endif diff --git a/qt/binding.go b/libmiqt/strings.go similarity index 71% rename from qt/binding.go rename to libmiqt/strings.go index 18bb70d2..5f6f5ddf 100644 --- a/qt/binding.go +++ b/libmiqt/strings.go @@ -1,10 +1,10 @@ -package qt +package libmiqt // SPDX-License-Identifier: MIT /* -#include "binding.h" +#include "libmiqt.h" struct miqt_string* miqt_strdupg(_GoString_ gs) { return miqt_strdup(_GoStringPtr(gs), _GoStringLen(gs)); @@ -17,9 +17,9 @@ import ( "unsafe" ) -// miqt_strdupg will strdup a Go string into a miqt_string*. +// Strdupg will strdup a Go string into a miqt_string*. // It is typed as returning an unsafe.Pointer because Cgo types cannot be shared // across Go file boundaries. -func miqt_strdupg(s string) unsafe.Pointer { +func Strdupg(s string) unsafe.Pointer { return unsafe.Pointer(C.miqt_strdupg(s)) } diff --git a/qt/gen_qabstractanimation.cpp b/qt/gen_qabstractanimation.cpp index e8ef02af..f25eb778 100644 --- a/qt/gen_qabstractanimation.cpp +++ b/qt/gen_qabstractanimation.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qabstractanimation.h" +#include #include "gen_qabstractanimation.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractanimation.go b/qt/gen_qabstractanimation.go index c8d24c58..f3cdb706 100644 --- a/qt/gen_qabstractanimation.go +++ b/qt/gen_qabstractanimation.go @@ -48,19 +48,26 @@ func (this *QAbstractAnimation) cPointer() *C.QAbstractAnimation { return this.h } +func (this *QAbstractAnimation) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractAnimation(h *C.QAbstractAnimation) *QAbstractAnimation { if h == nil { return nil } - return &QAbstractAnimation{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAbstractAnimation{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAbstractAnimation_U(h unsafe.Pointer) *QAbstractAnimation { +func UnsafeNewQAbstractAnimation(h unsafe.Pointer) *QAbstractAnimation { return newQAbstractAnimation((*C.QAbstractAnimation)(h)) } func (this *QAbstractAnimation) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractAnimation_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractAnimation_MetaObject(this.h))) } func (this *QAbstractAnimation) Metacast(param1 string) unsafe.Pointer { @@ -92,7 +99,7 @@ func (this *QAbstractAnimation) State() QAbstractAnimation__State { } func (this *QAbstractAnimation) Group() *QAnimationGroup { - return newQAnimationGroup_U(unsafe.Pointer(C.QAbstractAnimation_Group(this.h))) + return UnsafeNewQAnimationGroup(unsafe.Pointer(C.QAbstractAnimation_Group(this.h))) } func (this *QAbstractAnimation) Direction() QAbstractAnimation__Direction { @@ -308,14 +315,21 @@ func (this *QAnimationDriver) cPointer() *C.QAnimationDriver { return this.h } +func (this *QAnimationDriver) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAnimationDriver(h *C.QAnimationDriver) *QAnimationDriver { if h == nil { return nil } - return &QAnimationDriver{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAnimationDriver{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAnimationDriver_U(h unsafe.Pointer) *QAnimationDriver { +func UnsafeNewQAnimationDriver(h unsafe.Pointer) *QAnimationDriver { return newQAnimationDriver((*C.QAnimationDriver)(h)) } @@ -332,7 +346,7 @@ func NewQAnimationDriver2(parent *QObject) *QAnimationDriver { } func (this *QAnimationDriver) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAnimationDriver_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAnimationDriver_MetaObject(this.h))) } func (this *QAnimationDriver) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qabstractanimation.h b/qt/gen_qabstractanimation.h index cec4126c..9969a7a4 100644 --- a/qt/gen_qabstractanimation.h +++ b/qt/gen_qabstractanimation.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractbutton.cpp b/qt/gen_qabstractbutton.cpp index 3df0002f..feba46ec 100644 --- a/qt/gen_qabstractbutton.cpp +++ b/qt/gen_qabstractbutton.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qabstractbutton.h" +#include #include "gen_qabstractbutton.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractbutton.go b/qt/gen_qabstractbutton.go index 8bbf7a83..784def9e 100644 --- a/qt/gen_qabstractbutton.go +++ b/qt/gen_qabstractbutton.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,19 +27,26 @@ func (this *QAbstractButton) cPointer() *C.QAbstractButton { return this.h } +func (this *QAbstractButton) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractButton(h *C.QAbstractButton) *QAbstractButton { if h == nil { return nil } - return &QAbstractButton{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QAbstractButton{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQAbstractButton_U(h unsafe.Pointer) *QAbstractButton { +func UnsafeNewQAbstractButton(h unsafe.Pointer) *QAbstractButton { return newQAbstractButton((*C.QAbstractButton)(h)) } func (this *QAbstractButton) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractButton_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractButton_MetaObject(this.h))) } func (this *QAbstractButton) Metacast(param1 string) unsafe.Pointer { @@ -66,7 +74,7 @@ func QAbstractButton_TrUtf8(s string) string { } func (this *QAbstractButton) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QAbstractButton_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -160,7 +168,7 @@ func (this *QAbstractButton) AutoExclusive() bool { } func (this *QAbstractButton) Group() *QButtonGroup { - return newQButtonGroup_U(unsafe.Pointer(C.QAbstractButton_Group(this.h))) + return UnsafeNewQButtonGroup(unsafe.Pointer(C.QAbstractButton_Group(this.h))) } func (this *QAbstractButton) SetIconSize(size *QSize) { diff --git a/qt/gen_qabstractbutton.h b/qt/gen_qabstractbutton.h index da72c53c..2fabf318 100644 --- a/qt/gen_qabstractbutton.h +++ b/qt/gen_qabstractbutton.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstracteventdispatcher.cpp b/qt/gen_qabstracteventdispatcher.cpp index ea3d5ee0..b5b2e22d 100644 --- a/qt/gen_qabstracteventdispatcher.cpp +++ b/qt/gen_qabstracteventdispatcher.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qabstracteventdispatcher.h" +#include #include "gen_qabstracteventdispatcher.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstracteventdispatcher.go b/qt/gen_qabstracteventdispatcher.go index 6c842cee..9a70441e 100644 --- a/qt/gen_qabstracteventdispatcher.go +++ b/qt/gen_qabstracteventdispatcher.go @@ -26,19 +26,26 @@ func (this *QAbstractEventDispatcher) cPointer() *C.QAbstractEventDispatcher { return this.h } +func (this *QAbstractEventDispatcher) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractEventDispatcher(h *C.QAbstractEventDispatcher) *QAbstractEventDispatcher { if h == nil { return nil } - return &QAbstractEventDispatcher{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAbstractEventDispatcher{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAbstractEventDispatcher_U(h unsafe.Pointer) *QAbstractEventDispatcher { +func UnsafeNewQAbstractEventDispatcher(h unsafe.Pointer) *QAbstractEventDispatcher { return newQAbstractEventDispatcher((*C.QAbstractEventDispatcher)(h)) } func (this *QAbstractEventDispatcher) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractEventDispatcher_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractEventDispatcher_MetaObject(this.h))) } func (this *QAbstractEventDispatcher) Metacast(param1 string) unsafe.Pointer { @@ -66,7 +73,7 @@ func QAbstractEventDispatcher_TrUtf8(s string) string { } func QAbstractEventDispatcher_Instance() *QAbstractEventDispatcher { - return newQAbstractEventDispatcher_U(unsafe.Pointer(C.QAbstractEventDispatcher_Instance())) + return UnsafeNewQAbstractEventDispatcher(unsafe.Pointer(C.QAbstractEventDispatcher_Instance())) } func (this *QAbstractEventDispatcher) ProcessEvents(flags QEventLoop__ProcessEventsFlag) bool { @@ -230,7 +237,7 @@ func QAbstractEventDispatcher_TrUtf83(s string, c string, n int) string { } func QAbstractEventDispatcher_Instance1(thread *QThread) *QAbstractEventDispatcher { - return newQAbstractEventDispatcher_U(unsafe.Pointer(C.QAbstractEventDispatcher_Instance1(thread.cPointer()))) + return UnsafeNewQAbstractEventDispatcher(unsafe.Pointer(C.QAbstractEventDispatcher_Instance1(thread.cPointer()))) } // Delete this object from C++ memory. @@ -258,6 +265,13 @@ func (this *QAbstractEventDispatcher__TimerInfo) cPointer() *C.QAbstractEventDis return this.h } +func (this *QAbstractEventDispatcher__TimerInfo) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractEventDispatcher__TimerInfo(h *C.QAbstractEventDispatcher__TimerInfo) *QAbstractEventDispatcher__TimerInfo { if h == nil { return nil @@ -265,7 +279,7 @@ func newQAbstractEventDispatcher__TimerInfo(h *C.QAbstractEventDispatcher__Timer return &QAbstractEventDispatcher__TimerInfo{h: h} } -func newQAbstractEventDispatcher__TimerInfo_U(h unsafe.Pointer) *QAbstractEventDispatcher__TimerInfo { +func UnsafeNewQAbstractEventDispatcher__TimerInfo(h unsafe.Pointer) *QAbstractEventDispatcher__TimerInfo { return newQAbstractEventDispatcher__TimerInfo((*C.QAbstractEventDispatcher__TimerInfo)(h)) } diff --git a/qt/gen_qabstracteventdispatcher.h b/qt/gen_qabstracteventdispatcher.h index f21e63a7..18e1043b 100644 --- a/qt/gen_qabstracteventdispatcher.h +++ b/qt/gen_qabstracteventdispatcher.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractitemdelegate.cpp b/qt/gen_qabstractitemdelegate.cpp index 2affb2ec..e7422266 100644 --- a/qt/gen_qabstractitemdelegate.cpp +++ b/qt/gen_qabstractitemdelegate.cpp @@ -14,7 +14,7 @@ #include #include #include -#include "qabstractitemdelegate.h" +#include #include "gen_qabstractitemdelegate.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractitemdelegate.go b/qt/gen_qabstractitemdelegate.go index 6b04c8e1..3296b0cb 100644 --- a/qt/gen_qabstractitemdelegate.go +++ b/qt/gen_qabstractitemdelegate.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -36,19 +37,26 @@ func (this *QAbstractItemDelegate) cPointer() *C.QAbstractItemDelegate { return this.h } +func (this *QAbstractItemDelegate) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractItemDelegate(h *C.QAbstractItemDelegate) *QAbstractItemDelegate { if h == nil { return nil } - return &QAbstractItemDelegate{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAbstractItemDelegate{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAbstractItemDelegate_U(h unsafe.Pointer) *QAbstractItemDelegate { +func UnsafeNewQAbstractItemDelegate(h unsafe.Pointer) *QAbstractItemDelegate { return newQAbstractItemDelegate((*C.QAbstractItemDelegate)(h)) } func (this *QAbstractItemDelegate) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractItemDelegate_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractItemDelegate_MetaObject(this.h))) } func (this *QAbstractItemDelegate) Metacast(param1 string) unsafe.Pointer { @@ -87,7 +95,7 @@ func (this *QAbstractItemDelegate) SizeHint(option *QStyleOptionViewItem, index } func (this *QAbstractItemDelegate) CreateEditor(parent *QWidget, option *QStyleOptionViewItem, index *QModelIndex) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QAbstractItemDelegate_CreateEditor(this.h, parent.cPointer(), option.cPointer(), index.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QAbstractItemDelegate_CreateEditor(this.h, parent.cPointer(), option.cPointer(), index.cPointer()))) } func (this *QAbstractItemDelegate) DestroyEditor(editor *QWidget, index *QModelIndex) { @@ -111,7 +119,7 @@ func (this *QAbstractItemDelegate) EditorEvent(event *QEvent, model *QAbstractIt } func QAbstractItemDelegate_ElidedText(fontMetrics *QFontMetrics, width int, mode TextElideMode, text string) string { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QAbstractItemDelegate_ElidedText(fontMetrics.cPointer(), (C.int)(width), (C.int)(mode), (*C.struct_miqt_string)(text_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -149,7 +157,7 @@ func miqt_exec_callback_QAbstractItemDelegate_CommitData(cb C.intptr_t, editor * } // Convert all CABI parameters to Go parameters - slotval1 := newQWidget_U(unsafe.Pointer(editor)) + slotval1 := UnsafeNewQWidget(unsafe.Pointer(editor)) gofunc(slotval1) } @@ -169,7 +177,7 @@ func miqt_exec_callback_QAbstractItemDelegate_CloseEditor(cb C.intptr_t, editor } // Convert all CABI parameters to Go parameters - slotval1 := newQWidget_U(unsafe.Pointer(editor)) + slotval1 := UnsafeNewQWidget(unsafe.Pointer(editor)) gofunc(slotval1) } @@ -189,7 +197,7 @@ func miqt_exec_callback_QAbstractItemDelegate_SizeHintChanged(cb C.intptr_t, par } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -253,7 +261,7 @@ func miqt_exec_callback_QAbstractItemDelegate_CloseEditor2(cb C.intptr_t, editor } // Convert all CABI parameters to Go parameters - slotval1 := newQWidget_U(unsafe.Pointer(editor)) + slotval1 := UnsafeNewQWidget(unsafe.Pointer(editor)) slotval2 := (QAbstractItemDelegate__EndEditHint)(hint) gofunc(slotval1, slotval2) diff --git a/qt/gen_qabstractitemdelegate.h b/qt/gen_qabstractitemdelegate.h index ef0c455f..332501a7 100644 --- a/qt/gen_qabstractitemdelegate.h +++ b/qt/gen_qabstractitemdelegate.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractitemmodel.cpp b/qt/gen_qabstractitemmodel.cpp index 8b63487d..f71620dd 100644 --- a/qt/gen_qabstractitemmodel.cpp +++ b/qt/gen_qabstractitemmodel.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qabstractitemmodel.h" +#include #include "gen_qabstractitemmodel.h" #include "_cgo_export.h" @@ -278,7 +278,7 @@ struct miqt_array* QAbstractItemModel_MimeTypes(const QAbstractItemModel* self) } QMimeData* QAbstractItemModel_MimeData(const QAbstractItemModel* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { diff --git a/qt/gen_qabstractitemmodel.go b/qt/gen_qabstractitemmodel.go index da2f83ed..9c9dc594 100644 --- a/qt/gen_qabstractitemmodel.go +++ b/qt/gen_qabstractitemmodel.go @@ -42,6 +42,13 @@ func (this *QModelIndex) cPointer() *C.QModelIndex { return this.h } +func (this *QModelIndex) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQModelIndex(h *C.QModelIndex) *QModelIndex { if h == nil { return nil @@ -49,7 +56,7 @@ func newQModelIndex(h *C.QModelIndex) *QModelIndex { return &QModelIndex{h: h} } -func newQModelIndex_U(h unsafe.Pointer) *QModelIndex { +func UnsafeNewQModelIndex(h unsafe.Pointer) *QModelIndex { return newQModelIndex((*C.QModelIndex)(h)) } @@ -128,7 +135,7 @@ func (this *QModelIndex) Flags() ItemFlag { } func (this *QModelIndex) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QModelIndex_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QModelIndex_Model(this.h))) } func (this *QModelIndex) IsValid() bool { @@ -179,6 +186,13 @@ func (this *QPersistentModelIndex) cPointer() *C.QPersistentModelIndex { return this.h } +func (this *QPersistentModelIndex) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPersistentModelIndex(h *C.QPersistentModelIndex) *QPersistentModelIndex { if h == nil { return nil @@ -186,7 +200,7 @@ func newQPersistentModelIndex(h *C.QPersistentModelIndex) *QPersistentModelIndex return &QPersistentModelIndex{h: h} } -func newQPersistentModelIndex_U(h unsafe.Pointer) *QPersistentModelIndex { +func UnsafeNewQPersistentModelIndex(h unsafe.Pointer) *QPersistentModelIndex { return newQPersistentModelIndex((*C.QPersistentModelIndex)(h)) } @@ -289,7 +303,7 @@ func (this *QPersistentModelIndex) Flags() ItemFlag { } func (this *QPersistentModelIndex) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QPersistentModelIndex_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QPersistentModelIndex_Model(this.h))) } func (this *QPersistentModelIndex) IsValid() bool { @@ -329,19 +343,26 @@ func (this *QAbstractItemModel) cPointer() *C.QAbstractItemModel { return this.h } +func (this *QAbstractItemModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractItemModel(h *C.QAbstractItemModel) *QAbstractItemModel { if h == nil { return nil } - return &QAbstractItemModel{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAbstractItemModel{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAbstractItemModel_U(h unsafe.Pointer) *QAbstractItemModel { +func UnsafeNewQAbstractItemModel(h unsafe.Pointer) *QAbstractItemModel { return newQAbstractItemModel((*C.QAbstractItemModel)(h)) } func (this *QAbstractItemModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractItemModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractItemModel_MetaObject(this.h))) } func (this *QAbstractItemModel) Metacast(param1 string) unsafe.Pointer { @@ -450,7 +471,7 @@ func (this *QAbstractItemModel) MimeData(indexes []QModelIndex) *QMimeData { } indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)} defer runtime.KeepAlive(unsafe.Pointer(indexes_ma)) - return newQMimeData_U(unsafe.Pointer(C.QAbstractItemModel_MimeData(this.h, indexes_ma))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QAbstractItemModel_MimeData(this.h, indexes_ma))) } func (this *QAbstractItemModel) CanDropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool { @@ -580,8 +601,8 @@ func miqt_exec_callback_QAbstractItemModel_DataChanged(cb C.intptr_t, topLeft *C } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(topLeft)) - slotval2 := newQModelIndex_U(unsafe.Pointer(bottomRight)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(topLeft)) + slotval2 := UnsafeNewQModelIndex(unsafe.Pointer(bottomRight)) gofunc(slotval1, slotval2) } @@ -832,8 +853,8 @@ func miqt_exec_callback_QAbstractItemModel_DataChanged3(cb C.intptr_t, topLeft * } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(topLeft)) - slotval2 := newQModelIndex_U(unsafe.Pointer(bottomRight)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(topLeft)) + slotval2 := UnsafeNewQModelIndex(unsafe.Pointer(bottomRight)) var roles_ma *C.struct_miqt_array = roles roles_ret := make([]int, int(roles_ma.len)) roles_outCast := (*[0xffff]C.int)(unsafe.Pointer(roles_ma.data)) // hey ya @@ -1028,19 +1049,26 @@ func (this *QAbstractTableModel) cPointer() *C.QAbstractTableModel { return this.h } +func (this *QAbstractTableModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractTableModel(h *C.QAbstractTableModel) *QAbstractTableModel { if h == nil { return nil } - return &QAbstractTableModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))} + return &QAbstractTableModel{h: h, QAbstractItemModel: UnsafeNewQAbstractItemModel(unsafe.Pointer(h))} } -func newQAbstractTableModel_U(h unsafe.Pointer) *QAbstractTableModel { +func UnsafeNewQAbstractTableModel(h unsafe.Pointer) *QAbstractTableModel { return newQAbstractTableModel((*C.QAbstractTableModel)(h)) } func (this *QAbstractTableModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractTableModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractTableModel_MetaObject(this.h))) } func (this *QAbstractTableModel) Metacast(param1 string) unsafe.Pointer { @@ -1166,19 +1194,26 @@ func (this *QAbstractListModel) cPointer() *C.QAbstractListModel { return this.h } +func (this *QAbstractListModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractListModel(h *C.QAbstractListModel) *QAbstractListModel { if h == nil { return nil } - return &QAbstractListModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))} + return &QAbstractListModel{h: h, QAbstractItemModel: UnsafeNewQAbstractItemModel(unsafe.Pointer(h))} } -func newQAbstractListModel_U(h unsafe.Pointer) *QAbstractListModel { +func UnsafeNewQAbstractListModel(h unsafe.Pointer) *QAbstractListModel { return newQAbstractListModel((*C.QAbstractListModel)(h)) } func (this *QAbstractListModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractListModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractListModel_MetaObject(this.h))) } func (this *QAbstractListModel) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qabstractitemmodel.h b/qt/gen_qabstractitemmodel.h index 4e9a43e3..b69d4c41 100644 --- a/qt/gen_qabstractitemmodel.h +++ b/qt/gen_qabstractitemmodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractitemview.cpp b/qt/gen_qabstractitemview.cpp index be7f8823..b14323e1 100644 --- a/qt/gen_qabstractitemview.cpp +++ b/qt/gen_qabstractitemview.cpp @@ -12,7 +12,7 @@ #include #include #include -#include "qabstractitemview.h" +#include #include "gen_qabstractitemview.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractitemview.go b/qt/gen_qabstractitemview.go index 4df7c9bd..45fc46a1 100644 --- a/qt/gen_qabstractitemview.go +++ b/qt/gen_qabstractitemview.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -82,19 +83,26 @@ func (this *QAbstractItemView) cPointer() *C.QAbstractItemView { return this.h } +func (this *QAbstractItemView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractItemView(h *C.QAbstractItemView) *QAbstractItemView { if h == nil { return nil } - return &QAbstractItemView{h: h, QAbstractScrollArea: newQAbstractScrollArea_U(unsafe.Pointer(h))} + return &QAbstractItemView{h: h, QAbstractScrollArea: UnsafeNewQAbstractScrollArea(unsafe.Pointer(h))} } -func newQAbstractItemView_U(h unsafe.Pointer) *QAbstractItemView { +func UnsafeNewQAbstractItemView(h unsafe.Pointer) *QAbstractItemView { return newQAbstractItemView((*C.QAbstractItemView)(h)) } func (this *QAbstractItemView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractItemView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractItemView_MetaObject(this.h))) } func (this *QAbstractItemView) Metacast(param1 string) unsafe.Pointer { @@ -126,7 +134,7 @@ func (this *QAbstractItemView) SetModel(model *QAbstractItemModel) { } func (this *QAbstractItemView) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QAbstractItemView_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QAbstractItemView_Model(this.h))) } func (this *QAbstractItemView) SetSelectionModel(selectionModel *QItemSelectionModel) { @@ -134,7 +142,7 @@ func (this *QAbstractItemView) SetSelectionModel(selectionModel *QItemSelectionM } func (this *QAbstractItemView) SelectionModel() *QItemSelectionModel { - return newQItemSelectionModel_U(unsafe.Pointer(C.QAbstractItemView_SelectionModel(this.h))) + return UnsafeNewQItemSelectionModel(unsafe.Pointer(C.QAbstractItemView_SelectionModel(this.h))) } func (this *QAbstractItemView) SetItemDelegate(delegate *QAbstractItemDelegate) { @@ -142,7 +150,7 @@ func (this *QAbstractItemView) SetItemDelegate(delegate *QAbstractItemDelegate) } func (this *QAbstractItemView) ItemDelegate() *QAbstractItemDelegate { - return newQAbstractItemDelegate_U(unsafe.Pointer(C.QAbstractItemView_ItemDelegate(this.h))) + return UnsafeNewQAbstractItemDelegate(unsafe.Pointer(C.QAbstractItemView_ItemDelegate(this.h))) } func (this *QAbstractItemView) SetSelectionMode(mode QAbstractItemView__SelectionMode) { @@ -299,7 +307,7 @@ func (this *QAbstractItemView) TextElideMode() TextElideMode { } func (this *QAbstractItemView) KeyboardSearch(search string) { - search_ms := miqt_strdupg(search) + search_ms := libmiqt.Strdupg(search) defer C.free(search_ms) C.QAbstractItemView_KeyboardSearch(this.h, (*C.struct_miqt_string)(search_ms)) } @@ -354,7 +362,7 @@ func (this *QAbstractItemView) SetIndexWidget(index *QModelIndex, widget *QWidge } func (this *QAbstractItemView) IndexWidget(index *QModelIndex) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QAbstractItemView_IndexWidget(this.h, index.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QAbstractItemView_IndexWidget(this.h, index.cPointer()))) } func (this *QAbstractItemView) SetItemDelegateForRow(row int, delegate *QAbstractItemDelegate) { @@ -362,7 +370,7 @@ func (this *QAbstractItemView) SetItemDelegateForRow(row int, delegate *QAbstrac } func (this *QAbstractItemView) ItemDelegateForRow(row int) *QAbstractItemDelegate { - return newQAbstractItemDelegate_U(unsafe.Pointer(C.QAbstractItemView_ItemDelegateForRow(this.h, (C.int)(row)))) + return UnsafeNewQAbstractItemDelegate(unsafe.Pointer(C.QAbstractItemView_ItemDelegateForRow(this.h, (C.int)(row)))) } func (this *QAbstractItemView) SetItemDelegateForColumn(column int, delegate *QAbstractItemDelegate) { @@ -370,11 +378,11 @@ func (this *QAbstractItemView) SetItemDelegateForColumn(column int, delegate *QA } func (this *QAbstractItemView) ItemDelegateForColumn(column int) *QAbstractItemDelegate { - return newQAbstractItemDelegate_U(unsafe.Pointer(C.QAbstractItemView_ItemDelegateForColumn(this.h, (C.int)(column)))) + return UnsafeNewQAbstractItemDelegate(unsafe.Pointer(C.QAbstractItemView_ItemDelegateForColumn(this.h, (C.int)(column)))) } func (this *QAbstractItemView) ItemDelegateWithIndex(index *QModelIndex) *QAbstractItemDelegate { - return newQAbstractItemDelegate_U(unsafe.Pointer(C.QAbstractItemView_ItemDelegateWithIndex(this.h, index.cPointer()))) + return UnsafeNewQAbstractItemDelegate(unsafe.Pointer(C.QAbstractItemView_ItemDelegateWithIndex(this.h, index.cPointer()))) } func (this *QAbstractItemView) InputMethodQuery(query InputMethodQuery) *QVariant { @@ -439,7 +447,7 @@ func miqt_exec_callback_QAbstractItemView_Pressed(cb C.intptr_t, index *C.QModel } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } @@ -459,7 +467,7 @@ func miqt_exec_callback_QAbstractItemView_Clicked(cb C.intptr_t, index *C.QModel } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } @@ -479,7 +487,7 @@ func miqt_exec_callback_QAbstractItemView_DoubleClicked(cb C.intptr_t, index *C. } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } @@ -499,7 +507,7 @@ func miqt_exec_callback_QAbstractItemView_Activated(cb C.intptr_t, index *C.QMod } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } @@ -519,7 +527,7 @@ func miqt_exec_callback_QAbstractItemView_Entered(cb C.intptr_t, index *C.QModel } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } @@ -556,7 +564,7 @@ func miqt_exec_callback_QAbstractItemView_IconSizeChanged(cb C.intptr_t, size *C } // Convert all CABI parameters to Go parameters - slotval1 := newQSize_U(unsafe.Pointer(size)) + slotval1 := UnsafeNewQSize(unsafe.Pointer(size)) gofunc(slotval1) } diff --git a/qt/gen_qabstractitemview.h b/qt/gen_qabstractitemview.h index 6b99c801..3b8ab5af 100644 --- a/qt/gen_qabstractitemview.h +++ b/qt/gen_qabstractitemview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractnativeeventfilter.cpp b/qt/gen_qabstractnativeeventfilter.cpp index 2ebca07c..d611c0bc 100644 --- a/qt/gen_qabstractnativeeventfilter.cpp +++ b/qt/gen_qabstractnativeeventfilter.cpp @@ -1,6 +1,6 @@ #include #include -#include "qabstractnativeeventfilter.h" +#include #include "gen_qabstractnativeeventfilter.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractnativeeventfilter.go b/qt/gen_qabstractnativeeventfilter.go index 9bf041ca..fdc1b584 100644 --- a/qt/gen_qabstractnativeeventfilter.go +++ b/qt/gen_qabstractnativeeventfilter.go @@ -24,6 +24,13 @@ func (this *QAbstractNativeEventFilter) cPointer() *C.QAbstractNativeEventFilter return this.h } +func (this *QAbstractNativeEventFilter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractNativeEventFilter(h *C.QAbstractNativeEventFilter) *QAbstractNativeEventFilter { if h == nil { return nil @@ -31,7 +38,7 @@ func newQAbstractNativeEventFilter(h *C.QAbstractNativeEventFilter) *QAbstractNa return &QAbstractNativeEventFilter{h: h} } -func newQAbstractNativeEventFilter_U(h unsafe.Pointer) *QAbstractNativeEventFilter { +func UnsafeNewQAbstractNativeEventFilter(h unsafe.Pointer) *QAbstractNativeEventFilter { return newQAbstractNativeEventFilter((*C.QAbstractNativeEventFilter)(h)) } diff --git a/qt/gen_qabstractnativeeventfilter.h b/qt/gen_qabstractnativeeventfilter.h index df23208e..399a7015 100644 --- a/qt/gen_qabstractnativeeventfilter.h +++ b/qt/gen_qabstractnativeeventfilter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractproxymodel.cpp b/qt/gen_qabstractproxymodel.cpp index 747c6bd7..63864de6 100644 --- a/qt/gen_qabstractproxymodel.cpp +++ b/qt/gen_qabstractproxymodel.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qabstractproxymodel.h" +#include #include "gen_qabstractproxymodel.h" #include "_cgo_export.h" @@ -109,7 +109,7 @@ QModelIndex* QAbstractProxyModel_Sibling(const QAbstractProxyModel* self, int ro } QMimeData* QAbstractProxyModel_MimeData(const QAbstractProxyModel* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { diff --git a/qt/gen_qabstractproxymodel.go b/qt/gen_qabstractproxymodel.go index 6a81995b..23222699 100644 --- a/qt/gen_qabstractproxymodel.go +++ b/qt/gen_qabstractproxymodel.go @@ -25,19 +25,26 @@ func (this *QAbstractProxyModel) cPointer() *C.QAbstractProxyModel { return this.h } +func (this *QAbstractProxyModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractProxyModel(h *C.QAbstractProxyModel) *QAbstractProxyModel { if h == nil { return nil } - return &QAbstractProxyModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))} + return &QAbstractProxyModel{h: h, QAbstractItemModel: UnsafeNewQAbstractItemModel(unsafe.Pointer(h))} } -func newQAbstractProxyModel_U(h unsafe.Pointer) *QAbstractProxyModel { +func UnsafeNewQAbstractProxyModel(h unsafe.Pointer) *QAbstractProxyModel { return newQAbstractProxyModel((*C.QAbstractProxyModel)(h)) } func (this *QAbstractProxyModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractProxyModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractProxyModel_MetaObject(this.h))) } func (this *QAbstractProxyModel) Metacast(param1 string) unsafe.Pointer { @@ -69,7 +76,7 @@ func (this *QAbstractProxyModel) SetSourceModel(sourceModel *QAbstractItemModel) } func (this *QAbstractProxyModel) SourceModel() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QAbstractProxyModel_SourceModel(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QAbstractProxyModel_SourceModel(this.h))) } func (this *QAbstractProxyModel) MapToSource(proxyIndex *QModelIndex) *QModelIndex { @@ -166,7 +173,7 @@ func (this *QAbstractProxyModel) MimeData(indexes []QModelIndex) *QMimeData { } indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)} defer runtime.KeepAlive(unsafe.Pointer(indexes_ma)) - return newQMimeData_U(unsafe.Pointer(C.QAbstractProxyModel_MimeData(this.h, indexes_ma))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QAbstractProxyModel_MimeData(this.h, indexes_ma))) } func (this *QAbstractProxyModel) CanDropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool { diff --git a/qt/gen_qabstractproxymodel.h b/qt/gen_qabstractproxymodel.h index 3c771f3b..44c2089c 100644 --- a/qt/gen_qabstractproxymodel.h +++ b/qt/gen_qabstractproxymodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractscrollarea.cpp b/qt/gen_qabstractscrollarea.cpp index 9d0e4ac4..e1c78bf3 100644 --- a/qt/gen_qabstractscrollarea.cpp +++ b/qt/gen_qabstractscrollarea.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qabstractscrollarea.h" +#include #include "gen_qabstractscrollarea.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractscrollarea.go b/qt/gen_qabstractscrollarea.go index a673b028..fa09968e 100644 --- a/qt/gen_qabstractscrollarea.go +++ b/qt/gen_qabstractscrollarea.go @@ -33,14 +33,21 @@ func (this *QAbstractScrollArea) cPointer() *C.QAbstractScrollArea { return this.h } +func (this *QAbstractScrollArea) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractScrollArea(h *C.QAbstractScrollArea) *QAbstractScrollArea { if h == nil { return nil } - return &QAbstractScrollArea{h: h, QFrame: newQFrame_U(unsafe.Pointer(h))} + return &QAbstractScrollArea{h: h, QFrame: UnsafeNewQFrame(unsafe.Pointer(h))} } -func newQAbstractScrollArea_U(h unsafe.Pointer) *QAbstractScrollArea { +func UnsafeNewQAbstractScrollArea(h unsafe.Pointer) *QAbstractScrollArea { return newQAbstractScrollArea((*C.QAbstractScrollArea)(h)) } @@ -57,7 +64,7 @@ func NewQAbstractScrollArea2(parent *QWidget) *QAbstractScrollArea { } func (this *QAbstractScrollArea) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractScrollArea_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractScrollArea_MetaObject(this.h))) } func (this *QAbstractScrollArea) Metacast(param1 string) unsafe.Pointer { @@ -93,7 +100,7 @@ func (this *QAbstractScrollArea) SetVerticalScrollBarPolicy(verticalScrollBarPol } func (this *QAbstractScrollArea) VerticalScrollBar() *QScrollBar { - return newQScrollBar_U(unsafe.Pointer(C.QAbstractScrollArea_VerticalScrollBar(this.h))) + return UnsafeNewQScrollBar(unsafe.Pointer(C.QAbstractScrollArea_VerticalScrollBar(this.h))) } func (this *QAbstractScrollArea) SetVerticalScrollBar(scrollbar *QScrollBar) { @@ -109,7 +116,7 @@ func (this *QAbstractScrollArea) SetHorizontalScrollBarPolicy(horizontalScrollBa } func (this *QAbstractScrollArea) HorizontalScrollBar() *QScrollBar { - return newQScrollBar_U(unsafe.Pointer(C.QAbstractScrollArea_HorizontalScrollBar(this.h))) + return UnsafeNewQScrollBar(unsafe.Pointer(C.QAbstractScrollArea_HorizontalScrollBar(this.h))) } func (this *QAbstractScrollArea) SetHorizontalScrollBar(scrollbar *QScrollBar) { @@ -117,7 +124,7 @@ func (this *QAbstractScrollArea) SetHorizontalScrollBar(scrollbar *QScrollBar) { } func (this *QAbstractScrollArea) CornerWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QAbstractScrollArea_CornerWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QAbstractScrollArea_CornerWidget(this.h))) } func (this *QAbstractScrollArea) SetCornerWidget(widget *QWidget) { @@ -133,14 +140,14 @@ func (this *QAbstractScrollArea) ScrollBarWidgets(alignment AlignmentFlag) []*QW _ret := make([]*QWidget, int(_ma.len)) _outCast := (*[0xffff]*C.QWidget)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQWidget_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQWidget(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QAbstractScrollArea) Viewport() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QAbstractScrollArea_Viewport(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QAbstractScrollArea_Viewport(this.h))) } func (this *QAbstractScrollArea) SetViewport(widget *QWidget) { diff --git a/qt/gen_qabstractscrollarea.h b/qt/gen_qabstractscrollarea.h index b43978f0..18a0e8a2 100644 --- a/qt/gen_qabstractscrollarea.h +++ b/qt/gen_qabstractscrollarea.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractslider.cpp b/qt/gen_qabstractslider.cpp index 8f2d5590..d50b6073 100644 --- a/qt/gen_qabstractslider.cpp +++ b/qt/gen_qabstractslider.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qabstractslider.h" +#include #include "gen_qabstractslider.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractslider.go b/qt/gen_qabstractslider.go index 4aeaceb6..0bd359e6 100644 --- a/qt/gen_qabstractslider.go +++ b/qt/gen_qabstractslider.go @@ -39,14 +39,21 @@ func (this *QAbstractSlider) cPointer() *C.QAbstractSlider { return this.h } +func (this *QAbstractSlider) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractSlider(h *C.QAbstractSlider) *QAbstractSlider { if h == nil { return nil } - return &QAbstractSlider{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QAbstractSlider{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQAbstractSlider_U(h unsafe.Pointer) *QAbstractSlider { +func UnsafeNewQAbstractSlider(h unsafe.Pointer) *QAbstractSlider { return newQAbstractSlider((*C.QAbstractSlider)(h)) } @@ -63,7 +70,7 @@ func NewQAbstractSlider2(parent *QWidget) *QAbstractSlider { } func (this *QAbstractSlider) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractSlider_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractSlider_MetaObject(this.h))) } func (this *QAbstractSlider) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qabstractslider.h b/qt/gen_qabstractslider.h index 999adc49..a66fd711 100644 --- a/qt/gen_qabstractslider.h +++ b/qt/gen_qabstractslider.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractspinbox.cpp b/qt/gen_qabstractspinbox.cpp index e93a23e9..ddc85c57 100644 --- a/qt/gen_qabstractspinbox.cpp +++ b/qt/gen_qabstractspinbox.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qabstractspinbox.h" +#include #include "gen_qabstractspinbox.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractspinbox.go b/qt/gen_qabstractspinbox.go index 1b4c5651..eda35edf 100644 --- a/qt/gen_qabstractspinbox.go +++ b/qt/gen_qabstractspinbox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -56,14 +57,21 @@ func (this *QAbstractSpinBox) cPointer() *C.QAbstractSpinBox { return this.h } +func (this *QAbstractSpinBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractSpinBox(h *C.QAbstractSpinBox) *QAbstractSpinBox { if h == nil { return nil } - return &QAbstractSpinBox{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QAbstractSpinBox{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQAbstractSpinBox_U(h unsafe.Pointer) *QAbstractSpinBox { +func UnsafeNewQAbstractSpinBox(h unsafe.Pointer) *QAbstractSpinBox { return newQAbstractSpinBox((*C.QAbstractSpinBox)(h)) } @@ -80,7 +88,7 @@ func NewQAbstractSpinBox2(parent *QWidget) *QAbstractSpinBox { } func (this *QAbstractSpinBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractSpinBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractSpinBox_MetaObject(this.h))) } func (this *QAbstractSpinBox) Metacast(param1 string) unsafe.Pointer { @@ -142,7 +150,7 @@ func (this *QAbstractSpinBox) SpecialValueText() string { } func (this *QAbstractSpinBox) SetSpecialValueText(txt string) { - txt_ms := miqt_strdupg(txt) + txt_ms := libmiqt.Strdupg(txt) defer C.free(txt_ms) C.QAbstractSpinBox_SetSpecialValueText(this.h, (*C.struct_miqt_string)(txt_ms)) } @@ -233,13 +241,13 @@ func (this *QAbstractSpinBox) InputMethodQuery(param1 InputMethodQuery) *QVarian } func (this *QAbstractSpinBox) Validate(input string, pos *int) QValidator__State { - input_ms := miqt_strdupg(input) + input_ms := libmiqt.Strdupg(input) defer C.free(input_ms) return (QValidator__State)(C.QAbstractSpinBox_Validate(this.h, (*C.struct_miqt_string)(input_ms), (*C.int)(unsafe.Pointer(pos)))) } func (this *QAbstractSpinBox) Fixup(input string) { - input_ms := miqt_strdupg(input) + input_ms := libmiqt.Strdupg(input) defer C.free(input_ms) C.QAbstractSpinBox_Fixup(this.h, (*C.struct_miqt_string)(input_ms)) } diff --git a/qt/gen_qabstractspinbox.h b/qt/gen_qabstractspinbox.h index a984658e..2c2d7515 100644 --- a/qt/gen_qabstractspinbox.h +++ b/qt/gen_qabstractspinbox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstractstate.cpp b/qt/gen_qabstractstate.cpp index bf38d43b..26d9d32a 100644 --- a/qt/gen_qabstractstate.cpp +++ b/qt/gen_qabstractstate.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qabstractstate.h" +#include #include "gen_qabstractstate.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstractstate.go b/qt/gen_qabstractstate.go index 1613fa01..29d46224 100644 --- a/qt/gen_qabstractstate.go +++ b/qt/gen_qabstractstate.go @@ -26,19 +26,26 @@ func (this *QAbstractState) cPointer() *C.QAbstractState { return this.h } +func (this *QAbstractState) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractState(h *C.QAbstractState) *QAbstractState { if h == nil { return nil } - return &QAbstractState{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAbstractState{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAbstractState_U(h unsafe.Pointer) *QAbstractState { +func UnsafeNewQAbstractState(h unsafe.Pointer) *QAbstractState { return newQAbstractState((*C.QAbstractState)(h)) } func (this *QAbstractState) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractState_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractState_MetaObject(this.h))) } func (this *QAbstractState) Metacast(param1 string) unsafe.Pointer { @@ -66,11 +73,11 @@ func QAbstractState_TrUtf8(s string) string { } func (this *QAbstractState) ParentState() *QState { - return newQState_U(unsafe.Pointer(C.QAbstractState_ParentState(this.h))) + return UnsafeNewQState(unsafe.Pointer(C.QAbstractState_ParentState(this.h))) } func (this *QAbstractState) Machine() *QStateMachine { - return newQStateMachine_U(unsafe.Pointer(C.QAbstractState_Machine(this.h))) + return UnsafeNewQStateMachine(unsafe.Pointer(C.QAbstractState_Machine(this.h))) } func (this *QAbstractState) Active() bool { diff --git a/qt/gen_qabstractstate.h b/qt/gen_qabstractstate.h index ca5be453..71a1e8e6 100644 --- a/qt/gen_qabstractstate.h +++ b/qt/gen_qabstractstate.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstracttextdocumentlayout.cpp b/qt/gen_qabstracttextdocumentlayout.cpp index 3d373925..7a6abf82 100644 --- a/qt/gen_qabstracttextdocumentlayout.cpp +++ b/qt/gen_qabstracttextdocumentlayout.cpp @@ -16,7 +16,7 @@ #include #include #include -#include "qabstracttextdocumentlayout.h" +#include #include "gen_qabstracttextdocumentlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qabstracttextdocumentlayout.go b/qt/gen_qabstracttextdocumentlayout.go index b6e9621c..0ee0bab9 100644 --- a/qt/gen_qabstracttextdocumentlayout.go +++ b/qt/gen_qabstracttextdocumentlayout.go @@ -26,19 +26,26 @@ func (this *QAbstractTextDocumentLayout) cPointer() *C.QAbstractTextDocumentLayo return this.h } +func (this *QAbstractTextDocumentLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractTextDocumentLayout(h *C.QAbstractTextDocumentLayout) *QAbstractTextDocumentLayout { if h == nil { return nil } - return &QAbstractTextDocumentLayout{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAbstractTextDocumentLayout{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAbstractTextDocumentLayout_U(h unsafe.Pointer) *QAbstractTextDocumentLayout { +func UnsafeNewQAbstractTextDocumentLayout(h unsafe.Pointer) *QAbstractTextDocumentLayout { return newQAbstractTextDocumentLayout((*C.QAbstractTextDocumentLayout)(h)) } func (this *QAbstractTextDocumentLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractTextDocumentLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractTextDocumentLayout_MetaObject(this.h))) } func (this *QAbstractTextDocumentLayout) Metacast(param1 string) unsafe.Pointer { @@ -131,11 +138,11 @@ func (this *QAbstractTextDocumentLayout) SetPaintDevice(device *QPaintDevice) { } func (this *QAbstractTextDocumentLayout) PaintDevice() *QPaintDevice { - return newQPaintDevice_U(unsafe.Pointer(C.QAbstractTextDocumentLayout_PaintDevice(this.h))) + return UnsafeNewQPaintDevice(unsafe.Pointer(C.QAbstractTextDocumentLayout_PaintDevice(this.h))) } func (this *QAbstractTextDocumentLayout) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QAbstractTextDocumentLayout_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QAbstractTextDocumentLayout_Document(this.h))) } func (this *QAbstractTextDocumentLayout) RegisterHandler(objectType int, component *QObject) { @@ -147,7 +154,7 @@ func (this *QAbstractTextDocumentLayout) UnregisterHandler(objectType int) { } func (this *QAbstractTextDocumentLayout) HandlerForObject(objectType int) *QTextObjectInterface { - return newQTextObjectInterface_U(unsafe.Pointer(C.QAbstractTextDocumentLayout_HandlerForObject(this.h, (C.int)(objectType)))) + return UnsafeNewQTextObjectInterface(unsafe.Pointer(C.QAbstractTextDocumentLayout_HandlerForObject(this.h, (C.int)(objectType)))) } func (this *QAbstractTextDocumentLayout) Update() { @@ -182,7 +189,7 @@ func miqt_exec_callback_QAbstractTextDocumentLayout_UpdateBlock(cb C.intptr_t, b } // Convert all CABI parameters to Go parameters - slotval1 := newQTextBlock_U(unsafe.Pointer(block)) + slotval1 := UnsafeNewQTextBlock(unsafe.Pointer(block)) gofunc(slotval1) } @@ -202,7 +209,7 @@ func miqt_exec_callback_QAbstractTextDocumentLayout_DocumentSizeChanged(cb C.int } // Convert all CABI parameters to Go parameters - slotval1 := newQSizeF_U(unsafe.Pointer(newSize)) + slotval1 := UnsafeNewQSizeF(unsafe.Pointer(newSize)) gofunc(slotval1) } @@ -290,7 +297,7 @@ func miqt_exec_callback_QAbstractTextDocumentLayout_Update1(cb C.intptr_t, param } // Convert all CABI parameters to Go parameters - slotval1 := newQRectF_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQRectF(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -320,6 +327,13 @@ func (this *QTextObjectInterface) cPointer() *C.QTextObjectInterface { return this.h } +func (this *QTextObjectInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextObjectInterface(h *C.QTextObjectInterface) *QTextObjectInterface { if h == nil { return nil @@ -327,7 +341,7 @@ func newQTextObjectInterface(h *C.QTextObjectInterface) *QTextObjectInterface { return &QTextObjectInterface{h: h} } -func newQTextObjectInterface_U(h unsafe.Pointer) *QTextObjectInterface { +func UnsafeNewQTextObjectInterface(h unsafe.Pointer) *QTextObjectInterface { return newQTextObjectInterface((*C.QTextObjectInterface)(h)) } @@ -371,6 +385,13 @@ func (this *QAbstractTextDocumentLayout__Selection) cPointer() *C.QAbstractTextD return this.h } +func (this *QAbstractTextDocumentLayout__Selection) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractTextDocumentLayout__Selection(h *C.QAbstractTextDocumentLayout__Selection) *QAbstractTextDocumentLayout__Selection { if h == nil { return nil @@ -378,7 +399,7 @@ func newQAbstractTextDocumentLayout__Selection(h *C.QAbstractTextDocumentLayout_ return &QAbstractTextDocumentLayout__Selection{h: h} } -func newQAbstractTextDocumentLayout__Selection_U(h unsafe.Pointer) *QAbstractTextDocumentLayout__Selection { +func UnsafeNewQAbstractTextDocumentLayout__Selection(h unsafe.Pointer) *QAbstractTextDocumentLayout__Selection { return newQAbstractTextDocumentLayout__Selection((*C.QAbstractTextDocumentLayout__Selection)(h)) } @@ -417,6 +438,13 @@ func (this *QAbstractTextDocumentLayout__PaintContext) cPointer() *C.QAbstractTe return this.h } +func (this *QAbstractTextDocumentLayout__PaintContext) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractTextDocumentLayout__PaintContext(h *C.QAbstractTextDocumentLayout__PaintContext) *QAbstractTextDocumentLayout__PaintContext { if h == nil { return nil @@ -424,7 +452,7 @@ func newQAbstractTextDocumentLayout__PaintContext(h *C.QAbstractTextDocumentLayo return &QAbstractTextDocumentLayout__PaintContext{h: h} } -func newQAbstractTextDocumentLayout__PaintContext_U(h unsafe.Pointer) *QAbstractTextDocumentLayout__PaintContext { +func UnsafeNewQAbstractTextDocumentLayout__PaintContext(h unsafe.Pointer) *QAbstractTextDocumentLayout__PaintContext { return newQAbstractTextDocumentLayout__PaintContext((*C.QAbstractTextDocumentLayout__PaintContext)(h)) } diff --git a/qt/gen_qabstracttextdocumentlayout.h b/qt/gen_qabstracttextdocumentlayout.h index 981fdedc..7c29c6fa 100644 --- a/qt/gen_qabstracttextdocumentlayout.h +++ b/qt/gen_qabstracttextdocumentlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qabstracttransition.cpp b/qt/gen_qabstracttransition.cpp index a8541903..03a464b4 100644 --- a/qt/gen_qabstracttransition.cpp +++ b/qt/gen_qabstracttransition.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qabstracttransition.h" +#include #include "gen_qabstracttransition.h" #include "_cgo_export.h" @@ -60,7 +60,7 @@ struct miqt_array* QAbstractTransition_TargetStates(const QAbstractTransition* s } void QAbstractTransition_SetTargetStates(QAbstractTransition* self, struct miqt_array* /* of QAbstractState* */ targets) { - QList targets_QList; + QList targets_QList; targets_QList.reserve(targets->len); QAbstractState** targets_arr = static_cast(targets->data); for(size_t i = 0; i < targets->len; ++i) { diff --git a/qt/gen_qabstracttransition.go b/qt/gen_qabstracttransition.go index aeb5ffe4..523d33f1 100644 --- a/qt/gen_qabstracttransition.go +++ b/qt/gen_qabstracttransition.go @@ -32,19 +32,26 @@ func (this *QAbstractTransition) cPointer() *C.QAbstractTransition { return this.h } +func (this *QAbstractTransition) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractTransition(h *C.QAbstractTransition) *QAbstractTransition { if h == nil { return nil } - return &QAbstractTransition{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAbstractTransition{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAbstractTransition_U(h unsafe.Pointer) *QAbstractTransition { +func UnsafeNewQAbstractTransition(h unsafe.Pointer) *QAbstractTransition { return newQAbstractTransition((*C.QAbstractTransition)(h)) } func (this *QAbstractTransition) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAbstractTransition_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractTransition_MetaObject(this.h))) } func (this *QAbstractTransition) Metacast(param1 string) unsafe.Pointer { @@ -72,11 +79,11 @@ func QAbstractTransition_TrUtf8(s string) string { } func (this *QAbstractTransition) SourceState() *QState { - return newQState_U(unsafe.Pointer(C.QAbstractTransition_SourceState(this.h))) + return UnsafeNewQState(unsafe.Pointer(C.QAbstractTransition_SourceState(this.h))) } func (this *QAbstractTransition) TargetState() *QAbstractState { - return newQAbstractState_U(unsafe.Pointer(C.QAbstractTransition_TargetState(this.h))) + return UnsafeNewQAbstractState(unsafe.Pointer(C.QAbstractTransition_TargetState(this.h))) } func (this *QAbstractTransition) SetTargetState(target *QAbstractState) { @@ -88,7 +95,7 @@ func (this *QAbstractTransition) TargetStates() []*QAbstractState { _ret := make([]*QAbstractState, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractState)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractState_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractState(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -115,7 +122,7 @@ func (this *QAbstractTransition) SetTransitionType(typeVal QAbstractTransition__ } func (this *QAbstractTransition) Machine() *QStateMachine { - return newQStateMachine_U(unsafe.Pointer(C.QAbstractTransition_Machine(this.h))) + return UnsafeNewQStateMachine(unsafe.Pointer(C.QAbstractTransition_Machine(this.h))) } func (this *QAbstractTransition) AddAnimation(animation *QAbstractAnimation) { @@ -131,7 +138,7 @@ func (this *QAbstractTransition) Animations() []*QAbstractAnimation { _ret := make([]*QAbstractAnimation, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractAnimation)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractAnimation_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractAnimation(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret diff --git a/qt/gen_qabstracttransition.h b/qt/gen_qabstracttransition.h index 5f72dd18..3aaf9629 100644 --- a/qt/gen_qabstracttransition.h +++ b/qt/gen_qabstracttransition.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qaccessible.cpp b/qt/gen_qaccessible.cpp index 954101f2..851828ab 100644 --- a/qt/gen_qaccessible.cpp +++ b/qt/gen_qaccessible.cpp @@ -29,7 +29,7 @@ #include #include #include -#include "qaccessible.h" +#include #include "gen_qaccessible.h" #include "_cgo_export.h" diff --git a/qt/gen_qaccessible.go b/qt/gen_qaccessible.go index 5eff4e2f..ce9cfc9f 100644 --- a/qt/gen_qaccessible.go +++ b/qt/gen_qaccessible.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -236,6 +237,13 @@ func (this *QAccessible) cPointer() *C.QAccessible { return this.h } +func (this *QAccessible) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessible(h *C.QAccessible) *QAccessible { if h == nil { return nil @@ -243,7 +251,7 @@ func newQAccessible(h *C.QAccessible) *QAccessible { return &QAccessible{h: h} } -func newQAccessible_U(h unsafe.Pointer) *QAccessible { +func UnsafeNewQAccessible(h unsafe.Pointer) *QAccessible { return newQAccessible((*C.QAccessible)(h)) } @@ -256,7 +264,7 @@ func QAccessible_RemoveActivationObserver(param1 *QAccessible__ActivationObserve } func QAccessible_QueryAccessibleInterface(param1 *QObject) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessible_QueryAccessibleInterface(param1.cPointer()))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessible_QueryAccessibleInterface(param1.cPointer()))) } func QAccessible_UniqueId(iface *QAccessibleInterface) uint { @@ -264,7 +272,7 @@ func QAccessible_UniqueId(iface *QAccessibleInterface) uint { } func QAccessible_AccessibleInterface(uniqueId uint) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessible_AccessibleInterface((C.uint)(uniqueId)))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessible_AccessibleInterface((C.uint)(uniqueId)))) } func QAccessible_RegisterAccessibleInterface(iface *QAccessibleInterface) uint { @@ -320,6 +328,13 @@ func (this *QAccessibleInterface) cPointer() *C.QAccessibleInterface { return this.h } +func (this *QAccessibleInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleInterface(h *C.QAccessibleInterface) *QAccessibleInterface { if h == nil { return nil @@ -327,7 +342,7 @@ func newQAccessibleInterface(h *C.QAccessibleInterface) *QAccessibleInterface { return &QAccessibleInterface{h: h} } -func newQAccessibleInterface_U(h unsafe.Pointer) *QAccessibleInterface { +func UnsafeNewQAccessibleInterface(h unsafe.Pointer) *QAccessibleInterface { return newQAccessibleInterface((*C.QAccessibleInterface)(h)) } @@ -336,27 +351,27 @@ func (this *QAccessibleInterface) IsValid() bool { } func (this *QAccessibleInterface) Object() *QObject { - return newQObject_U(unsafe.Pointer(C.QAccessibleInterface_Object(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QAccessibleInterface_Object(this.h))) } func (this *QAccessibleInterface) Window() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QAccessibleInterface_Window(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QAccessibleInterface_Window(this.h))) } func (this *QAccessibleInterface) FocusChild() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleInterface_FocusChild(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleInterface_FocusChild(this.h))) } func (this *QAccessibleInterface) ChildAt(x int, y int) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleInterface_ChildAt(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleInterface_ChildAt(this.h, (C.int)(x), (C.int)(y)))) } func (this *QAccessibleInterface) Parent() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleInterface_Parent(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleInterface_Parent(this.h))) } func (this *QAccessibleInterface) Child(index int) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleInterface_Child(this.h, (C.int)(index)))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleInterface_Child(this.h, (C.int)(index)))) } func (this *QAccessibleInterface) ChildCount() int { @@ -375,7 +390,7 @@ func (this *QAccessibleInterface) Text(t QAccessible__Text) string { } func (this *QAccessibleInterface) SetText(t QAccessible__Text, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QAccessibleInterface_SetText(this.h, (C.int)(t), (*C.struct_miqt_string)(text_ms)) } @@ -413,31 +428,31 @@ func (this *QAccessibleInterface) BackgroundColor() *QColor { } func (this *QAccessibleInterface) TextInterface() *QAccessibleTextInterface { - return newQAccessibleTextInterface_U(unsafe.Pointer(C.QAccessibleInterface_TextInterface(this.h))) + return UnsafeNewQAccessibleTextInterface(unsafe.Pointer(C.QAccessibleInterface_TextInterface(this.h))) } func (this *QAccessibleInterface) EditableTextInterface() *QAccessibleEditableTextInterface { - return newQAccessibleEditableTextInterface_U(unsafe.Pointer(C.QAccessibleInterface_EditableTextInterface(this.h))) + return UnsafeNewQAccessibleEditableTextInterface(unsafe.Pointer(C.QAccessibleInterface_EditableTextInterface(this.h))) } func (this *QAccessibleInterface) ValueInterface() *QAccessibleValueInterface { - return newQAccessibleValueInterface_U(unsafe.Pointer(C.QAccessibleInterface_ValueInterface(this.h))) + return UnsafeNewQAccessibleValueInterface(unsafe.Pointer(C.QAccessibleInterface_ValueInterface(this.h))) } func (this *QAccessibleInterface) ActionInterface() *QAccessibleActionInterface { - return newQAccessibleActionInterface_U(unsafe.Pointer(C.QAccessibleInterface_ActionInterface(this.h))) + return UnsafeNewQAccessibleActionInterface(unsafe.Pointer(C.QAccessibleInterface_ActionInterface(this.h))) } func (this *QAccessibleInterface) ImageInterface() *QAccessibleImageInterface { - return newQAccessibleImageInterface_U(unsafe.Pointer(C.QAccessibleInterface_ImageInterface(this.h))) + return UnsafeNewQAccessibleImageInterface(unsafe.Pointer(C.QAccessibleInterface_ImageInterface(this.h))) } func (this *QAccessibleInterface) TableInterface() *QAccessibleTableInterface { - return newQAccessibleTableInterface_U(unsafe.Pointer(C.QAccessibleInterface_TableInterface(this.h))) + return UnsafeNewQAccessibleTableInterface(unsafe.Pointer(C.QAccessibleInterface_TableInterface(this.h))) } func (this *QAccessibleInterface) TableCellInterface() *QAccessibleTableCellInterface { - return newQAccessibleTableCellInterface_U(unsafe.Pointer(C.QAccessibleInterface_TableCellInterface(this.h))) + return UnsafeNewQAccessibleTableCellInterface(unsafe.Pointer(C.QAccessibleInterface_TableCellInterface(this.h))) } func (this *QAccessibleInterface) VirtualHook(id int, data unsafe.Pointer) { @@ -459,6 +474,13 @@ func (this *QAccessibleTextInterface) cPointer() *C.QAccessibleTextInterface { return this.h } +func (this *QAccessibleTextInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTextInterface(h *C.QAccessibleTextInterface) *QAccessibleTextInterface { if h == nil { return nil @@ -466,7 +488,7 @@ func newQAccessibleTextInterface(h *C.QAccessibleTextInterface) *QAccessibleText return &QAccessibleTextInterface{h: h} } -func newQAccessibleTextInterface_U(h unsafe.Pointer) *QAccessibleTextInterface { +func UnsafeNewQAccessibleTextInterface(h unsafe.Pointer) *QAccessibleTextInterface { return newQAccessibleTextInterface((*C.QAccessibleTextInterface)(h)) } @@ -581,6 +603,13 @@ func (this *QAccessibleEditableTextInterface) cPointer() *C.QAccessibleEditableT return this.h } +func (this *QAccessibleEditableTextInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleEditableTextInterface(h *C.QAccessibleEditableTextInterface) *QAccessibleEditableTextInterface { if h == nil { return nil @@ -588,7 +617,7 @@ func newQAccessibleEditableTextInterface(h *C.QAccessibleEditableTextInterface) return &QAccessibleEditableTextInterface{h: h} } -func newQAccessibleEditableTextInterface_U(h unsafe.Pointer) *QAccessibleEditableTextInterface { +func UnsafeNewQAccessibleEditableTextInterface(h unsafe.Pointer) *QAccessibleEditableTextInterface { return newQAccessibleEditableTextInterface((*C.QAccessibleEditableTextInterface)(h)) } @@ -597,13 +626,13 @@ func (this *QAccessibleEditableTextInterface) DeleteText(startOffset int, endOff } func (this *QAccessibleEditableTextInterface) InsertText(offset int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QAccessibleEditableTextInterface_InsertText(this.h, (C.int)(offset), (*C.struct_miqt_string)(text_ms)) } func (this *QAccessibleEditableTextInterface) ReplaceText(startOffset int, endOffset int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QAccessibleEditableTextInterface_ReplaceText(this.h, (C.int)(startOffset), (C.int)(endOffset), (*C.struct_miqt_string)(text_ms)) } @@ -637,6 +666,13 @@ func (this *QAccessibleValueInterface) cPointer() *C.QAccessibleValueInterface { return this.h } +func (this *QAccessibleValueInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleValueInterface(h *C.QAccessibleValueInterface) *QAccessibleValueInterface { if h == nil { return nil @@ -644,7 +680,7 @@ func newQAccessibleValueInterface(h *C.QAccessibleValueInterface) *QAccessibleVa return &QAccessibleValueInterface{h: h} } -func newQAccessibleValueInterface_U(h unsafe.Pointer) *QAccessibleValueInterface { +func UnsafeNewQAccessibleValueInterface(h unsafe.Pointer) *QAccessibleValueInterface { return newQAccessibleValueInterface((*C.QAccessibleValueInterface)(h)) } @@ -709,6 +745,13 @@ func (this *QAccessibleTableCellInterface) cPointer() *C.QAccessibleTableCellInt return this.h } +func (this *QAccessibleTableCellInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTableCellInterface(h *C.QAccessibleTableCellInterface) *QAccessibleTableCellInterface { if h == nil { return nil @@ -716,7 +759,7 @@ func newQAccessibleTableCellInterface(h *C.QAccessibleTableCellInterface) *QAcce return &QAccessibleTableCellInterface{h: h} } -func newQAccessibleTableCellInterface_U(h unsafe.Pointer) *QAccessibleTableCellInterface { +func UnsafeNewQAccessibleTableCellInterface(h unsafe.Pointer) *QAccessibleTableCellInterface { return newQAccessibleTableCellInterface((*C.QAccessibleTableCellInterface)(h)) } @@ -729,7 +772,7 @@ func (this *QAccessibleTableCellInterface) ColumnHeaderCells() []*QAccessibleInt _ret := make([]*QAccessibleInterface, int(_ma.len)) _outCast := (*[0xffff]*C.QAccessibleInterface)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAccessibleInterface_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAccessibleInterface(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -740,7 +783,7 @@ func (this *QAccessibleTableCellInterface) RowHeaderCells() []*QAccessibleInterf _ret := make([]*QAccessibleInterface, int(_ma.len)) _outCast := (*[0xffff]*C.QAccessibleInterface)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAccessibleInterface_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAccessibleInterface(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -763,7 +806,7 @@ func (this *QAccessibleTableCellInterface) RowExtent() int { } func (this *QAccessibleTableCellInterface) Table() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleTableCellInterface_Table(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleTableCellInterface_Table(this.h))) } func (this *QAccessibleTableCellInterface) OperatorAssign(param1 *QAccessibleTableCellInterface) { @@ -795,6 +838,13 @@ func (this *QAccessibleTableInterface) cPointer() *C.QAccessibleTableInterface { return this.h } +func (this *QAccessibleTableInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTableInterface(h *C.QAccessibleTableInterface) *QAccessibleTableInterface { if h == nil { return nil @@ -802,20 +852,20 @@ func newQAccessibleTableInterface(h *C.QAccessibleTableInterface) *QAccessibleTa return &QAccessibleTableInterface{h: h} } -func newQAccessibleTableInterface_U(h unsafe.Pointer) *QAccessibleTableInterface { +func UnsafeNewQAccessibleTableInterface(h unsafe.Pointer) *QAccessibleTableInterface { return newQAccessibleTableInterface((*C.QAccessibleTableInterface)(h)) } func (this *QAccessibleTableInterface) Caption() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleTableInterface_Caption(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleTableInterface_Caption(this.h))) } func (this *QAccessibleTableInterface) Summary() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleTableInterface_Summary(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleTableInterface_Summary(this.h))) } func (this *QAccessibleTableInterface) CellAt(row int, column int) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleTableInterface_CellAt(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleTableInterface_CellAt(this.h, (C.int)(row), (C.int)(column)))) } func (this *QAccessibleTableInterface) SelectedCellCount() int { @@ -827,7 +877,7 @@ func (this *QAccessibleTableInterface) SelectedCells() []*QAccessibleInterface { _ret := make([]*QAccessibleInterface, int(_ma.len)) _outCast := (*[0xffff]*C.QAccessibleInterface)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAccessibleInterface_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAccessibleInterface(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -938,6 +988,13 @@ func (this *QAccessibleActionInterface) cPointer() *C.QAccessibleActionInterface return this.h } +func (this *QAccessibleActionInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleActionInterface(h *C.QAccessibleActionInterface) *QAccessibleActionInterface { if h == nil { return nil @@ -945,7 +1002,7 @@ func newQAccessibleActionInterface(h *C.QAccessibleActionInterface) *QAccessible return &QAccessibleActionInterface{h: h} } -func newQAccessibleActionInterface_U(h unsafe.Pointer) *QAccessibleActionInterface { +func UnsafeNewQAccessibleActionInterface(h unsafe.Pointer) *QAccessibleActionInterface { return newQAccessibleActionInterface((*C.QAccessibleActionInterface)(h)) } @@ -982,7 +1039,7 @@ func (this *QAccessibleActionInterface) ActionNames() []string { } func (this *QAccessibleActionInterface) LocalizedActionName(name string) string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) var _ms *C.struct_miqt_string = C.QAccessibleActionInterface_LocalizedActionName(this.h, (*C.struct_miqt_string)(name_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -991,7 +1048,7 @@ func (this *QAccessibleActionInterface) LocalizedActionName(name string) string } func (this *QAccessibleActionInterface) LocalizedActionDescription(name string) string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) var _ms *C.struct_miqt_string = C.QAccessibleActionInterface_LocalizedActionDescription(this.h, (*C.struct_miqt_string)(name_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1000,13 +1057,13 @@ func (this *QAccessibleActionInterface) LocalizedActionDescription(name string) } func (this *QAccessibleActionInterface) DoAction(actionName string) { - actionName_ms := miqt_strdupg(actionName) + actionName_ms := libmiqt.Strdupg(actionName) defer C.free(actionName_ms) C.QAccessibleActionInterface_DoAction(this.h, (*C.struct_miqt_string)(actionName_ms)) } func (this *QAccessibleActionInterface) KeyBindingsForAction(actionName string) []string { - actionName_ms := miqt_strdupg(actionName) + actionName_ms := libmiqt.Strdupg(actionName) defer C.free(actionName_ms) var _ma *C.struct_miqt_array = C.QAccessibleActionInterface_KeyBindingsForAction(this.h, (*C.struct_miqt_string)(actionName_ms)) _ret := make([]string, int(_ma.len)) @@ -1178,6 +1235,13 @@ func (this *QAccessibleImageInterface) cPointer() *C.QAccessibleImageInterface { return this.h } +func (this *QAccessibleImageInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleImageInterface(h *C.QAccessibleImageInterface) *QAccessibleImageInterface { if h == nil { return nil @@ -1185,7 +1249,7 @@ func newQAccessibleImageInterface(h *C.QAccessibleImageInterface) *QAccessibleIm return &QAccessibleImageInterface{h: h} } -func newQAccessibleImageInterface_U(h unsafe.Pointer) *QAccessibleImageInterface { +func UnsafeNewQAccessibleImageInterface(h unsafe.Pointer) *QAccessibleImageInterface { return newQAccessibleImageInterface((*C.QAccessibleImageInterface)(h)) } @@ -1239,6 +1303,13 @@ func (this *QAccessibleEvent) cPointer() *C.QAccessibleEvent { return this.h } +func (this *QAccessibleEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleEvent(h *C.QAccessibleEvent) *QAccessibleEvent { if h == nil { return nil @@ -1246,7 +1317,7 @@ func newQAccessibleEvent(h *C.QAccessibleEvent) *QAccessibleEvent { return &QAccessibleEvent{h: h} } -func newQAccessibleEvent_U(h unsafe.Pointer) *QAccessibleEvent { +func UnsafeNewQAccessibleEvent(h unsafe.Pointer) *QAccessibleEvent { return newQAccessibleEvent((*C.QAccessibleEvent)(h)) } @@ -1267,7 +1338,7 @@ func (this *QAccessibleEvent) Type() QAccessible__Event { } func (this *QAccessibleEvent) Object() *QObject { - return newQObject_U(unsafe.Pointer(C.QAccessibleEvent_Object(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QAccessibleEvent_Object(this.h))) } func (this *QAccessibleEvent) UniqueId() uint { @@ -1283,7 +1354,7 @@ func (this *QAccessibleEvent) Child() int { } func (this *QAccessibleEvent) AccessibleInterface() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleEvent_AccessibleInterface(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleEvent_AccessibleInterface(this.h))) } // Delete this object from C++ memory. @@ -1312,14 +1383,21 @@ func (this *QAccessibleStateChangeEvent) cPointer() *C.QAccessibleStateChangeEve return this.h } +func (this *QAccessibleStateChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleStateChangeEvent(h *C.QAccessibleStateChangeEvent) *QAccessibleStateChangeEvent { if h == nil { return nil } - return &QAccessibleStateChangeEvent{h: h, QAccessibleEvent: newQAccessibleEvent_U(unsafe.Pointer(h))} + return &QAccessibleStateChangeEvent{h: h, QAccessibleEvent: UnsafeNewQAccessibleEvent(unsafe.Pointer(h))} } -func newQAccessibleStateChangeEvent_U(h unsafe.Pointer) *QAccessibleStateChangeEvent { +func UnsafeNewQAccessibleStateChangeEvent(h unsafe.Pointer) *QAccessibleStateChangeEvent { return newQAccessibleStateChangeEvent((*C.QAccessibleStateChangeEvent)(h)) } @@ -1368,14 +1446,21 @@ func (this *QAccessibleTextCursorEvent) cPointer() *C.QAccessibleTextCursorEvent return this.h } +func (this *QAccessibleTextCursorEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTextCursorEvent(h *C.QAccessibleTextCursorEvent) *QAccessibleTextCursorEvent { if h == nil { return nil } - return &QAccessibleTextCursorEvent{h: h, QAccessibleEvent: newQAccessibleEvent_U(unsafe.Pointer(h))} + return &QAccessibleTextCursorEvent{h: h, QAccessibleEvent: UnsafeNewQAccessibleEvent(unsafe.Pointer(h))} } -func newQAccessibleTextCursorEvent_U(h unsafe.Pointer) *QAccessibleTextCursorEvent { +func UnsafeNewQAccessibleTextCursorEvent(h unsafe.Pointer) *QAccessibleTextCursorEvent { return newQAccessibleTextCursorEvent((*C.QAccessibleTextCursorEvent)(h)) } @@ -1425,14 +1510,21 @@ func (this *QAccessibleTextSelectionEvent) cPointer() *C.QAccessibleTextSelectio return this.h } +func (this *QAccessibleTextSelectionEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTextSelectionEvent(h *C.QAccessibleTextSelectionEvent) *QAccessibleTextSelectionEvent { if h == nil { return nil } - return &QAccessibleTextSelectionEvent{h: h, QAccessibleTextCursorEvent: newQAccessibleTextCursorEvent_U(unsafe.Pointer(h))} + return &QAccessibleTextSelectionEvent{h: h, QAccessibleTextCursorEvent: UnsafeNewQAccessibleTextCursorEvent(unsafe.Pointer(h))} } -func newQAccessibleTextSelectionEvent_U(h unsafe.Pointer) *QAccessibleTextSelectionEvent { +func UnsafeNewQAccessibleTextSelectionEvent(h unsafe.Pointer) *QAccessibleTextSelectionEvent { return newQAccessibleTextSelectionEvent((*C.QAccessibleTextSelectionEvent)(h)) } @@ -1486,20 +1578,27 @@ func (this *QAccessibleTextInsertEvent) cPointer() *C.QAccessibleTextInsertEvent return this.h } +func (this *QAccessibleTextInsertEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTextInsertEvent(h *C.QAccessibleTextInsertEvent) *QAccessibleTextInsertEvent { if h == nil { return nil } - return &QAccessibleTextInsertEvent{h: h, QAccessibleTextCursorEvent: newQAccessibleTextCursorEvent_U(unsafe.Pointer(h))} + return &QAccessibleTextInsertEvent{h: h, QAccessibleTextCursorEvent: UnsafeNewQAccessibleTextCursorEvent(unsafe.Pointer(h))} } -func newQAccessibleTextInsertEvent_U(h unsafe.Pointer) *QAccessibleTextInsertEvent { +func UnsafeNewQAccessibleTextInsertEvent(h unsafe.Pointer) *QAccessibleTextInsertEvent { return newQAccessibleTextInsertEvent((*C.QAccessibleTextInsertEvent)(h)) } // NewQAccessibleTextInsertEvent constructs a new QAccessibleTextInsertEvent object. func NewQAccessibleTextInsertEvent(obj *QObject, position int, text string) *QAccessibleTextInsertEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAccessibleTextInsertEvent_new(obj.cPointer(), (C.int)(position), (*C.struct_miqt_string)(text_ms)) return newQAccessibleTextInsertEvent(ret) @@ -1507,7 +1606,7 @@ func NewQAccessibleTextInsertEvent(obj *QObject, position int, text string) *QAc // NewQAccessibleTextInsertEvent2 constructs a new QAccessibleTextInsertEvent object. func NewQAccessibleTextInsertEvent2(iface *QAccessibleInterface, position int, text string) *QAccessibleTextInsertEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAccessibleTextInsertEvent_new2(iface.cPointer(), (C.int)(position), (*C.struct_miqt_string)(text_ms)) return newQAccessibleTextInsertEvent(ret) @@ -1550,20 +1649,27 @@ func (this *QAccessibleTextRemoveEvent) cPointer() *C.QAccessibleTextRemoveEvent return this.h } +func (this *QAccessibleTextRemoveEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTextRemoveEvent(h *C.QAccessibleTextRemoveEvent) *QAccessibleTextRemoveEvent { if h == nil { return nil } - return &QAccessibleTextRemoveEvent{h: h, QAccessibleTextCursorEvent: newQAccessibleTextCursorEvent_U(unsafe.Pointer(h))} + return &QAccessibleTextRemoveEvent{h: h, QAccessibleTextCursorEvent: UnsafeNewQAccessibleTextCursorEvent(unsafe.Pointer(h))} } -func newQAccessibleTextRemoveEvent_U(h unsafe.Pointer) *QAccessibleTextRemoveEvent { +func UnsafeNewQAccessibleTextRemoveEvent(h unsafe.Pointer) *QAccessibleTextRemoveEvent { return newQAccessibleTextRemoveEvent((*C.QAccessibleTextRemoveEvent)(h)) } // NewQAccessibleTextRemoveEvent constructs a new QAccessibleTextRemoveEvent object. func NewQAccessibleTextRemoveEvent(obj *QObject, position int, text string) *QAccessibleTextRemoveEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAccessibleTextRemoveEvent_new(obj.cPointer(), (C.int)(position), (*C.struct_miqt_string)(text_ms)) return newQAccessibleTextRemoveEvent(ret) @@ -1571,7 +1677,7 @@ func NewQAccessibleTextRemoveEvent(obj *QObject, position int, text string) *QAc // NewQAccessibleTextRemoveEvent2 constructs a new QAccessibleTextRemoveEvent object. func NewQAccessibleTextRemoveEvent2(iface *QAccessibleInterface, position int, text string) *QAccessibleTextRemoveEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAccessibleTextRemoveEvent_new2(iface.cPointer(), (C.int)(position), (*C.struct_miqt_string)(text_ms)) return newQAccessibleTextRemoveEvent(ret) @@ -1614,22 +1720,29 @@ func (this *QAccessibleTextUpdateEvent) cPointer() *C.QAccessibleTextUpdateEvent return this.h } +func (this *QAccessibleTextUpdateEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTextUpdateEvent(h *C.QAccessibleTextUpdateEvent) *QAccessibleTextUpdateEvent { if h == nil { return nil } - return &QAccessibleTextUpdateEvent{h: h, QAccessibleTextCursorEvent: newQAccessibleTextCursorEvent_U(unsafe.Pointer(h))} + return &QAccessibleTextUpdateEvent{h: h, QAccessibleTextCursorEvent: UnsafeNewQAccessibleTextCursorEvent(unsafe.Pointer(h))} } -func newQAccessibleTextUpdateEvent_U(h unsafe.Pointer) *QAccessibleTextUpdateEvent { +func UnsafeNewQAccessibleTextUpdateEvent(h unsafe.Pointer) *QAccessibleTextUpdateEvent { return newQAccessibleTextUpdateEvent((*C.QAccessibleTextUpdateEvent)(h)) } // NewQAccessibleTextUpdateEvent constructs a new QAccessibleTextUpdateEvent object. func NewQAccessibleTextUpdateEvent(obj *QObject, position int, oldText string, text string) *QAccessibleTextUpdateEvent { - oldText_ms := miqt_strdupg(oldText) + oldText_ms := libmiqt.Strdupg(oldText) defer C.free(oldText_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAccessibleTextUpdateEvent_new(obj.cPointer(), (C.int)(position), (*C.struct_miqt_string)(oldText_ms), (*C.struct_miqt_string)(text_ms)) return newQAccessibleTextUpdateEvent(ret) @@ -1637,9 +1750,9 @@ func NewQAccessibleTextUpdateEvent(obj *QObject, position int, oldText string, t // NewQAccessibleTextUpdateEvent2 constructs a new QAccessibleTextUpdateEvent object. func NewQAccessibleTextUpdateEvent2(iface *QAccessibleInterface, position int, oldText string, text string) *QAccessibleTextUpdateEvent { - oldText_ms := miqt_strdupg(oldText) + oldText_ms := libmiqt.Strdupg(oldText) defer C.free(oldText_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAccessibleTextUpdateEvent_new2(iface.cPointer(), (C.int)(position), (*C.struct_miqt_string)(oldText_ms), (*C.struct_miqt_string)(text_ms)) return newQAccessibleTextUpdateEvent(ret) @@ -1689,14 +1802,21 @@ func (this *QAccessibleValueChangeEvent) cPointer() *C.QAccessibleValueChangeEve return this.h } +func (this *QAccessibleValueChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleValueChangeEvent(h *C.QAccessibleValueChangeEvent) *QAccessibleValueChangeEvent { if h == nil { return nil } - return &QAccessibleValueChangeEvent{h: h, QAccessibleEvent: newQAccessibleEvent_U(unsafe.Pointer(h))} + return &QAccessibleValueChangeEvent{h: h, QAccessibleEvent: UnsafeNewQAccessibleEvent(unsafe.Pointer(h))} } -func newQAccessibleValueChangeEvent_U(h unsafe.Pointer) *QAccessibleValueChangeEvent { +func UnsafeNewQAccessibleValueChangeEvent(h unsafe.Pointer) *QAccessibleValueChangeEvent { return newQAccessibleValueChangeEvent((*C.QAccessibleValueChangeEvent)(h)) } @@ -1749,14 +1869,21 @@ func (this *QAccessibleTableModelChangeEvent) cPointer() *C.QAccessibleTableMode return this.h } +func (this *QAccessibleTableModelChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleTableModelChangeEvent(h *C.QAccessibleTableModelChangeEvent) *QAccessibleTableModelChangeEvent { if h == nil { return nil } - return &QAccessibleTableModelChangeEvent{h: h, QAccessibleEvent: newQAccessibleEvent_U(unsafe.Pointer(h))} + return &QAccessibleTableModelChangeEvent{h: h, QAccessibleEvent: UnsafeNewQAccessibleEvent(unsafe.Pointer(h))} } -func newQAccessibleTableModelChangeEvent_U(h unsafe.Pointer) *QAccessibleTableModelChangeEvent { +func UnsafeNewQAccessibleTableModelChangeEvent(h unsafe.Pointer) *QAccessibleTableModelChangeEvent { return newQAccessibleTableModelChangeEvent((*C.QAccessibleTableModelChangeEvent)(h)) } @@ -1837,6 +1964,13 @@ func (this *QAccessible__State) cPointer() *C.QAccessible__State { return this.h } +func (this *QAccessible__State) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessible__State(h *C.QAccessible__State) *QAccessible__State { if h == nil { return nil @@ -1844,7 +1978,7 @@ func newQAccessible__State(h *C.QAccessible__State) *QAccessible__State { return &QAccessible__State{h: h} } -func newQAccessible__State_U(h unsafe.Pointer) *QAccessible__State { +func UnsafeNewQAccessible__State(h unsafe.Pointer) *QAccessible__State { return newQAccessible__State((*C.QAccessible__State)(h)) } @@ -1885,6 +2019,13 @@ func (this *QAccessible__ActivationObserver) cPointer() *C.QAccessible__Activati return this.h } +func (this *QAccessible__ActivationObserver) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessible__ActivationObserver(h *C.QAccessible__ActivationObserver) *QAccessible__ActivationObserver { if h == nil { return nil @@ -1892,7 +2033,7 @@ func newQAccessible__ActivationObserver(h *C.QAccessible__ActivationObserver) *Q return &QAccessible__ActivationObserver{h: h} } -func newQAccessible__ActivationObserver_U(h unsafe.Pointer) *QAccessible__ActivationObserver { +func UnsafeNewQAccessible__ActivationObserver(h unsafe.Pointer) *QAccessible__ActivationObserver { return newQAccessible__ActivationObserver((*C.QAccessible__ActivationObserver)(h)) } diff --git a/qt/gen_qaccessible.h b/qt/gen_qaccessible.h index 165b605f..a751c66b 100644 --- a/qt/gen_qaccessible.h +++ b/qt/gen_qaccessible.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qaccessiblebridge.cpp b/qt/gen_qaccessiblebridge.cpp index 61dd518c..e2e19e24 100644 --- a/qt/gen_qaccessiblebridge.cpp +++ b/qt/gen_qaccessiblebridge.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qaccessiblebridge.h" +#include #include "gen_qaccessiblebridge.h" #include "_cgo_export.h" diff --git a/qt/gen_qaccessiblebridge.go b/qt/gen_qaccessiblebridge.go index 068284a1..87cdf691 100644 --- a/qt/gen_qaccessiblebridge.go +++ b/qt/gen_qaccessiblebridge.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QAccessibleBridge) cPointer() *C.QAccessibleBridge { return this.h } +func (this *QAccessibleBridge) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleBridge(h *C.QAccessibleBridge) *QAccessibleBridge { if h == nil { return nil @@ -31,7 +39,7 @@ func newQAccessibleBridge(h *C.QAccessibleBridge) *QAccessibleBridge { return &QAccessibleBridge{h: h} } -func newQAccessibleBridge_U(h unsafe.Pointer) *QAccessibleBridge { +func UnsafeNewQAccessibleBridge(h unsafe.Pointer) *QAccessibleBridge { return newQAccessibleBridge((*C.QAccessibleBridge)(h)) } @@ -73,19 +81,26 @@ func (this *QAccessibleBridgePlugin) cPointer() *C.QAccessibleBridgePlugin { return this.h } +func (this *QAccessibleBridgePlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleBridgePlugin(h *C.QAccessibleBridgePlugin) *QAccessibleBridgePlugin { if h == nil { return nil } - return &QAccessibleBridgePlugin{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAccessibleBridgePlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAccessibleBridgePlugin_U(h unsafe.Pointer) *QAccessibleBridgePlugin { +func UnsafeNewQAccessibleBridgePlugin(h unsafe.Pointer) *QAccessibleBridgePlugin { return newQAccessibleBridgePlugin((*C.QAccessibleBridgePlugin)(h)) } func (this *QAccessibleBridgePlugin) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAccessibleBridgePlugin_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAccessibleBridgePlugin_MetaObject(this.h))) } func (this *QAccessibleBridgePlugin) Metacast(param1 string) unsafe.Pointer { @@ -113,9 +128,9 @@ func QAccessibleBridgePlugin_TrUtf8(s string) string { } func (this *QAccessibleBridgePlugin) Create(key string) *QAccessibleBridge { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) - return newQAccessibleBridge_U(unsafe.Pointer(C.QAccessibleBridgePlugin_Create(this.h, (*C.struct_miqt_string)(key_ms)))) + return UnsafeNewQAccessibleBridge(unsafe.Pointer(C.QAccessibleBridgePlugin_Create(this.h, (*C.struct_miqt_string)(key_ms)))) } func QAccessibleBridgePlugin_Tr2(s string, c string) string { diff --git a/qt/gen_qaccessiblebridge.h b/qt/gen_qaccessiblebridge.h index 95fda7a0..34612e0a 100644 --- a/qt/gen_qaccessiblebridge.h +++ b/qt/gen_qaccessiblebridge.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qaccessibleobject.cpp b/qt/gen_qaccessibleobject.cpp index eae6e3da..d2c52354 100644 --- a/qt/gen_qaccessibleobject.cpp +++ b/qt/gen_qaccessibleobject.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qaccessibleobject.h" +#include #include "gen_qaccessibleobject.h" #include "_cgo_export.h" diff --git a/qt/gen_qaccessibleobject.go b/qt/gen_qaccessibleobject.go index 535983ae..6419f06b 100644 --- a/qt/gen_qaccessibleobject.go +++ b/qt/gen_qaccessibleobject.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QAccessibleObject) cPointer() *C.QAccessibleObject { return this.h } +func (this *QAccessibleObject) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleObject(h *C.QAccessibleObject) *QAccessibleObject { if h == nil { return nil } - return &QAccessibleObject{h: h, QAccessibleInterface: newQAccessibleInterface_U(unsafe.Pointer(h))} + return &QAccessibleObject{h: h, QAccessibleInterface: UnsafeNewQAccessibleInterface(unsafe.Pointer(h))} } -func newQAccessibleObject_U(h unsafe.Pointer) *QAccessibleObject { +func UnsafeNewQAccessibleObject(h unsafe.Pointer) *QAccessibleObject { return newQAccessibleObject((*C.QAccessibleObject)(h)) } @@ -41,7 +49,7 @@ func (this *QAccessibleObject) IsValid() bool { } func (this *QAccessibleObject) Object() *QObject { - return newQObject_U(unsafe.Pointer(C.QAccessibleObject_Object(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QAccessibleObject_Object(this.h))) } func (this *QAccessibleObject) Rect() *QRect { @@ -52,13 +60,13 @@ func (this *QAccessibleObject) Rect() *QRect { } func (this *QAccessibleObject) SetText(t QAccessible__Text, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QAccessibleObject_SetText(this.h, (C.int)(t), (*C.struct_miqt_string)(text_ms)) } func (this *QAccessibleObject) ChildAt(x int, y int) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleObject_ChildAt(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleObject_ChildAt(this.h, (C.int)(x), (C.int)(y)))) } type QAccessibleApplication struct { @@ -73,14 +81,21 @@ func (this *QAccessibleApplication) cPointer() *C.QAccessibleApplication { return this.h } +func (this *QAccessibleApplication) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleApplication(h *C.QAccessibleApplication) *QAccessibleApplication { if h == nil { return nil } - return &QAccessibleApplication{h: h, QAccessibleObject: newQAccessibleObject_U(unsafe.Pointer(h))} + return &QAccessibleApplication{h: h, QAccessibleObject: UnsafeNewQAccessibleObject(unsafe.Pointer(h))} } -func newQAccessibleApplication_U(h unsafe.Pointer) *QAccessibleApplication { +func UnsafeNewQAccessibleApplication(h unsafe.Pointer) *QAccessibleApplication { return newQAccessibleApplication((*C.QAccessibleApplication)(h)) } @@ -91,7 +106,7 @@ func NewQAccessibleApplication() *QAccessibleApplication { } func (this *QAccessibleApplication) Window() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QAccessibleApplication_Window(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QAccessibleApplication_Window(this.h))) } func (this *QAccessibleApplication) ChildCount() int { @@ -103,15 +118,15 @@ func (this *QAccessibleApplication) IndexOfChild(param1 *QAccessibleInterface) i } func (this *QAccessibleApplication) FocusChild() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleApplication_FocusChild(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleApplication_FocusChild(this.h))) } func (this *QAccessibleApplication) Parent() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleApplication_Parent(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleApplication_Parent(this.h))) } func (this *QAccessibleApplication) Child(index int) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleApplication_Child(this.h, (C.int)(index)))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleApplication_Child(this.h, (C.int)(index)))) } func (this *QAccessibleApplication) Text(t QAccessible__Text) string { diff --git a/qt/gen_qaccessibleobject.h b/qt/gen_qaccessibleobject.h index b8c1e492..0fbb5188 100644 --- a/qt/gen_qaccessibleobject.h +++ b/qt/gen_qaccessibleobject.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qaccessibleplugin.cpp b/qt/gen_qaccessibleplugin.cpp index f8dd9557..4cc3b0ce 100644 --- a/qt/gen_qaccessibleplugin.cpp +++ b/qt/gen_qaccessibleplugin.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qaccessibleplugin.h" +#include #include "gen_qaccessibleplugin.h" #include "_cgo_export.h" diff --git a/qt/gen_qaccessibleplugin.go b/qt/gen_qaccessibleplugin.go index f5875bdf..a1d161e5 100644 --- a/qt/gen_qaccessibleplugin.go +++ b/qt/gen_qaccessibleplugin.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,19 +26,26 @@ func (this *QAccessiblePlugin) cPointer() *C.QAccessiblePlugin { return this.h } +func (this *QAccessiblePlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessiblePlugin(h *C.QAccessiblePlugin) *QAccessiblePlugin { if h == nil { return nil } - return &QAccessiblePlugin{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAccessiblePlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAccessiblePlugin_U(h unsafe.Pointer) *QAccessiblePlugin { +func UnsafeNewQAccessiblePlugin(h unsafe.Pointer) *QAccessiblePlugin { return newQAccessiblePlugin((*C.QAccessiblePlugin)(h)) } func (this *QAccessiblePlugin) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAccessiblePlugin_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAccessiblePlugin_MetaObject(this.h))) } func (this *QAccessiblePlugin) Metacast(param1 string) unsafe.Pointer { @@ -65,9 +73,9 @@ func QAccessiblePlugin_TrUtf8(s string) string { } func (this *QAccessiblePlugin) Create(key string, object *QObject) *QAccessibleInterface { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessiblePlugin_Create(this.h, (*C.struct_miqt_string)(key_ms), object.cPointer()))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessiblePlugin_Create(this.h, (*C.struct_miqt_string)(key_ms), object.cPointer()))) } func QAccessiblePlugin_Tr2(s string, c string) string { diff --git a/qt/gen_qaccessibleplugin.h b/qt/gen_qaccessibleplugin.h index d260f476..02492afc 100644 --- a/qt/gen_qaccessibleplugin.h +++ b/qt/gen_qaccessibleplugin.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qaccessiblewidget.cpp b/qt/gen_qaccessiblewidget.cpp index a70959b9..01b88d59 100644 --- a/qt/gen_qaccessiblewidget.cpp +++ b/qt/gen_qaccessiblewidget.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qaccessiblewidget.h" +#include #include "gen_qaccessiblewidget.h" #include "_cgo_export.h" diff --git a/qt/gen_qaccessiblewidget.go b/qt/gen_qaccessiblewidget.go index fcca09cc..c0294574 100644 --- a/qt/gen_qaccessiblewidget.go +++ b/qt/gen_qaccessiblewidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QAccessibleWidget) cPointer() *C.QAccessibleWidget { return this.h } +func (this *QAccessibleWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAccessibleWidget(h *C.QAccessibleWidget) *QAccessibleWidget { if h == nil { return nil } - return &QAccessibleWidget{h: h, QAccessibleObject: newQAccessibleObject_U(unsafe.Pointer(h)), QAccessibleActionInterface: newQAccessibleActionInterface_U(unsafe.Pointer(h))} + return &QAccessibleWidget{h: h, QAccessibleObject: UnsafeNewQAccessibleObject(unsafe.Pointer(h)), QAccessibleActionInterface: UnsafeNewQAccessibleActionInterface(unsafe.Pointer(h))} } -func newQAccessibleWidget_U(h unsafe.Pointer) *QAccessibleWidget { +func UnsafeNewQAccessibleWidget(h unsafe.Pointer) *QAccessibleWidget { return newQAccessibleWidget((*C.QAccessibleWidget)(h)) } @@ -50,7 +58,7 @@ func NewQAccessibleWidget2(o *QWidget, r QAccessible__Role) *QAccessibleWidget { // NewQAccessibleWidget3 constructs a new QAccessibleWidget object. func NewQAccessibleWidget3(o *QWidget, r QAccessible__Role, name string) *QAccessibleWidget { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QAccessibleWidget_new3(o.cPointer(), (C.int)(r), (*C.struct_miqt_string)(name_ms)) return newQAccessibleWidget(ret) @@ -61,7 +69,7 @@ func (this *QAccessibleWidget) IsValid() bool { } func (this *QAccessibleWidget) Window() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QAccessibleWidget_Window(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QAccessibleWidget_Window(this.h))) } func (this *QAccessibleWidget) ChildCount() int { @@ -73,7 +81,7 @@ func (this *QAccessibleWidget) IndexOfChild(child *QAccessibleInterface) int { } func (this *QAccessibleWidget) FocusChild() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleWidget_FocusChild(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleWidget_FocusChild(this.h))) } func (this *QAccessibleWidget) Rect() *QRect { @@ -84,11 +92,11 @@ func (this *QAccessibleWidget) Rect() *QRect { } func (this *QAccessibleWidget) Parent() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleWidget_Parent(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleWidget_Parent(this.h))) } func (this *QAccessibleWidget) Child(index int) *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QAccessibleWidget_Child(this.h, (C.int)(index)))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QAccessibleWidget_Child(this.h, (C.int)(index)))) } func (this *QAccessibleWidget) Text(t QAccessible__Text) string { @@ -142,13 +150,13 @@ func (this *QAccessibleWidget) ActionNames() []string { } func (this *QAccessibleWidget) DoAction(actionName string) { - actionName_ms := miqt_strdupg(actionName) + actionName_ms := libmiqt.Strdupg(actionName) defer C.free(actionName_ms) C.QAccessibleWidget_DoAction(this.h, (*C.struct_miqt_string)(actionName_ms)) } func (this *QAccessibleWidget) KeyBindingsForAction(actionName string) []string { - actionName_ms := miqt_strdupg(actionName) + actionName_ms := libmiqt.Strdupg(actionName) defer C.free(actionName_ms) var _ma *C.struct_miqt_array = C.QAccessibleWidget_KeyBindingsForAction(this.h, (*C.struct_miqt_string)(actionName_ms)) _ret := make([]string, int(_ma.len)) diff --git a/qt/gen_qaccessiblewidget.h b/qt/gen_qaccessiblewidget.h index 6c24bbcf..c0c319b4 100644 --- a/qt/gen_qaccessiblewidget.h +++ b/qt/gen_qaccessiblewidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qaction.cpp b/qt/gen_qaction.cpp index 74e899ff..1d17a0c5 100644 --- a/qt/gen_qaction.cpp +++ b/qt/gen_qaction.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qaction.h" +#include #include "gen_qaction.h" #include "_cgo_export.h" diff --git a/qt/gen_qaction.go b/qt/gen_qaction.go index 9d82c3b6..0488305d 100644 --- a/qt/gen_qaction.go +++ b/qt/gen_qaction.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -53,14 +54,21 @@ func (this *QAction) cPointer() *C.QAction { return this.h } +func (this *QAction) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAction(h *C.QAction) *QAction { if h == nil { return nil } - return &QAction{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QAction{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQAction_U(h unsafe.Pointer) *QAction { +func UnsafeNewQAction(h unsafe.Pointer) *QAction { return newQAction((*C.QAction)(h)) } @@ -72,7 +80,7 @@ func NewQAction() *QAction { // NewQAction2 constructs a new QAction object. func NewQAction2(text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAction_new2((*C.struct_miqt_string)(text_ms)) return newQAction(ret) @@ -80,7 +88,7 @@ func NewQAction2(text string) *QAction { // NewQAction3 constructs a new QAction object. func NewQAction3(icon *QIcon, text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAction_new3(icon.cPointer(), (*C.struct_miqt_string)(text_ms)) return newQAction(ret) @@ -94,7 +102,7 @@ func NewQAction4(parent *QObject) *QAction { // NewQAction5 constructs a new QAction object. func NewQAction5(text string, parent *QObject) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAction_new5((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQAction(ret) @@ -102,14 +110,14 @@ func NewQAction5(text string, parent *QObject) *QAction { // NewQAction6 constructs a new QAction object. func NewQAction6(icon *QIcon, text string, parent *QObject) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QAction_new6(icon.cPointer(), (*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQAction(ret) } func (this *QAction) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAction_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAction_MetaObject(this.h))) } func (this *QAction) Metacast(param1 string) unsafe.Pointer { @@ -141,7 +149,7 @@ func (this *QAction) SetActionGroup(group *QActionGroup) { } func (this *QAction) ActionGroup() *QActionGroup { - return newQActionGroup_U(unsafe.Pointer(C.QAction_ActionGroup(this.h))) + return UnsafeNewQActionGroup(unsafe.Pointer(C.QAction_ActionGroup(this.h))) } func (this *QAction) SetIcon(icon *QIcon) { @@ -156,7 +164,7 @@ func (this *QAction) Icon() *QIcon { } func (this *QAction) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QAction_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -169,7 +177,7 @@ func (this *QAction) Text() string { } func (this *QAction) SetIconText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QAction_SetIconText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -182,7 +190,7 @@ func (this *QAction) IconText() string { } func (this *QAction) SetToolTip(tip string) { - tip_ms := miqt_strdupg(tip) + tip_ms := libmiqt.Strdupg(tip) defer C.free(tip_ms) C.QAction_SetToolTip(this.h, (*C.struct_miqt_string)(tip_ms)) } @@ -195,7 +203,7 @@ func (this *QAction) ToolTip() string { } func (this *QAction) SetStatusTip(statusTip string) { - statusTip_ms := miqt_strdupg(statusTip) + statusTip_ms := libmiqt.Strdupg(statusTip) defer C.free(statusTip_ms) C.QAction_SetStatusTip(this.h, (*C.struct_miqt_string)(statusTip_ms)) } @@ -208,7 +216,7 @@ func (this *QAction) StatusTip() string { } func (this *QAction) SetWhatsThis(what string) { - what_ms := miqt_strdupg(what) + what_ms := libmiqt.Strdupg(what) defer C.free(what_ms) C.QAction_SetWhatsThis(this.h, (*C.struct_miqt_string)(what_ms)) } @@ -229,7 +237,7 @@ func (this *QAction) Priority() QAction__Priority { } func (this *QAction) Menu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QAction_Menu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QAction_Menu(this.h))) } func (this *QAction) SetMenu(menu *QMenu) { @@ -376,7 +384,7 @@ func (this *QAction) IsShortcutVisibleInContextMenu() bool { } func (this *QAction) ParentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QAction_ParentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QAction_ParentWidget(this.h))) } func (this *QAction) AssociatedWidgets() []*QWidget { @@ -384,7 +392,7 @@ func (this *QAction) AssociatedWidgets() []*QWidget { _ret := make([]*QWidget, int(_ma.len)) _outCast := (*[0xffff]*C.QWidget)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQWidget_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQWidget(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -395,7 +403,7 @@ func (this *QAction) AssociatedGraphicsWidgets() []*QGraphicsWidget { _ret := make([]*QGraphicsWidget, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsWidget)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsWidget_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsWidget(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret diff --git a/qt/gen_qaction.h b/qt/gen_qaction.h index a7a5348b..fea982ae 100644 --- a/qt/gen_qaction.h +++ b/qt/gen_qaction.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qactiongroup.cpp b/qt/gen_qactiongroup.cpp index 1bd8ad03..9a9cf676 100644 --- a/qt/gen_qactiongroup.cpp +++ b/qt/gen_qactiongroup.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qactiongroup.h" +#include #include "gen_qactiongroup.h" #include "_cgo_export.h" diff --git a/qt/gen_qactiongroup.go b/qt/gen_qactiongroup.go index 0cc8e103..1781ee09 100644 --- a/qt/gen_qactiongroup.go +++ b/qt/gen_qactiongroup.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -34,14 +35,21 @@ func (this *QActionGroup) cPointer() *C.QActionGroup { return this.h } +func (this *QActionGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQActionGroup(h *C.QActionGroup) *QActionGroup { if h == nil { return nil } - return &QActionGroup{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QActionGroup{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQActionGroup_U(h unsafe.Pointer) *QActionGroup { +func UnsafeNewQActionGroup(h unsafe.Pointer) *QActionGroup { return newQActionGroup((*C.QActionGroup)(h)) } @@ -52,7 +60,7 @@ func NewQActionGroup(parent *QObject) *QActionGroup { } func (this *QActionGroup) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QActionGroup_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QActionGroup_MetaObject(this.h))) } func (this *QActionGroup) Metacast(param1 string) unsafe.Pointer { @@ -80,19 +88,19 @@ func QActionGroup_TrUtf8(s string) string { } func (this *QActionGroup) AddAction(a *QAction) *QAction { - return newQAction_U(unsafe.Pointer(C.QActionGroup_AddAction(this.h, a.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QActionGroup_AddAction(this.h, a.cPointer()))) } func (this *QActionGroup) AddActionWithText(text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QActionGroup_AddActionWithText(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QActionGroup_AddActionWithText(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QActionGroup) AddAction2(icon *QIcon, text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QActionGroup_AddAction2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QActionGroup_AddAction2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) } func (this *QActionGroup) RemoveAction(a *QAction) { @@ -104,14 +112,14 @@ func (this *QActionGroup) Actions() []*QAction { _ret := make([]*QAction, int(_ma.len)) _outCast := (*[0xffff]*C.QAction)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAction_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAction(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QActionGroup) CheckedAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QActionGroup_CheckedAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QActionGroup_CheckedAction(this.h))) } func (this *QActionGroup) IsExclusive() bool { @@ -165,7 +173,7 @@ func miqt_exec_callback_QActionGroup_Triggered(cb C.intptr_t, param1 *C.QAction) } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -185,7 +193,7 @@ func miqt_exec_callback_QActionGroup_Hovered(cb C.intptr_t, param1 *C.QAction) { } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(param1)) gofunc(slotval1) } diff --git a/qt/gen_qactiongroup.h b/qt/gen_qactiongroup.h index 9660b97e..1ac273db 100644 --- a/qt/gen_qactiongroup.h +++ b/qt/gen_qactiongroup.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qanimationgroup.cpp b/qt/gen_qanimationgroup.cpp index 437acb70..912617e5 100644 --- a/qt/gen_qanimationgroup.cpp +++ b/qt/gen_qanimationgroup.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qanimationgroup.h" +#include #include "gen_qanimationgroup.h" #include "_cgo_export.h" diff --git a/qt/gen_qanimationgroup.go b/qt/gen_qanimationgroup.go index aa298ae7..64ff64d2 100644 --- a/qt/gen_qanimationgroup.go +++ b/qt/gen_qanimationgroup.go @@ -25,19 +25,26 @@ func (this *QAnimationGroup) cPointer() *C.QAnimationGroup { return this.h } +func (this *QAnimationGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAnimationGroup(h *C.QAnimationGroup) *QAnimationGroup { if h == nil { return nil } - return &QAnimationGroup{h: h, QAbstractAnimation: newQAbstractAnimation_U(unsafe.Pointer(h))} + return &QAnimationGroup{h: h, QAbstractAnimation: UnsafeNewQAbstractAnimation(unsafe.Pointer(h))} } -func newQAnimationGroup_U(h unsafe.Pointer) *QAnimationGroup { +func UnsafeNewQAnimationGroup(h unsafe.Pointer) *QAnimationGroup { return newQAnimationGroup((*C.QAnimationGroup)(h)) } func (this *QAnimationGroup) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QAnimationGroup_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QAnimationGroup_MetaObject(this.h))) } func (this *QAnimationGroup) Metacast(param1 string) unsafe.Pointer { @@ -65,7 +72,7 @@ func QAnimationGroup_TrUtf8(s string) string { } func (this *QAnimationGroup) AnimationAt(index int) *QAbstractAnimation { - return newQAbstractAnimation_U(unsafe.Pointer(C.QAnimationGroup_AnimationAt(this.h, (C.int)(index)))) + return UnsafeNewQAbstractAnimation(unsafe.Pointer(C.QAnimationGroup_AnimationAt(this.h, (C.int)(index)))) } func (this *QAnimationGroup) AnimationCount() int { @@ -89,7 +96,7 @@ func (this *QAnimationGroup) RemoveAnimation(animation *QAbstractAnimation) { } func (this *QAnimationGroup) TakeAnimation(index int) *QAbstractAnimation { - return newQAbstractAnimation_U(unsafe.Pointer(C.QAnimationGroup_TakeAnimation(this.h, (C.int)(index)))) + return UnsafeNewQAbstractAnimation(unsafe.Pointer(C.QAnimationGroup_TakeAnimation(this.h, (C.int)(index)))) } func (this *QAnimationGroup) Clear() { diff --git a/qt/gen_qanimationgroup.h b/qt/gen_qanimationgroup.h index 6e1cd9bd..4da53b9e 100644 --- a/qt/gen_qanimationgroup.h +++ b/qt/gen_qanimationgroup.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qapplication.cpp b/qt/gen_qapplication.cpp index f2c60a10..13a3d77e 100644 --- a/qt/gen_qapplication.cpp +++ b/qt/gen_qapplication.cpp @@ -15,7 +15,7 @@ #include #include #include -#include "qapplication.h" +#include #include "gen_qapplication.h" #include "_cgo_export.h" diff --git a/qt/gen_qapplication.go b/qt/gen_qapplication.go index 8b5eeb7f..4fd8d8e4 100644 --- a/qt/gen_qapplication.go +++ b/qt/gen_qapplication.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -34,14 +35,21 @@ func (this *QApplication) cPointer() *C.QApplication { return this.h } +func (this *QApplication) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQApplication(h *C.QApplication) *QApplication { if h == nil { return nil } - return &QApplication{h: h, QGuiApplication: newQGuiApplication_U(unsafe.Pointer(h))} + return &QApplication{h: h, QGuiApplication: UnsafeNewQGuiApplication(unsafe.Pointer(h))} } -func newQApplication_U(h unsafe.Pointer) *QApplication { +func UnsafeNewQApplication(h unsafe.Pointer) *QApplication { return newQApplication((*C.QApplication)(h)) } @@ -72,7 +80,7 @@ func NewQApplication2(args []string, param3 int) *QApplication { } func (this *QApplication) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QApplication_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QApplication_MetaObject(this.h))) } func (this *QApplication) Metacast(param1 string) unsafe.Pointer { @@ -100,7 +108,7 @@ func QApplication_TrUtf8(s string) string { } func QApplication_Style() *QStyle { - return newQStyle_U(unsafe.Pointer(C.QApplication_Style())) + return UnsafeNewQStyle(unsafe.Pointer(C.QApplication_Style())) } func QApplication_SetStyle(style *QStyle) { @@ -108,9 +116,9 @@ func QApplication_SetStyle(style *QStyle) { } func QApplication_SetStyleWithStyle(style string) *QStyle { - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) - return newQStyle_U(unsafe.Pointer(C.QApplication_SetStyleWithStyle((*C.struct_miqt_string)(style_ms)))) + return UnsafeNewQStyle(unsafe.Pointer(C.QApplication_SetStyleWithStyle((*C.struct_miqt_string)(style_ms)))) } func QApplication_ColorSpec() int { @@ -191,7 +199,7 @@ func QApplication_AllWidgets() []*QWidget { _ret := make([]*QWidget, int(_ma.len)) _outCast := (*[0xffff]*C.QWidget)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQWidget_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQWidget(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -202,30 +210,30 @@ func QApplication_TopLevelWidgets() []*QWidget { _ret := make([]*QWidget, int(_ma.len)) _outCast := (*[0xffff]*C.QWidget)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQWidget_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQWidget(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func QApplication_Desktop() *QDesktopWidget { - return newQDesktopWidget_U(unsafe.Pointer(C.QApplication_Desktop())) + return UnsafeNewQDesktopWidget(unsafe.Pointer(C.QApplication_Desktop())) } func QApplication_ActivePopupWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_ActivePopupWidget())) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_ActivePopupWidget())) } func QApplication_ActiveModalWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_ActiveModalWidget())) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_ActiveModalWidget())) } func QApplication_FocusWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_FocusWidget())) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_FocusWidget())) } func QApplication_ActiveWindow() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_ActiveWindow())) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_ActiveWindow())) } func QApplication_SetActiveWindow(act *QWidget) { @@ -233,19 +241,19 @@ func QApplication_SetActiveWindow(act *QWidget) { } func QApplication_WidgetAt(p *QPoint) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_WidgetAt(p.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_WidgetAt(p.cPointer()))) } func QApplication_WidgetAt2(x int, y int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_WidgetAt2((C.int)(x), (C.int)(y)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_WidgetAt2((C.int)(x), (C.int)(y)))) } func QApplication_TopLevelAt(p *QPoint) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_TopLevelAt(p.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_TopLevelAt(p.cPointer()))) } func QApplication_TopLevelAt2(x int, y int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QApplication_TopLevelAt2((C.int)(x), (C.int)(y)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QApplication_TopLevelAt2((C.int)(x), (C.int)(y)))) } func QApplication_Beep() { @@ -346,8 +354,8 @@ func miqt_exec_callback_QApplication_FocusChanged(cb C.intptr_t, old *C.QWidget, } // Convert all CABI parameters to Go parameters - slotval1 := newQWidget_U(unsafe.Pointer(old)) - slotval2 := newQWidget_U(unsafe.Pointer(now)) + slotval1 := UnsafeNewQWidget(unsafe.Pointer(old)) + slotval2 := UnsafeNewQWidget(unsafe.Pointer(now)) gofunc(slotval1, slotval2) } @@ -360,7 +368,7 @@ func (this *QApplication) StyleSheet() string { } func (this *QApplication) SetStyleSheet(sheet string) { - sheet_ms := miqt_strdupg(sheet) + sheet_ms := libmiqt.Strdupg(sheet) defer C.free(sheet_ms) C.QApplication_SetStyleSheet(this.h, (*C.struct_miqt_string)(sheet_ms)) } diff --git a/qt/gen_qapplication.h b/qt/gen_qapplication.h index e7fab502..2319a481 100644 --- a/qt/gen_qapplication.h +++ b/qt/gen_qapplication.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qarraydata.cpp b/qt/gen_qarraydata.cpp index 8f5d80bd..def51041 100644 --- a/qt/gen_qarraydata.cpp +++ b/qt/gen_qarraydata.cpp @@ -1,6 +1,6 @@ #include #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__QContainerImplHelper -#include "qarraydata.h" +#include #include "gen_qarraydata.h" #include "_cgo_export.h" diff --git a/qt/gen_qarraydata.go b/qt/gen_qarraydata.go index a362ec1d..32b27d85 100644 --- a/qt/gen_qarraydata.go +++ b/qt/gen_qarraydata.go @@ -43,6 +43,13 @@ func (this *QArrayData) cPointer() *C.QArrayData { return this.h } +func (this *QArrayData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQArrayData(h *C.QArrayData) *QArrayData { if h == nil { return nil @@ -50,7 +57,7 @@ func newQArrayData(h *C.QArrayData) *QArrayData { return &QArrayData{h: h} } -func newQArrayData_U(h unsafe.Pointer) *QArrayData { +func UnsafeNewQArrayData(h unsafe.Pointer) *QArrayData { return newQArrayData((*C.QArrayData)(h)) } @@ -79,11 +86,11 @@ func (this *QArrayData) CloneFlags() QArrayData__AllocationOption { } func QArrayData_Allocate(objectSize uint64, alignment uint64, capacity uint64) *QArrayData { - return newQArrayData_U(unsafe.Pointer(C.QArrayData_Allocate((C.size_t)(objectSize), (C.size_t)(alignment), (C.size_t)(capacity)))) + return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_Allocate((C.size_t)(objectSize), (C.size_t)(alignment), (C.size_t)(capacity)))) } func QArrayData_ReallocateUnaligned(data *QArrayData, objectSize uint64, newCapacity uint64) *QArrayData { - return newQArrayData_U(unsafe.Pointer(C.QArrayData_ReallocateUnaligned(data.cPointer(), (C.size_t)(objectSize), (C.size_t)(newCapacity)))) + return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_ReallocateUnaligned(data.cPointer(), (C.size_t)(objectSize), (C.size_t)(newCapacity)))) } func QArrayData_Deallocate(data *QArrayData, objectSize uint64, alignment uint64) { @@ -91,15 +98,15 @@ func QArrayData_Deallocate(data *QArrayData, objectSize uint64, alignment uint64 } func QArrayData_SharedNull() *QArrayData { - return newQArrayData_U(unsafe.Pointer(C.QArrayData_SharedNull())) + return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_SharedNull())) } func QArrayData_Allocate4(objectSize uint64, alignment uint64, capacity uint64, options QArrayData__AllocationOption) *QArrayData { - return newQArrayData_U(unsafe.Pointer(C.QArrayData_Allocate4((C.size_t)(objectSize), (C.size_t)(alignment), (C.size_t)(capacity), (C.int)(options)))) + return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_Allocate4((C.size_t)(objectSize), (C.size_t)(alignment), (C.size_t)(capacity), (C.int)(options)))) } func QArrayData_ReallocateUnaligned4(data *QArrayData, objectSize uint64, newCapacity uint64, newOptions QArrayData__AllocationOption) *QArrayData { - return newQArrayData_U(unsafe.Pointer(C.QArrayData_ReallocateUnaligned4(data.cPointer(), (C.size_t)(objectSize), (C.size_t)(newCapacity), (C.int)(newOptions)))) + return UnsafeNewQArrayData(unsafe.Pointer(C.QArrayData_ReallocateUnaligned4(data.cPointer(), (C.size_t)(objectSize), (C.size_t)(newCapacity), (C.int)(newOptions)))) } // Delete this object from C++ memory. @@ -127,6 +134,13 @@ func (this *QtPrivate__QContainerImplHelper) cPointer() *C.QtPrivate__QContainer return this.h } +func (this *QtPrivate__QContainerImplHelper) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__QContainerImplHelper(h *C.QtPrivate__QContainerImplHelper) *QtPrivate__QContainerImplHelper { if h == nil { return nil @@ -134,7 +148,7 @@ func newQtPrivate__QContainerImplHelper(h *C.QtPrivate__QContainerImplHelper) *Q return &QtPrivate__QContainerImplHelper{h: h} } -func newQtPrivate__QContainerImplHelper_U(h unsafe.Pointer) *QtPrivate__QContainerImplHelper { +func UnsafeNewQtPrivate__QContainerImplHelper(h unsafe.Pointer) *QtPrivate__QContainerImplHelper { return newQtPrivate__QContainerImplHelper((*C.QtPrivate__QContainerImplHelper)(h)) } diff --git a/qt/gen_qarraydata.h b/qt/gen_qarraydata.h index 5c69e294..74feaf29 100644 --- a/qt/gen_qarraydata.h +++ b/qt/gen_qarraydata.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbackingstore.cpp b/qt/gen_qbackingstore.cpp index 66d19678..8aff21b2 100644 --- a/qt/gen_qbackingstore.cpp +++ b/qt/gen_qbackingstore.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qbackingstore.h" +#include #include "gen_qbackingstore.h" #include "_cgo_export.h" diff --git a/qt/gen_qbackingstore.go b/qt/gen_qbackingstore.go index d47ec093..cd1dc04a 100644 --- a/qt/gen_qbackingstore.go +++ b/qt/gen_qbackingstore.go @@ -24,6 +24,13 @@ func (this *QBackingStore) cPointer() *C.QBackingStore { return this.h } +func (this *QBackingStore) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBackingStore(h *C.QBackingStore) *QBackingStore { if h == nil { return nil @@ -31,7 +38,7 @@ func newQBackingStore(h *C.QBackingStore) *QBackingStore { return &QBackingStore{h: h} } -func newQBackingStore_U(h unsafe.Pointer) *QBackingStore { +func UnsafeNewQBackingStore(h unsafe.Pointer) *QBackingStore { return newQBackingStore((*C.QBackingStore)(h)) } @@ -42,11 +49,11 @@ func NewQBackingStore(window *QWindow) *QBackingStore { } func (this *QBackingStore) Window() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QBackingStore_Window(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QBackingStore_Window(this.h))) } func (this *QBackingStore) PaintDevice() *QPaintDevice { - return newQPaintDevice_U(unsafe.Pointer(C.QBackingStore_PaintDevice(this.h))) + return UnsafeNewQPaintDevice(unsafe.Pointer(C.QBackingStore_PaintDevice(this.h))) } func (this *QBackingStore) Flush(region *QRegion) { diff --git a/qt/gen_qbackingstore.h b/qt/gen_qbackingstore.h index 05d9bbc8..40e5d832 100644 --- a/qt/gen_qbackingstore.h +++ b/qt/gen_qbackingstore.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbasictimer.cpp b/qt/gen_qbasictimer.cpp index ce34b348..e59fce36 100644 --- a/qt/gen_qbasictimer.cpp +++ b/qt/gen_qbasictimer.cpp @@ -1,6 +1,6 @@ #include #include -#include "qbasictimer.h" +#include #include "gen_qbasictimer.h" #include "_cgo_export.h" diff --git a/qt/gen_qbasictimer.go b/qt/gen_qbasictimer.go index 8121cf42..0ddf8108 100644 --- a/qt/gen_qbasictimer.go +++ b/qt/gen_qbasictimer.go @@ -24,6 +24,13 @@ func (this *QBasicTimer) cPointer() *C.QBasicTimer { return this.h } +func (this *QBasicTimer) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBasicTimer(h *C.QBasicTimer) *QBasicTimer { if h == nil { return nil @@ -31,7 +38,7 @@ func newQBasicTimer(h *C.QBasicTimer) *QBasicTimer { return &QBasicTimer{h: h} } -func newQBasicTimer_U(h unsafe.Pointer) *QBasicTimer { +func UnsafeNewQBasicTimer(h unsafe.Pointer) *QBasicTimer { return newQBasicTimer((*C.QBasicTimer)(h)) } diff --git a/qt/gen_qbasictimer.h b/qt/gen_qbasictimer.h index c103750d..46b34564 100644 --- a/qt/gen_qbasictimer.h +++ b/qt/gen_qbasictimer.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbitarray.cpp b/qt/gen_qbitarray.cpp index 7c8dc90e..dcf4e6b6 100644 --- a/qt/gen_qbitarray.cpp +++ b/qt/gen_qbitarray.cpp @@ -1,6 +1,6 @@ #include #include -#include "qbitarray.h" +#include #include "gen_qbitarray.h" #include "_cgo_export.h" diff --git a/qt/gen_qbitarray.go b/qt/gen_qbitarray.go index 742c6311..27becb6d 100644 --- a/qt/gen_qbitarray.go +++ b/qt/gen_qbitarray.go @@ -24,6 +24,13 @@ func (this *QBitArray) cPointer() *C.QBitArray { return this.h } +func (this *QBitArray) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBitArray(h *C.QBitArray) *QBitArray { if h == nil { return nil @@ -31,7 +38,7 @@ func newQBitArray(h *C.QBitArray) *QBitArray { return &QBitArray{h: h} } -func newQBitArray_U(h unsafe.Pointer) *QBitArray { +func UnsafeNewQBitArray(h unsafe.Pointer) *QBitArray { return newQBitArray((*C.QBitArray)(h)) } @@ -231,6 +238,13 @@ func (this *QBitRef) cPointer() *C.QBitRef { return this.h } +func (this *QBitRef) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBitRef(h *C.QBitRef) *QBitRef { if h == nil { return nil @@ -238,7 +252,7 @@ func newQBitRef(h *C.QBitRef) *QBitRef { return &QBitRef{h: h} } -func newQBitRef_U(h unsafe.Pointer) *QBitRef { +func UnsafeNewQBitRef(h unsafe.Pointer) *QBitRef { return newQBitRef((*C.QBitRef)(h)) } diff --git a/qt/gen_qbitarray.h b/qt/gen_qbitarray.h index c6b79fcf..ebd4674d 100644 --- a/qt/gen_qbitarray.h +++ b/qt/gen_qbitarray.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbitmap.cpp b/qt/gen_qbitmap.cpp index 0c82676e..4737279d 100644 --- a/qt/gen_qbitmap.cpp +++ b/qt/gen_qbitmap.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qbitmap.h" +#include #include "gen_qbitmap.h" #include "_cgo_export.h" diff --git a/qt/gen_qbitmap.go b/qt/gen_qbitmap.go index 890d0c52..11c17c2b 100644 --- a/qt/gen_qbitmap.go +++ b/qt/gen_qbitmap.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QBitmap) cPointer() *C.QBitmap { return this.h } +func (this *QBitmap) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBitmap(h *C.QBitmap) *QBitmap { if h == nil { return nil } - return &QBitmap{h: h, QPixmap: newQPixmap_U(unsafe.Pointer(h))} + return &QBitmap{h: h, QPixmap: UnsafeNewQPixmap(unsafe.Pointer(h))} } -func newQBitmap_U(h unsafe.Pointer) *QBitmap { +func UnsafeNewQBitmap(h unsafe.Pointer) *QBitmap { return newQBitmap((*C.QBitmap)(h)) } @@ -62,7 +70,7 @@ func NewQBitmap4(param1 *QSize) *QBitmap { // NewQBitmap5 constructs a new QBitmap object. func NewQBitmap5(fileName string) *QBitmap { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QBitmap_new5((*C.struct_miqt_string)(fileName_ms)) return newQBitmap(ret) @@ -76,7 +84,7 @@ func NewQBitmap6(other *QBitmap) *QBitmap { // NewQBitmap7 constructs a new QBitmap object. func NewQBitmap7(fileName string, format string) *QBitmap { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) diff --git a/qt/gen_qbitmap.h b/qt/gen_qbitmap.h index 2ef28ea3..60b38f7f 100644 --- a/qt/gen_qbitmap.h +++ b/qt/gen_qbitmap.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qboxlayout.cpp b/qt/gen_qboxlayout.cpp index cb4a4481..78a07734 100644 --- a/qt/gen_qboxlayout.cpp +++ b/qt/gen_qboxlayout.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qboxlayout.h" +#include #include "gen_qboxlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qboxlayout.go b/qt/gen_qboxlayout.go index f0955e07..f0444e0a 100644 --- a/qt/gen_qboxlayout.go +++ b/qt/gen_qboxlayout.go @@ -36,14 +36,21 @@ func (this *QBoxLayout) cPointer() *C.QBoxLayout { return this.h } +func (this *QBoxLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBoxLayout(h *C.QBoxLayout) *QBoxLayout { if h == nil { return nil } - return &QBoxLayout{h: h, QLayout: newQLayout_U(unsafe.Pointer(h))} + return &QBoxLayout{h: h, QLayout: UnsafeNewQLayout(unsafe.Pointer(h))} } -func newQBoxLayout_U(h unsafe.Pointer) *QBoxLayout { +func UnsafeNewQBoxLayout(h unsafe.Pointer) *QBoxLayout { return newQBoxLayout((*C.QBoxLayout)(h)) } @@ -60,7 +67,7 @@ func NewQBoxLayout2(param1 QBoxLayout__Direction, parent *QWidget) *QBoxLayout { } func (this *QBoxLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QBoxLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QBoxLayout_MetaObject(this.h))) } func (this *QBoxLayout) Metacast(param1 string) unsafe.Pointer { @@ -213,11 +220,11 @@ func (this *QBoxLayout) Invalidate() { } func (this *QBoxLayout) ItemAt(param1 int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QBoxLayout_ItemAt(this.h, (C.int)(param1)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QBoxLayout_ItemAt(this.h, (C.int)(param1)))) } func (this *QBoxLayout) TakeAt(param1 int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QBoxLayout_TakeAt(this.h, (C.int)(param1)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QBoxLayout_TakeAt(this.h, (C.int)(param1)))) } func (this *QBoxLayout) Count() int { @@ -330,14 +337,21 @@ func (this *QHBoxLayout) cPointer() *C.QHBoxLayout { return this.h } +func (this *QHBoxLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHBoxLayout(h *C.QHBoxLayout) *QHBoxLayout { if h == nil { return nil } - return &QHBoxLayout{h: h, QBoxLayout: newQBoxLayout_U(unsafe.Pointer(h))} + return &QHBoxLayout{h: h, QBoxLayout: UnsafeNewQBoxLayout(unsafe.Pointer(h))} } -func newQHBoxLayout_U(h unsafe.Pointer) *QHBoxLayout { +func UnsafeNewQHBoxLayout(h unsafe.Pointer) *QHBoxLayout { return newQHBoxLayout((*C.QHBoxLayout)(h)) } @@ -354,7 +368,7 @@ func NewQHBoxLayout2(parent *QWidget) *QHBoxLayout { } func (this *QHBoxLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QHBoxLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QHBoxLayout_MetaObject(this.h))) } func (this *QHBoxLayout) Metacast(param1 string) unsafe.Pointer { @@ -451,14 +465,21 @@ func (this *QVBoxLayout) cPointer() *C.QVBoxLayout { return this.h } +func (this *QVBoxLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVBoxLayout(h *C.QVBoxLayout) *QVBoxLayout { if h == nil { return nil } - return &QVBoxLayout{h: h, QBoxLayout: newQBoxLayout_U(unsafe.Pointer(h))} + return &QVBoxLayout{h: h, QBoxLayout: UnsafeNewQBoxLayout(unsafe.Pointer(h))} } -func newQVBoxLayout_U(h unsafe.Pointer) *QVBoxLayout { +func UnsafeNewQVBoxLayout(h unsafe.Pointer) *QVBoxLayout { return newQVBoxLayout((*C.QVBoxLayout)(h)) } @@ -475,7 +496,7 @@ func NewQVBoxLayout2(parent *QWidget) *QVBoxLayout { } func (this *QVBoxLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QVBoxLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QVBoxLayout_MetaObject(this.h))) } func (this *QVBoxLayout) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qboxlayout.h b/qt/gen_qboxlayout.h index fbcaf606..ae9b554e 100644 --- a/qt/gen_qboxlayout.h +++ b/qt/gen_qboxlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbrush.cpp b/qt/gen_qbrush.cpp index 6d431d86..2edbbea8 100644 --- a/qt/gen_qbrush.cpp +++ b/qt/gen_qbrush.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qbrush.h" +#include #include "gen_qbrush.h" #include "_cgo_export.h" diff --git a/qt/gen_qbrush.go b/qt/gen_qbrush.go index 33fe7f3d..5baef776 100644 --- a/qt/gen_qbrush.go +++ b/qt/gen_qbrush.go @@ -231,6 +231,13 @@ func (this *QBrush) cPointer() *C.QBrush { return this.h } +func (this *QBrush) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBrush(h *C.QBrush) *QBrush { if h == nil { return nil @@ -238,7 +245,7 @@ func newQBrush(h *C.QBrush) *QBrush { return &QBrush{h: h} } -func newQBrush_U(h unsafe.Pointer) *QBrush { +func UnsafeNewQBrush(h unsafe.Pointer) *QBrush { return newQBrush((*C.QBrush)(h)) } @@ -331,7 +338,7 @@ func (this *QBrush) SetStyle(style BrushStyle) { } func (this *QBrush) Matrix() *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QBrush_Matrix(this.h))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QBrush_Matrix(this.h))) } func (this *QBrush) SetMatrix(mat *QMatrix) { @@ -372,7 +379,7 @@ func (this *QBrush) SetTextureImage(image *QImage) { } func (this *QBrush) Color() *QColor { - return newQColor_U(unsafe.Pointer(C.QBrush_Color(this.h))) + return UnsafeNewQColor(unsafe.Pointer(C.QBrush_Color(this.h))) } func (this *QBrush) SetColor(color *QColor) { @@ -384,7 +391,7 @@ func (this *QBrush) SetColorWithColor(color GlobalColor) { } func (this *QBrush) Gradient() *QGradient { - return newQGradient_U(unsafe.Pointer(C.QBrush_Gradient(this.h))) + return UnsafeNewQGradient(unsafe.Pointer(C.QBrush_Gradient(this.h))) } func (this *QBrush) IsOpaque() bool { @@ -428,6 +435,13 @@ func (this *QBrushData) cPointer() *C.QBrushData { return this.h } +func (this *QBrushData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBrushData(h *C.QBrushData) *QBrushData { if h == nil { return nil @@ -435,7 +449,7 @@ func newQBrushData(h *C.QBrushData) *QBrushData { return &QBrushData{h: h} } -func newQBrushData_U(h unsafe.Pointer) *QBrushData { +func UnsafeNewQBrushData(h unsafe.Pointer) *QBrushData { return newQBrushData((*C.QBrushData)(h)) } @@ -474,6 +488,13 @@ func (this *QGradient) cPointer() *C.QGradient { return this.h } +func (this *QGradient) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGradient(h *C.QGradient) *QGradient { if h == nil { return nil @@ -481,7 +502,7 @@ func newQGradient(h *C.QGradient) *QGradient { return &QGradient{h: h} } -func newQGradient_U(h unsafe.Pointer) *QGradient { +func UnsafeNewQGradient(h unsafe.Pointer) *QGradient { return newQGradient((*C.QGradient)(h)) } @@ -569,14 +590,21 @@ func (this *QLinearGradient) cPointer() *C.QLinearGradient { return this.h } +func (this *QLinearGradient) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLinearGradient(h *C.QLinearGradient) *QLinearGradient { if h == nil { return nil } - return &QLinearGradient{h: h, QGradient: newQGradient_U(unsafe.Pointer(h))} + return &QLinearGradient{h: h, QGradient: UnsafeNewQGradient(unsafe.Pointer(h))} } -func newQLinearGradient_U(h unsafe.Pointer) *QLinearGradient { +func UnsafeNewQLinearGradient(h unsafe.Pointer) *QLinearGradient { return newQLinearGradient((*C.QLinearGradient)(h)) } @@ -660,14 +688,21 @@ func (this *QRadialGradient) cPointer() *C.QRadialGradient { return this.h } +func (this *QRadialGradient) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRadialGradient(h *C.QRadialGradient) *QRadialGradient { if h == nil { return nil } - return &QRadialGradient{h: h, QGradient: newQGradient_U(unsafe.Pointer(h))} + return &QRadialGradient{h: h, QGradient: UnsafeNewQGradient(unsafe.Pointer(h))} } -func newQRadialGradient_U(h unsafe.Pointer) *QRadialGradient { +func UnsafeNewQRadialGradient(h unsafe.Pointer) *QRadialGradient { return newQRadialGradient((*C.QRadialGradient)(h)) } @@ -799,14 +834,21 @@ func (this *QConicalGradient) cPointer() *C.QConicalGradient { return this.h } +func (this *QConicalGradient) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQConicalGradient(h *C.QConicalGradient) *QConicalGradient { if h == nil { return nil } - return &QConicalGradient{h: h, QGradient: newQGradient_U(unsafe.Pointer(h))} + return &QConicalGradient{h: h, QGradient: UnsafeNewQGradient(unsafe.Pointer(h))} } -func newQConicalGradient_U(h unsafe.Pointer) *QConicalGradient { +func UnsafeNewQConicalGradient(h unsafe.Pointer) *QConicalGradient { return newQConicalGradient((*C.QConicalGradient)(h)) } @@ -882,6 +924,13 @@ func (this *QGradient__QGradientData) cPointer() *C.QGradient__QGradientData { return this.h } +func (this *QGradient__QGradientData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGradient__QGradientData(h *C.QGradient__QGradientData) *QGradient__QGradientData { if h == nil { return nil @@ -889,7 +938,7 @@ func newQGradient__QGradientData(h *C.QGradient__QGradientData) *QGradient__QGra return &QGradient__QGradientData{h: h} } -func newQGradient__QGradientData_U(h unsafe.Pointer) *QGradient__QGradientData { +func UnsafeNewQGradient__QGradientData(h unsafe.Pointer) *QGradient__QGradientData { return newQGradient__QGradientData((*C.QGradient__QGradientData)(h)) } diff --git a/qt/gen_qbrush.h b/qt/gen_qbrush.h index 206a6385..cba6b2de 100644 --- a/qt/gen_qbrush.h +++ b/qt/gen_qbrush.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbuffer.cpp b/qt/gen_qbuffer.cpp index 51fdeef6..6c567eba 100644 --- a/qt/gen_qbuffer.cpp +++ b/qt/gen_qbuffer.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qbuffer.h" +#include #include "gen_qbuffer.h" #include "_cgo_export.h" diff --git a/qt/gen_qbuffer.go b/qt/gen_qbuffer.go index d3425376..6157d08c 100644 --- a/qt/gen_qbuffer.go +++ b/qt/gen_qbuffer.go @@ -25,14 +25,21 @@ func (this *QBuffer) cPointer() *C.QBuffer { return this.h } +func (this *QBuffer) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBuffer(h *C.QBuffer) *QBuffer { if h == nil { return nil } - return &QBuffer{h: h, QIODevice: newQIODevice_U(unsafe.Pointer(h))} + return &QBuffer{h: h, QIODevice: UnsafeNewQIODevice(unsafe.Pointer(h))} } -func newQBuffer_U(h unsafe.Pointer) *QBuffer { +func UnsafeNewQBuffer(h unsafe.Pointer) *QBuffer { return newQBuffer((*C.QBuffer)(h)) } @@ -61,7 +68,7 @@ func NewQBuffer4(buf *QByteArray, parent *QObject) *QBuffer { } func (this *QBuffer) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QBuffer_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QBuffer_MetaObject(this.h))) } func (this *QBuffer) Metacast(param1 string) unsafe.Pointer { @@ -89,11 +96,11 @@ func QBuffer_TrUtf8(s string) string { } func (this *QBuffer) Buffer() *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QBuffer_Buffer(this.h))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QBuffer_Buffer(this.h))) } func (this *QBuffer) Buffer2() *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QBuffer_Buffer2(this.h))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QBuffer_Buffer2(this.h))) } func (this *QBuffer) SetBuffer(a *QByteArray) { @@ -111,7 +118,7 @@ func (this *QBuffer) SetData2(data string, lenVal int) { } func (this *QBuffer) Data() *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QBuffer_Data(this.h))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QBuffer_Data(this.h))) } func (this *QBuffer) Open(openMode QIODevice__OpenModeFlag) bool { diff --git a/qt/gen_qbuffer.h b/qt/gen_qbuffer.h index 6a2943dc..b0088707 100644 --- a/qt/gen_qbuffer.h +++ b/qt/gen_qbuffer.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbuttongroup.cpp b/qt/gen_qbuttongroup.cpp index b5716dc6..5edb242d 100644 --- a/qt/gen_qbuttongroup.cpp +++ b/qt/gen_qbuttongroup.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qbuttongroup.h" +#include #include "gen_qbuttongroup.h" #include "_cgo_export.h" diff --git a/qt/gen_qbuttongroup.go b/qt/gen_qbuttongroup.go index e257d960..ca28af29 100644 --- a/qt/gen_qbuttongroup.go +++ b/qt/gen_qbuttongroup.go @@ -26,14 +26,21 @@ func (this *QButtonGroup) cPointer() *C.QButtonGroup { return this.h } +func (this *QButtonGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQButtonGroup(h *C.QButtonGroup) *QButtonGroup { if h == nil { return nil } - return &QButtonGroup{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QButtonGroup{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQButtonGroup_U(h unsafe.Pointer) *QButtonGroup { +func UnsafeNewQButtonGroup(h unsafe.Pointer) *QButtonGroup { return newQButtonGroup((*C.QButtonGroup)(h)) } @@ -50,7 +57,7 @@ func NewQButtonGroup2(parent *QObject) *QButtonGroup { } func (this *QButtonGroup) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QButtonGroup_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QButtonGroup_MetaObject(this.h))) } func (this *QButtonGroup) Metacast(param1 string) unsafe.Pointer { @@ -98,18 +105,18 @@ func (this *QButtonGroup) Buttons() []*QAbstractButton { _ret := make([]*QAbstractButton, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractButton)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractButton_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractButton(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QButtonGroup) CheckedButton() *QAbstractButton { - return newQAbstractButton_U(unsafe.Pointer(C.QButtonGroup_CheckedButton(this.h))) + return UnsafeNewQAbstractButton(unsafe.Pointer(C.QButtonGroup_CheckedButton(this.h))) } func (this *QButtonGroup) Button(id int) *QAbstractButton { - return newQAbstractButton_U(unsafe.Pointer(C.QButtonGroup_Button(this.h, (C.int)(id)))) + return UnsafeNewQAbstractButton(unsafe.Pointer(C.QButtonGroup_Button(this.h, (C.int)(id)))) } func (this *QButtonGroup) SetId(button *QAbstractButton, id int) { @@ -139,7 +146,7 @@ func miqt_exec_callback_QButtonGroup_ButtonClicked(cb C.intptr_t, param1 *C.QAbs } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractButton_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQAbstractButton(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -159,7 +166,7 @@ func miqt_exec_callback_QButtonGroup_ButtonPressed(cb C.intptr_t, param1 *C.QAbs } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractButton_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQAbstractButton(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -179,7 +186,7 @@ func miqt_exec_callback_QButtonGroup_ButtonReleased(cb C.intptr_t, param1 *C.QAb } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractButton_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQAbstractButton(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -199,7 +206,7 @@ func miqt_exec_callback_QButtonGroup_ButtonToggled(cb C.intptr_t, param1 *C.QAbs } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractButton_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQAbstractButton(unsafe.Pointer(param1)) slotval2 := (bool)(param2) gofunc(slotval1, slotval2) diff --git a/qt/gen_qbuttongroup.h b/qt/gen_qbuttongroup.h index e3ec139d..21890c28 100644 --- a/qt/gen_qbuttongroup.h +++ b/qt/gen_qbuttongroup.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbytearray.cpp b/qt/gen_qbytearray.cpp index ec777364..639d496a 100644 --- a/qt/gen_qbytearray.cpp +++ b/qt/gen_qbytearray.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qbytearray.h" +#include #include "gen_qbytearray.h" #include "_cgo_export.h" diff --git a/qt/gen_qbytearray.go b/qt/gen_qbytearray.go index 7aa9b7c7..c8f01140 100644 --- a/qt/gen_qbytearray.go +++ b/qt/gen_qbytearray.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -58,6 +59,13 @@ func (this *QByteArrayDataPtr) cPointer() *C.QByteArrayDataPtr { return this.h } +func (this *QByteArrayDataPtr) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQByteArrayDataPtr(h *C.QByteArrayDataPtr) *QByteArrayDataPtr { if h == nil { return nil @@ -65,7 +73,7 @@ func newQByteArrayDataPtr(h *C.QByteArrayDataPtr) *QByteArrayDataPtr { return &QByteArrayDataPtr{h: h} } -func newQByteArrayDataPtr_U(h unsafe.Pointer) *QByteArrayDataPtr { +func UnsafeNewQByteArrayDataPtr(h unsafe.Pointer) *QByteArrayDataPtr { return newQByteArrayDataPtr((*C.QByteArrayDataPtr)(h)) } @@ -106,6 +114,13 @@ func (this *QByteArray) cPointer() *C.QByteArray { return this.h } +func (this *QByteArray) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQByteArray(h *C.QByteArray) *QByteArray { if h == nil { return nil @@ -113,7 +128,7 @@ func newQByteArray(h *C.QByteArray) *QByteArray { return &QByteArray{h: h} } -func newQByteArray_U(h unsafe.Pointer) *QByteArray { +func UnsafeNewQByteArray(h unsafe.Pointer) *QByteArray { return newQByteArray((*C.QByteArray)(h)) } @@ -190,7 +205,7 @@ func (this *QByteArray) Resize(size int) { } func (this *QByteArray) Fill(c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Fill(this.h, (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Fill(this.h, (C.char)(c)))) } func (this *QByteArray) Capacity() int { @@ -465,105 +480,105 @@ func (this *QByteArray) RightJustified(width int) *QByteArray { } func (this *QByteArray) Prepend(c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Prepend(this.h, (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Prepend(this.h, (C.char)(c)))) } func (this *QByteArray) Prepend2(count int, c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Prepend2(this.h, (C.int)(count), (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Prepend2(this.h, (C.int)(count), (C.char)(c)))) } func (this *QByteArray) PrependWithChar(s string) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_PrependWithChar(this.h, s_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_PrependWithChar(this.h, s_Cstring))) } func (this *QByteArray) Prepend3(s string, lenVal int) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Prepend3(this.h, s_Cstring, (C.int)(lenVal)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Prepend3(this.h, s_Cstring, (C.int)(lenVal)))) } func (this *QByteArray) PrependWithQByteArray(a *QByteArray) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_PrependWithQByteArray(this.h, a.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_PrependWithQByteArray(this.h, a.cPointer()))) } func (this *QByteArray) Append(c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Append(this.h, (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Append(this.h, (C.char)(c)))) } func (this *QByteArray) Append2(count int, c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Append2(this.h, (C.int)(count), (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Append2(this.h, (C.int)(count), (C.char)(c)))) } func (this *QByteArray) AppendWithChar(s string) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_AppendWithChar(this.h, s_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_AppendWithChar(this.h, s_Cstring))) } func (this *QByteArray) Append3(s string, lenVal int) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Append3(this.h, s_Cstring, (C.int)(lenVal)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Append3(this.h, s_Cstring, (C.int)(lenVal)))) } func (this *QByteArray) AppendWithQByteArray(a *QByteArray) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_AppendWithQByteArray(this.h, a.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_AppendWithQByteArray(this.h, a.cPointer()))) } func (this *QByteArray) Insert(i int, c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Insert(this.h, (C.int)(i), (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Insert(this.h, (C.int)(i), (C.char)(c)))) } func (this *QByteArray) Insert2(i int, count int, c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Insert2(this.h, (C.int)(i), (C.int)(count), (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Insert2(this.h, (C.int)(i), (C.int)(count), (C.char)(c)))) } func (this *QByteArray) Insert3(i int, s string) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Insert3(this.h, (C.int)(i), s_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Insert3(this.h, (C.int)(i), s_Cstring))) } func (this *QByteArray) Insert4(i int, s string, lenVal int) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Insert4(this.h, (C.int)(i), s_Cstring, (C.int)(lenVal)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Insert4(this.h, (C.int)(i), s_Cstring, (C.int)(lenVal)))) } func (this *QByteArray) Insert5(i int, a *QByteArray) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Insert5(this.h, (C.int)(i), a.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Insert5(this.h, (C.int)(i), a.cPointer()))) } func (this *QByteArray) Remove(index int, lenVal int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Remove(this.h, (C.int)(index), (C.int)(lenVal)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Remove(this.h, (C.int)(index), (C.int)(lenVal)))) } func (this *QByteArray) Replace(index int, lenVal int, s string) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace(this.h, (C.int)(index), (C.int)(lenVal), s_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace(this.h, (C.int)(index), (C.int)(lenVal), s_Cstring))) } func (this *QByteArray) Replace2(index int, lenVal int, s string, alen int) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace2(this.h, (C.int)(index), (C.int)(lenVal), s_Cstring, (C.int)(alen)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace2(this.h, (C.int)(index), (C.int)(lenVal), s_Cstring, (C.int)(alen)))) } func (this *QByteArray) Replace3(index int, lenVal int, s *QByteArray) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace3(this.h, (C.int)(index), (C.int)(lenVal), s.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace3(this.h, (C.int)(index), (C.int)(lenVal), s.cPointer()))) } func (this *QByteArray) Replace4(before int8, after string) *QByteArray { after_Cstring := C.CString(after) defer C.free(unsafe.Pointer(after_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace4(this.h, (C.char)(before), after_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace4(this.h, (C.char)(before), after_Cstring))) } func (this *QByteArray) Replace5(before int8, after *QByteArray) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace5(this.h, (C.char)(before), after.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace5(this.h, (C.char)(before), after.cPointer()))) } func (this *QByteArray) Replace6(before string, after string) *QByteArray { @@ -571,7 +586,7 @@ func (this *QByteArray) Replace6(before string, after string) *QByteArray { defer C.free(unsafe.Pointer(before_Cstring)) after_Cstring := C.CString(after) defer C.free(unsafe.Pointer(after_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace6(this.h, before_Cstring, after_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace6(this.h, before_Cstring, after_Cstring))) } func (this *QByteArray) Replace7(before string, bsize int, after string, asize int) *QByteArray { @@ -579,41 +594,41 @@ func (this *QByteArray) Replace7(before string, bsize int, after string, asize i defer C.free(unsafe.Pointer(before_Cstring)) after_Cstring := C.CString(after) defer C.free(unsafe.Pointer(after_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace7(this.h, before_Cstring, (C.int)(bsize), after_Cstring, (C.int)(asize)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace7(this.h, before_Cstring, (C.int)(bsize), after_Cstring, (C.int)(asize)))) } func (this *QByteArray) Replace8(before *QByteArray, after *QByteArray) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace8(this.h, before.cPointer(), after.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace8(this.h, before.cPointer(), after.cPointer()))) } func (this *QByteArray) Replace9(before *QByteArray, after string) *QByteArray { after_Cstring := C.CString(after) defer C.free(unsafe.Pointer(after_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace9(this.h, before.cPointer(), after_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace9(this.h, before.cPointer(), after_Cstring))) } func (this *QByteArray) Replace10(before string, after *QByteArray) *QByteArray { before_Cstring := C.CString(before) defer C.free(unsafe.Pointer(before_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace10(this.h, before_Cstring, after.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace10(this.h, before_Cstring, after.cPointer()))) } func (this *QByteArray) Replace11(before int8, after int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace11(this.h, (C.char)(before), (C.char)(after)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace11(this.h, (C.char)(before), (C.char)(after)))) } func (this *QByteArray) OperatorPlusAssign(c int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_OperatorPlusAssign(this.h, (C.char)(c)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_OperatorPlusAssign(this.h, (C.char)(c)))) } func (this *QByteArray) OperatorPlusAssignWithChar(s string) *QByteArray { s_Cstring := C.CString(s) defer C.free(unsafe.Pointer(s_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_OperatorPlusAssignWithChar(this.h, s_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_OperatorPlusAssignWithChar(this.h, s_Cstring))) } func (this *QByteArray) OperatorPlusAssignWithQByteArray(a *QByteArray) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_OperatorPlusAssignWithQByteArray(this.h, a.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_OperatorPlusAssignWithQByteArray(this.h, a.cPointer()))) } func (this *QByteArray) Split(sep int8) []QByteArray { @@ -638,87 +653,87 @@ func (this *QByteArray) Repeated(times int) *QByteArray { } func (this *QByteArray) AppendWithQString(s string) *QByteArray { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_AppendWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_AppendWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) } func (this *QByteArray) Insert6(i int, s string) *QByteArray { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Insert6(this.h, (C.int)(i), (*C.struct_miqt_string)(s_ms)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Insert6(this.h, (C.int)(i), (*C.struct_miqt_string)(s_ms)))) } func (this *QByteArray) Replace12(before string, after string) *QByteArray { - before_ms := miqt_strdupg(before) + before_ms := libmiqt.Strdupg(before) defer C.free(before_ms) after_Cstring := C.CString(after) defer C.free(unsafe.Pointer(after_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace12(this.h, (*C.struct_miqt_string)(before_ms), after_Cstring))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace12(this.h, (*C.struct_miqt_string)(before_ms), after_Cstring))) } func (this *QByteArray) Replace13(c int8, after string) *QByteArray { - after_ms := miqt_strdupg(after) + after_ms := libmiqt.Strdupg(after) defer C.free(after_ms) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace13(this.h, (C.char)(c), (*C.struct_miqt_string)(after_ms)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace13(this.h, (C.char)(c), (*C.struct_miqt_string)(after_ms)))) } func (this *QByteArray) Replace14(before string, after *QByteArray) *QByteArray { - before_ms := miqt_strdupg(before) + before_ms := libmiqt.Strdupg(before) defer C.free(before_ms) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Replace14(this.h, (*C.struct_miqt_string)(before_ms), after.cPointer()))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Replace14(this.h, (*C.struct_miqt_string)(before_ms), after.cPointer()))) } func (this *QByteArray) OperatorPlusAssignWithQString(s string) *QByteArray { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_OperatorPlusAssignWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_OperatorPlusAssignWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) } func (this *QByteArray) IndexOfWithQString(s string) int { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int)(C.QByteArray_IndexOfWithQString(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QByteArray) LastIndexOfWithQString(s string) int { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int)(C.QByteArray_LastIndexOfWithQString(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QByteArray) OperatorEqual(s2 string) bool { - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (bool)(C.QByteArray_OperatorEqual(this.h, (*C.struct_miqt_string)(s2_ms))) } func (this *QByteArray) OperatorNotEqual(s2 string) bool { - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (bool)(C.QByteArray_OperatorNotEqual(this.h, (*C.struct_miqt_string)(s2_ms))) } func (this *QByteArray) OperatorLesser(s2 string) bool { - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (bool)(C.QByteArray_OperatorLesser(this.h, (*C.struct_miqt_string)(s2_ms))) } func (this *QByteArray) OperatorGreater(s2 string) bool { - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (bool)(C.QByteArray_OperatorGreater(this.h, (*C.struct_miqt_string)(s2_ms))) } func (this *QByteArray) OperatorLesserOrEqual(s2 string) bool { - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (bool)(C.QByteArray_OperatorLesserOrEqual(this.h, (*C.struct_miqt_string)(s2_ms))) } func (this *QByteArray) OperatorGreaterOrEqual(s2 string) bool { - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (bool)(C.QByteArray_OperatorGreaterOrEqual(this.h, (*C.struct_miqt_string)(s2_ms))) } @@ -799,41 +814,41 @@ func (this *QByteArray) ToPercentEncoding() *QByteArray { } func (this *QByteArray) SetNum(param1 int16) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum(this.h, (C.int16_t)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum(this.h, (C.int16_t)(param1)))) } func (this *QByteArray) SetNumWithUshort(param1 uint16) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNumWithUshort(this.h, (C.uint16_t)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNumWithUshort(this.h, (C.uint16_t)(param1)))) } func (this *QByteArray) SetNumWithInt(param1 int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNumWithInt(this.h, (C.int)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNumWithInt(this.h, (C.int)(param1)))) } func (this *QByteArray) SetNumWithUint(param1 uint) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNumWithUint(this.h, (C.uint)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNumWithUint(this.h, (C.uint)(param1)))) } func (this *QByteArray) SetNumWithQlonglong(param1 int64) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNumWithQlonglong(this.h, (C.longlong)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNumWithQlonglong(this.h, (C.longlong)(param1)))) } func (this *QByteArray) SetNumWithQulonglong(param1 uint64) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNumWithQulonglong(this.h, (C.ulonglong)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNumWithQulonglong(this.h, (C.ulonglong)(param1)))) } func (this *QByteArray) SetNumWithFloat(param1 float32) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNumWithFloat(this.h, (C.float)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNumWithFloat(this.h, (C.float)(param1)))) } func (this *QByteArray) SetNumWithDouble(param1 float64) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNumWithDouble(this.h, (C.double)(param1)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNumWithDouble(this.h, (C.double)(param1)))) } func (this *QByteArray) SetRawData(a string, n uint) *QByteArray { a_Cstring := C.CString(a) defer C.free(unsafe.Pointer(a_Cstring)) - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetRawData(this.h, a_Cstring, (C.uint)(n)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetRawData(this.h, a_Cstring, (C.uint)(n)))) } func QByteArray_Number(param1 int) *QByteArray { @@ -1000,7 +1015,7 @@ func (this *QByteArray) IsNull() bool { } func (this *QByteArray) Fill2(c int8, size int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_Fill2(this.h, (C.char)(c), (C.int)(size)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_Fill2(this.h, (C.char)(c), (C.int)(size)))) } func (this *QByteArray) IndexOf2(c int8, from int) int { @@ -1077,13 +1092,13 @@ func (this *QByteArray) RightJustified3(width int, fill int8, truncate bool) *QB } func (this *QByteArray) IndexOf24(s string, from int) int { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int)(C.QByteArray_IndexOf24(this.h, (*C.struct_miqt_string)(s_ms), (C.int)(from))) } func (this *QByteArray) LastIndexOf24(s string, from int) int { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int)(C.QByteArray_LastIndexOf24(this.h, (*C.struct_miqt_string)(s_ms), (C.int)(from))) } @@ -1182,43 +1197,43 @@ func (this *QByteArray) ToPercentEncoding3(exclude *QByteArray, include *QByteAr } func (this *QByteArray) SetNum2(param1 int16, base int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum2(this.h, (C.int16_t)(param1), (C.int)(base)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum2(this.h, (C.int16_t)(param1), (C.int)(base)))) } func (this *QByteArray) SetNum22(param1 uint16, base int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum22(this.h, (C.uint16_t)(param1), (C.int)(base)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum22(this.h, (C.uint16_t)(param1), (C.int)(base)))) } func (this *QByteArray) SetNum23(param1 int, base int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum23(this.h, (C.int)(param1), (C.int)(base)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum23(this.h, (C.int)(param1), (C.int)(base)))) } func (this *QByteArray) SetNum24(param1 uint, base int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum24(this.h, (C.uint)(param1), (C.int)(base)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum24(this.h, (C.uint)(param1), (C.int)(base)))) } func (this *QByteArray) SetNum25(param1 int64, base int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum25(this.h, (C.longlong)(param1), (C.int)(base)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum25(this.h, (C.longlong)(param1), (C.int)(base)))) } func (this *QByteArray) SetNum26(param1 uint64, base int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum26(this.h, (C.ulonglong)(param1), (C.int)(base)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum26(this.h, (C.ulonglong)(param1), (C.int)(base)))) } func (this *QByteArray) SetNum27(param1 float32, f int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum27(this.h, (C.float)(param1), (C.char)(f)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum27(this.h, (C.float)(param1), (C.char)(f)))) } func (this *QByteArray) SetNum3(param1 float32, f int8, prec int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum3(this.h, (C.float)(param1), (C.char)(f), (C.int)(prec)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum3(this.h, (C.float)(param1), (C.char)(f), (C.int)(prec)))) } func (this *QByteArray) SetNum28(param1 float64, f int8) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum28(this.h, (C.double)(param1), (C.char)(f)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum28(this.h, (C.double)(param1), (C.char)(f)))) } func (this *QByteArray) SetNum32(param1 float64, f int8, prec int) *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray_SetNum32(this.h, (C.double)(param1), (C.char)(f), (C.int)(prec)))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray_SetNum32(this.h, (C.double)(param1), (C.char)(f), (C.int)(prec)))) } func QByteArray_Number2(param1 int, base int) *QByteArray { @@ -1302,6 +1317,13 @@ func (this *QByteRef) cPointer() *C.QByteRef { return this.h } +func (this *QByteRef) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQByteRef(h *C.QByteRef) *QByteRef { if h == nil { return nil @@ -1309,7 +1331,7 @@ func newQByteRef(h *C.QByteRef) *QByteRef { return &QByteRef{h: h} } -func newQByteRef_U(h unsafe.Pointer) *QByteRef { +func UnsafeNewQByteRef(h unsafe.Pointer) *QByteRef { return newQByteRef((*C.QByteRef)(h)) } @@ -1376,6 +1398,13 @@ func (this *QByteArray__FromBase64Result) cPointer() *C.QByteArray__FromBase64Re return this.h } +func (this *QByteArray__FromBase64Result) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQByteArray__FromBase64Result(h *C.QByteArray__FromBase64Result) *QByteArray__FromBase64Result { if h == nil { return nil @@ -1383,7 +1412,7 @@ func newQByteArray__FromBase64Result(h *C.QByteArray__FromBase64Result) *QByteAr return &QByteArray__FromBase64Result{h: h} } -func newQByteArray__FromBase64Result_U(h unsafe.Pointer) *QByteArray__FromBase64Result { +func UnsafeNewQByteArray__FromBase64Result(h unsafe.Pointer) *QByteArray__FromBase64Result { return newQByteArray__FromBase64Result((*C.QByteArray__FromBase64Result)(h)) } @@ -1398,11 +1427,11 @@ func (this *QByteArray__FromBase64Result) Swap(other *QByteArray__FromBase64Resu } func (this *QByteArray__FromBase64Result) OperatorMultiply() *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray__FromBase64Result_OperatorMultiply(this.h))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray__FromBase64Result_OperatorMultiply(this.h))) } func (this *QByteArray__FromBase64Result) OperatorMultiply2() *QByteArray { - return newQByteArray_U(unsafe.Pointer(C.QByteArray__FromBase64Result_OperatorMultiply2(this.h))) + return UnsafeNewQByteArray(unsafe.Pointer(C.QByteArray__FromBase64Result_OperatorMultiply2(this.h))) } func (this *QByteArray__FromBase64Result) OperatorAssign(param1 *QByteArray__FromBase64Result) { diff --git a/qt/gen_qbytearray.h b/qt/gen_qbytearray.h index 5e55129f..e5b2e17b 100644 --- a/qt/gen_qbytearray.h +++ b/qt/gen_qbytearray.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qbytearraymatcher.cpp b/qt/gen_qbytearraymatcher.cpp index 646d9cda..f5ed3f0c 100644 --- a/qt/gen_qbytearraymatcher.cpp +++ b/qt/gen_qbytearraymatcher.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qbytearraymatcher.h" +#include #include "gen_qbytearraymatcher.h" #include "_cgo_export.h" diff --git a/qt/gen_qbytearraymatcher.go b/qt/gen_qbytearraymatcher.go index 09cff21f..36f7e65e 100644 --- a/qt/gen_qbytearraymatcher.go +++ b/qt/gen_qbytearraymatcher.go @@ -24,6 +24,13 @@ func (this *QByteArrayMatcher) cPointer() *C.QByteArrayMatcher { return this.h } +func (this *QByteArrayMatcher) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQByteArrayMatcher(h *C.QByteArrayMatcher) *QByteArrayMatcher { if h == nil { return nil @@ -31,7 +38,7 @@ func newQByteArrayMatcher(h *C.QByteArrayMatcher) *QByteArrayMatcher { return &QByteArrayMatcher{h: h} } -func newQByteArrayMatcher_U(h unsafe.Pointer) *QByteArrayMatcher { +func UnsafeNewQByteArrayMatcher(h unsafe.Pointer) *QByteArrayMatcher { return newQByteArrayMatcher((*C.QByteArrayMatcher)(h)) } @@ -121,6 +128,13 @@ func (this *QStaticByteArrayMatcherBase) cPointer() *C.QStaticByteArrayMatcherBa return this.h } +func (this *QStaticByteArrayMatcherBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStaticByteArrayMatcherBase(h *C.QStaticByteArrayMatcherBase) *QStaticByteArrayMatcherBase { if h == nil { return nil @@ -128,7 +142,7 @@ func newQStaticByteArrayMatcherBase(h *C.QStaticByteArrayMatcherBase) *QStaticBy return &QStaticByteArrayMatcherBase{h: h} } -func newQStaticByteArrayMatcherBase_U(h unsafe.Pointer) *QStaticByteArrayMatcherBase { +func UnsafeNewQStaticByteArrayMatcherBase(h unsafe.Pointer) *QStaticByteArrayMatcherBase { return newQStaticByteArrayMatcherBase((*C.QStaticByteArrayMatcherBase)(h)) } diff --git a/qt/gen_qbytearraymatcher.h b/qt/gen_qbytearraymatcher.h index 5e06be39..8f52971b 100644 --- a/qt/gen_qbytearraymatcher.h +++ b/qt/gen_qbytearraymatcher.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcalendar.cpp b/qt/gen_qcalendar.cpp index 52ce970f..e07a926c 100644 --- a/qt/gen_qcalendar.cpp +++ b/qt/gen_qcalendar.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qcalendar.h" +#include #include "gen_qcalendar.h" #include "_cgo_export.h" diff --git a/qt/gen_qcalendar.go b/qt/gen_qcalendar.go index 1879a370..0eab775c 100644 --- a/qt/gen_qcalendar.go +++ b/qt/gen_qcalendar.go @@ -42,6 +42,13 @@ func (this *QCalendar) cPointer() *C.QCalendar { return this.h } +func (this *QCalendar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCalendar(h *C.QCalendar) *QCalendar { if h == nil { return nil @@ -49,7 +56,7 @@ func newQCalendar(h *C.QCalendar) *QCalendar { return &QCalendar{h: h} } -func newQCalendar_U(h unsafe.Pointer) *QCalendar { +func UnsafeNewQCalendar(h unsafe.Pointer) *QCalendar { return newQCalendar((*C.QCalendar)(h)) } @@ -270,6 +277,13 @@ func (this *QCalendar__YearMonthDay) cPointer() *C.QCalendar__YearMonthDay { return this.h } +func (this *QCalendar__YearMonthDay) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCalendar__YearMonthDay(h *C.QCalendar__YearMonthDay) *QCalendar__YearMonthDay { if h == nil { return nil @@ -277,7 +291,7 @@ func newQCalendar__YearMonthDay(h *C.QCalendar__YearMonthDay) *QCalendar__YearMo return &QCalendar__YearMonthDay{h: h} } -func newQCalendar__YearMonthDay_U(h unsafe.Pointer) *QCalendar__YearMonthDay { +func UnsafeNewQCalendar__YearMonthDay(h unsafe.Pointer) *QCalendar__YearMonthDay { return newQCalendar__YearMonthDay((*C.QCalendar__YearMonthDay)(h)) } diff --git a/qt/gen_qcalendar.h b/qt/gen_qcalendar.h index 666dfd2d..4291a1a1 100644 --- a/qt/gen_qcalendar.h +++ b/qt/gen_qcalendar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcalendarwidget.cpp b/qt/gen_qcalendarwidget.cpp index 3091ff9c..02d60022 100644 --- a/qt/gen_qcalendarwidget.cpp +++ b/qt/gen_qcalendarwidget.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qcalendarwidget.h" +#include #include "gen_qcalendarwidget.h" #include "_cgo_export.h" diff --git a/qt/gen_qcalendarwidget.go b/qt/gen_qcalendarwidget.go index 9f3fa935..78910452 100644 --- a/qt/gen_qcalendarwidget.go +++ b/qt/gen_qcalendarwidget.go @@ -49,14 +49,21 @@ func (this *QCalendarWidget) cPointer() *C.QCalendarWidget { return this.h } +func (this *QCalendarWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCalendarWidget(h *C.QCalendarWidget) *QCalendarWidget { if h == nil { return nil } - return &QCalendarWidget{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QCalendarWidget{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQCalendarWidget_U(h unsafe.Pointer) *QCalendarWidget { +func UnsafeNewQCalendarWidget(h unsafe.Pointer) *QCalendarWidget { return newQCalendarWidget((*C.QCalendarWidget)(h)) } @@ -73,7 +80,7 @@ func NewQCalendarWidget2(parent *QWidget) *QCalendarWidget { } func (this *QCalendarWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QCalendarWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QCalendarWidget_MetaObject(this.h))) } func (this *QCalendarWidget) Metacast(param1 string) unsafe.Pointer { @@ -327,7 +334,7 @@ func miqt_exec_callback_QCalendarWidget_Clicked(cb C.intptr_t, date *C.QDate) { } // Convert all CABI parameters to Go parameters - slotval1 := newQDate_U(unsafe.Pointer(date)) + slotval1 := UnsafeNewQDate(unsafe.Pointer(date)) gofunc(slotval1) } @@ -347,7 +354,7 @@ func miqt_exec_callback_QCalendarWidget_Activated(cb C.intptr_t, date *C.QDate) } // Convert all CABI parameters to Go parameters - slotval1 := newQDate_U(unsafe.Pointer(date)) + slotval1 := UnsafeNewQDate(unsafe.Pointer(date)) gofunc(slotval1) } diff --git a/qt/gen_qcalendarwidget.h b/qt/gen_qcalendarwidget.h index f5ba92e6..d58fbdbc 100644 --- a/qt/gen_qcalendarwidget.h +++ b/qt/gen_qcalendarwidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcborarray.cpp b/qt/gen_qcborarray.cpp index 2a5de072..47cc6591 100644 --- a/qt/gen_qcborarray.cpp +++ b/qt/gen_qcborarray.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qcborarray.h" +#include #include "gen_qcborarray.h" #include "_cgo_export.h" @@ -222,7 +222,7 @@ QCborArray* QCborArray_OperatorShiftLeft(QCborArray* self, QCborValue* v) { } QCborArray* QCborArray_FromStringList(struct miqt_array* /* of struct miqt_string* */ list) { - QList list_QList; + QStringList list_QList; list_QList.reserve(list->len); struct miqt_string** list_arr = static_cast(list->data); for(size_t i = 0; i < list->len; ++i) { diff --git a/qt/gen_qcborarray.go b/qt/gen_qcborarray.go index 7da87029..353ece6e 100644 --- a/qt/gen_qcborarray.go +++ b/qt/gen_qcborarray.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QCborArray) cPointer() *C.QCborArray { return this.h } +func (this *QCborArray) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborArray(h *C.QCborArray) *QCborArray { if h == nil { return nil @@ -31,7 +39,7 @@ func newQCborArray(h *C.QCborArray) *QCborArray { return &QCborArray{h: h} } -func newQCborArray_U(h unsafe.Pointer) *QCborArray { +func UnsafeNewQCborArray(h unsafe.Pointer) *QCborArray { return newQCborArray((*C.QCborArray)(h)) } @@ -314,11 +322,11 @@ func (this *QCborArray) OperatorPlus(v *QCborValue) *QCborArray { } func (this *QCborArray) OperatorPlusAssign(v *QCborValue) *QCborArray { - return newQCborArray_U(unsafe.Pointer(C.QCborArray_OperatorPlusAssign(this.h, v.cPointer()))) + return UnsafeNewQCborArray(unsafe.Pointer(C.QCborArray_OperatorPlusAssign(this.h, v.cPointer()))) } func (this *QCborArray) OperatorShiftLeft(v *QCborValue) *QCborArray { - return newQCborArray_U(unsafe.Pointer(C.QCborArray_OperatorShiftLeft(this.h, v.cPointer()))) + return UnsafeNewQCborArray(unsafe.Pointer(C.QCborArray_OperatorShiftLeft(this.h, v.cPointer()))) } func QCborArray_FromStringList(list []string) *QCborArray { @@ -326,7 +334,7 @@ func QCborArray_FromStringList(list []string) *QCborArray { list_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(list)))) defer C.free(unsafe.Pointer(list_CArray)) for i := range list { - list_i_ms := miqt_strdupg(list[i]) + list_i_ms := libmiqt.Strdupg(list[i]) defer C.free(list_i_ms) list_CArray[i] = (*C.struct_miqt_string)(list_i_ms) } @@ -377,6 +385,13 @@ func (this *QCborArray__Iterator) cPointer() *C.QCborArray__Iterator { return this.h } +func (this *QCborArray__Iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborArray__Iterator(h *C.QCborArray__Iterator) *QCborArray__Iterator { if h == nil { return nil @@ -384,7 +399,7 @@ func newQCborArray__Iterator(h *C.QCborArray__Iterator) *QCborArray__Iterator { return &QCborArray__Iterator{h: h} } -func newQCborArray__Iterator_U(h unsafe.Pointer) *QCborArray__Iterator { +func UnsafeNewQCborArray__Iterator(h unsafe.Pointer) *QCborArray__Iterator { return newQCborArray__Iterator((*C.QCborArray__Iterator)(h)) } @@ -412,7 +427,7 @@ func (this *QCborArray__Iterator) OperatorMultiply() *QCborValueRef { } func (this *QCborArray__Iterator) OperatorMinusGreater() *QCborValueRef { - return newQCborValueRef_U(unsafe.Pointer(C.QCborArray__Iterator_OperatorMinusGreater(this.h))) + return UnsafeNewQCborValueRef(unsafe.Pointer(C.QCborArray__Iterator_OperatorMinusGreater(this.h))) } func (this *QCborArray__Iterator) OperatorSubscript(j int64) *QCborValueRef { @@ -471,7 +486,7 @@ func (this *QCborArray__Iterator) OperatorGreaterOrEqualWithOther(other *QCborAr } func (this *QCborArray__Iterator) OperatorPlusPlus() *QCborArray__Iterator { - return newQCborArray__Iterator_U(unsafe.Pointer(C.QCborArray__Iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQCborArray__Iterator(unsafe.Pointer(C.QCborArray__Iterator_OperatorPlusPlus(this.h))) } func (this *QCborArray__Iterator) OperatorPlusPlusWithInt(param1 int) *QCborArray__Iterator { @@ -482,7 +497,7 @@ func (this *QCborArray__Iterator) OperatorPlusPlusWithInt(param1 int) *QCborArra } func (this *QCborArray__Iterator) OperatorMinusMinus() *QCborArray__Iterator { - return newQCborArray__Iterator_U(unsafe.Pointer(C.QCborArray__Iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQCborArray__Iterator(unsafe.Pointer(C.QCborArray__Iterator_OperatorMinusMinus(this.h))) } func (this *QCborArray__Iterator) OperatorMinusMinusWithInt(param1 int) *QCborArray__Iterator { @@ -493,11 +508,11 @@ func (this *QCborArray__Iterator) OperatorMinusMinusWithInt(param1 int) *QCborAr } func (this *QCborArray__Iterator) OperatorPlusAssign(j int64) *QCborArray__Iterator { - return newQCborArray__Iterator_U(unsafe.Pointer(C.QCborArray__Iterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborArray__Iterator(unsafe.Pointer(C.QCborArray__Iterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborArray__Iterator) OperatorMinusAssign(j int64) *QCborArray__Iterator { - return newQCborArray__Iterator_U(unsafe.Pointer(C.QCborArray__Iterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborArray__Iterator(unsafe.Pointer(C.QCborArray__Iterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborArray__Iterator) OperatorPlus(j int64) *QCborArray__Iterator { @@ -543,6 +558,13 @@ func (this *QCborArray__ConstIterator) cPointer() *C.QCborArray__ConstIterator { return this.h } +func (this *QCborArray__ConstIterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborArray__ConstIterator(h *C.QCborArray__ConstIterator) *QCborArray__ConstIterator { if h == nil { return nil @@ -550,7 +572,7 @@ func newQCborArray__ConstIterator(h *C.QCborArray__ConstIterator) *QCborArray__C return &QCborArray__ConstIterator{h: h} } -func newQCborArray__ConstIterator_U(h unsafe.Pointer) *QCborArray__ConstIterator { +func UnsafeNewQCborArray__ConstIterator(h unsafe.Pointer) *QCborArray__ConstIterator { return newQCborArray__ConstIterator((*C.QCborArray__ConstIterator)(h)) } @@ -578,7 +600,7 @@ func (this *QCborArray__ConstIterator) OperatorMultiply() *QCborValueRef { } func (this *QCborArray__ConstIterator) OperatorMinusGreater() *QCborValueRef { - return newQCborValueRef_U(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorMinusGreater(this.h))) + return UnsafeNewQCborValueRef(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorMinusGreater(this.h))) } func (this *QCborArray__ConstIterator) OperatorSubscript(j int64) *QCborValueRef { @@ -637,7 +659,7 @@ func (this *QCborArray__ConstIterator) OperatorGreaterOrEqualWithOther(other *QC } func (this *QCborArray__ConstIterator) OperatorPlusPlus() *QCborArray__ConstIterator { - return newQCborArray__ConstIterator_U(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorPlusPlus(this.h))) + return UnsafeNewQCborArray__ConstIterator(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorPlusPlus(this.h))) } func (this *QCborArray__ConstIterator) OperatorPlusPlusWithInt(param1 int) *QCborArray__ConstIterator { @@ -648,7 +670,7 @@ func (this *QCborArray__ConstIterator) OperatorPlusPlusWithInt(param1 int) *QCbo } func (this *QCborArray__ConstIterator) OperatorMinusMinus() *QCborArray__ConstIterator { - return newQCborArray__ConstIterator_U(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorMinusMinus(this.h))) + return UnsafeNewQCborArray__ConstIterator(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorMinusMinus(this.h))) } func (this *QCborArray__ConstIterator) OperatorMinusMinusWithInt(param1 int) *QCborArray__ConstIterator { @@ -659,11 +681,11 @@ func (this *QCborArray__ConstIterator) OperatorMinusMinusWithInt(param1 int) *QC } func (this *QCborArray__ConstIterator) OperatorPlusAssign(j int64) *QCborArray__ConstIterator { - return newQCborArray__ConstIterator_U(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborArray__ConstIterator(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborArray__ConstIterator) OperatorMinusAssign(j int64) *QCborArray__ConstIterator { - return newQCborArray__ConstIterator_U(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborArray__ConstIterator(unsafe.Pointer(C.QCborArray__ConstIterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborArray__ConstIterator) OperatorPlus(j int64) *QCborArray__ConstIterator { diff --git a/qt/gen_qcborarray.h b/qt/gen_qcborarray.h index a05b5c57..431a4493 100644 --- a/qt/gen_qcborarray.h +++ b/qt/gen_qcborarray.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcborcommon.cpp b/qt/gen_qcborcommon.cpp index 9020c5e7..e34a1cd8 100644 --- a/qt/gen_qcborcommon.cpp +++ b/qt/gen_qcborcommon.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qcborcommon.h" +#include #include "gen_qcborcommon.h" #include "_cgo_export.h" diff --git a/qt/gen_qcborcommon.go b/qt/gen_qcborcommon.go index 20a4838f..90c15545 100644 --- a/qt/gen_qcborcommon.go +++ b/qt/gen_qcborcommon.go @@ -85,6 +85,13 @@ func (this *QCborError) cPointer() *C.QCborError { return this.h } +func (this *QCborError) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborError(h *C.QCborError) *QCborError { if h == nil { return nil @@ -92,7 +99,7 @@ func newQCborError(h *C.QCborError) *QCborError { return &QCborError{h: h} } -func newQCborError_U(h unsafe.Pointer) *QCborError { +func UnsafeNewQCborError(h unsafe.Pointer) *QCborError { return newQCborError((*C.QCborError)(h)) } diff --git a/qt/gen_qcborcommon.h b/qt/gen_qcborcommon.h index 244d7bd7..56692e2e 100644 --- a/qt/gen_qcborcommon.h +++ b/qt/gen_qcborcommon.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcbormap.cpp b/qt/gen_qcbormap.cpp index 4e7557c3..748d3bc3 100644 --- a/qt/gen_qcbormap.cpp +++ b/qt/gen_qcbormap.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qcbormap.h" +#include #include "gen_qcbormap.h" #include "_cgo_export.h" diff --git a/qt/gen_qcbormap.go b/qt/gen_qcbormap.go index 70c1ffbc..d6d06c3d 100644 --- a/qt/gen_qcbormap.go +++ b/qt/gen_qcbormap.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QCborMap) cPointer() *C.QCborMap { return this.h } +func (this *QCborMap) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborMap(h *C.QCborMap) *QCborMap { if h == nil { return nil @@ -31,7 +39,7 @@ func newQCborMap(h *C.QCborMap) *QCborMap { return &QCborMap{h: h} } -func newQCborMap_U(h unsafe.Pointer) *QCborMap { +func UnsafeNewQCborMap(h unsafe.Pointer) *QCborMap { return newQCborMap((*C.QCborMap)(h)) } @@ -96,7 +104,7 @@ func (this *QCborMap) Value(key int64) *QCborValue { } func (this *QCborMap) Value2(key string) *QCborValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_Value2(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValue(_ret) @@ -119,7 +127,7 @@ func (this *QCborMap) OperatorSubscript(key int64) *QCborValue { } func (this *QCborMap) OperatorSubscript2(key string) *QCborValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_OperatorSubscript2(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValue(_ret) @@ -142,7 +150,7 @@ func (this *QCborMap) OperatorSubscript4(key int64) *QCborValueRef { } func (this *QCborMap) OperatorSubscript6(key string) *QCborValueRef { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_OperatorSubscript6(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValueRef(_ret) @@ -165,7 +173,7 @@ func (this *QCborMap) Take(key int64) *QCborValue { } func (this *QCborMap) Take2(key string) *QCborValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_Take2(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValue(_ret) @@ -185,7 +193,7 @@ func (this *QCborMap) Remove(key int64) { } func (this *QCborMap) Remove2(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QCborMap_Remove2(this.h, (*C.struct_miqt_string)(key_ms)) } @@ -199,7 +207,7 @@ func (this *QCborMap) Contains(key int64) bool { } func (this *QCborMap) Contains2(key string) bool { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) return (bool)(C.QCborMap_Contains2(this.h, (*C.struct_miqt_string)(key_ms))) } @@ -320,7 +328,7 @@ func (this *QCborMap) Find(key int64) *QCborMap__Iterator { } func (this *QCborMap) Find2(key string) *QCborMap__Iterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_Find2(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborMap__Iterator(_ret) @@ -343,7 +351,7 @@ func (this *QCborMap) ConstFind(key int64) *QCborMap__ConstIterator { } func (this *QCborMap) ConstFind2(key string) *QCborMap__ConstIterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_ConstFind2(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborMap__ConstIterator(_ret) @@ -366,7 +374,7 @@ func (this *QCborMap) Find4(key int64) *QCborMap__ConstIterator { } func (this *QCborMap) Find6(key string) *QCborMap__ConstIterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_Find6(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborMap__ConstIterator(_ret) @@ -389,7 +397,7 @@ func (this *QCborMap) Insert(key int64, value_ *QCborValue) *QCborMap__Iterator } func (this *QCborMap) Insert3(key string, value_ *QCborValue) *QCborMap__Iterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborMap_Insert3(this.h, (*C.struct_miqt_string)(key_ms), value_.cPointer()) _goptr := newQCborMap__Iterator(_ret) @@ -443,6 +451,13 @@ func (this *QCborMap__Iterator) cPointer() *C.QCborMap__Iterator { return this.h } +func (this *QCborMap__Iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborMap__Iterator(h *C.QCborMap__Iterator) *QCborMap__Iterator { if h == nil { return nil @@ -450,7 +465,7 @@ func newQCborMap__Iterator(h *C.QCborMap__Iterator) *QCborMap__Iterator { return &QCborMap__Iterator{h: h} } -func newQCborMap__Iterator_U(h unsafe.Pointer) *QCborMap__Iterator { +func UnsafeNewQCborMap__Iterator(h unsafe.Pointer) *QCborMap__Iterator { return newQCborMap__Iterator((*C.QCborMap__Iterator)(h)) } @@ -471,7 +486,7 @@ func (this *QCborMap__Iterator) OperatorAssign(other *QCborMap__Iterator) { } func (this *QCborMap__Iterator) OperatorMinusGreater() *QCborValueRef { - return newQCborValueRef_U(unsafe.Pointer(C.QCborMap__Iterator_OperatorMinusGreater(this.h))) + return UnsafeNewQCborValueRef(unsafe.Pointer(C.QCborMap__Iterator_OperatorMinusGreater(this.h))) } func (this *QCborMap__Iterator) Key() *QCborValue { @@ -537,7 +552,7 @@ func (this *QCborMap__Iterator) OperatorGreaterOrEqualWithOther(other *QCborMap_ } func (this *QCborMap__Iterator) OperatorPlusPlus() *QCborMap__Iterator { - return newQCborMap__Iterator_U(unsafe.Pointer(C.QCborMap__Iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQCborMap__Iterator(unsafe.Pointer(C.QCborMap__Iterator_OperatorPlusPlus(this.h))) } func (this *QCborMap__Iterator) OperatorPlusPlusWithInt(param1 int) *QCborMap__Iterator { @@ -548,7 +563,7 @@ func (this *QCborMap__Iterator) OperatorPlusPlusWithInt(param1 int) *QCborMap__I } func (this *QCborMap__Iterator) OperatorMinusMinus() *QCborMap__Iterator { - return newQCborMap__Iterator_U(unsafe.Pointer(C.QCborMap__Iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQCborMap__Iterator(unsafe.Pointer(C.QCborMap__Iterator_OperatorMinusMinus(this.h))) } func (this *QCborMap__Iterator) OperatorMinusMinusWithInt(param1 int) *QCborMap__Iterator { @@ -559,11 +574,11 @@ func (this *QCborMap__Iterator) OperatorMinusMinusWithInt(param1 int) *QCborMap_ } func (this *QCborMap__Iterator) OperatorPlusAssign(j int64) *QCborMap__Iterator { - return newQCborMap__Iterator_U(unsafe.Pointer(C.QCborMap__Iterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborMap__Iterator(unsafe.Pointer(C.QCborMap__Iterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborMap__Iterator) OperatorMinusAssign(j int64) *QCborMap__Iterator { - return newQCborMap__Iterator_U(unsafe.Pointer(C.QCborMap__Iterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborMap__Iterator(unsafe.Pointer(C.QCborMap__Iterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborMap__Iterator) OperatorPlus(j int64) *QCborMap__Iterator { @@ -609,6 +624,13 @@ func (this *QCborMap__ConstIterator) cPointer() *C.QCborMap__ConstIterator { return this.h } +func (this *QCborMap__ConstIterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborMap__ConstIterator(h *C.QCborMap__ConstIterator) *QCborMap__ConstIterator { if h == nil { return nil @@ -616,7 +638,7 @@ func newQCborMap__ConstIterator(h *C.QCborMap__ConstIterator) *QCborMap__ConstIt return &QCborMap__ConstIterator{h: h} } -func newQCborMap__ConstIterator_U(h unsafe.Pointer) *QCborMap__ConstIterator { +func UnsafeNewQCborMap__ConstIterator(h unsafe.Pointer) *QCborMap__ConstIterator { return newQCborMap__ConstIterator((*C.QCborMap__ConstIterator)(h)) } @@ -637,7 +659,7 @@ func (this *QCborMap__ConstIterator) OperatorAssign(other *QCborMap__ConstIterat } func (this *QCborMap__ConstIterator) OperatorMinusGreater() *QCborValueRef { - return newQCborValueRef_U(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorMinusGreater(this.h))) + return UnsafeNewQCborValueRef(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorMinusGreater(this.h))) } func (this *QCborMap__ConstIterator) Key() *QCborValue { @@ -703,7 +725,7 @@ func (this *QCborMap__ConstIterator) OperatorGreaterOrEqualWithOther(other *QCbo } func (this *QCborMap__ConstIterator) OperatorPlusPlus() *QCborMap__ConstIterator { - return newQCborMap__ConstIterator_U(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorPlusPlus(this.h))) + return UnsafeNewQCborMap__ConstIterator(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorPlusPlus(this.h))) } func (this *QCborMap__ConstIterator) OperatorPlusPlusWithInt(param1 int) *QCborMap__ConstIterator { @@ -714,7 +736,7 @@ func (this *QCborMap__ConstIterator) OperatorPlusPlusWithInt(param1 int) *QCborM } func (this *QCborMap__ConstIterator) OperatorMinusMinus() *QCborMap__ConstIterator { - return newQCborMap__ConstIterator_U(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorMinusMinus(this.h))) + return UnsafeNewQCborMap__ConstIterator(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorMinusMinus(this.h))) } func (this *QCborMap__ConstIterator) OperatorMinusMinusWithInt(param1 int) *QCborMap__ConstIterator { @@ -725,11 +747,11 @@ func (this *QCborMap__ConstIterator) OperatorMinusMinusWithInt(param1 int) *QCbo } func (this *QCborMap__ConstIterator) OperatorPlusAssign(j int64) *QCborMap__ConstIterator { - return newQCborMap__ConstIterator_U(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborMap__ConstIterator(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorPlusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborMap__ConstIterator) OperatorMinusAssign(j int64) *QCborMap__ConstIterator { - return newQCborMap__ConstIterator_U(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) + return UnsafeNewQCborMap__ConstIterator(unsafe.Pointer(C.QCborMap__ConstIterator_OperatorMinusAssign(this.h, (C.ptrdiff_t)(j)))) } func (this *QCborMap__ConstIterator) OperatorPlus(j int64) *QCborMap__ConstIterator { diff --git a/qt/gen_qcbormap.h b/qt/gen_qcbormap.h index c990cf66..3037ae02 100644 --- a/qt/gen_qcbormap.h +++ b/qt/gen_qcbormap.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcborstreamreader.cpp b/qt/gen_qcborstreamreader.cpp index 64bafac3..9a1bc277 100644 --- a/qt/gen_qcborstreamreader.cpp +++ b/qt/gen_qcborstreamreader.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qcborstreamreader.h" +#include #include "gen_qcborstreamreader.h" #include "_cgo_export.h" diff --git a/qt/gen_qcborstreamreader.go b/qt/gen_qcborstreamreader.go index 8d8b983d..1db7a1a8 100644 --- a/qt/gen_qcborstreamreader.go +++ b/qt/gen_qcborstreamreader.go @@ -52,6 +52,13 @@ func (this *QCborStreamReader) cPointer() *C.QCborStreamReader { return this.h } +func (this *QCborStreamReader) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborStreamReader(h *C.QCborStreamReader) *QCborStreamReader { if h == nil { return nil @@ -59,7 +66,7 @@ func newQCborStreamReader(h *C.QCborStreamReader) *QCborStreamReader { return &QCborStreamReader{h: h} } -func newQCborStreamReader_U(h unsafe.Pointer) *QCborStreamReader { +func UnsafeNewQCborStreamReader(h unsafe.Pointer) *QCborStreamReader { return newQCborStreamReader((*C.QCborStreamReader)(h)) } @@ -100,7 +107,7 @@ func (this *QCborStreamReader) SetDevice(device *QIODevice) { } func (this *QCborStreamReader) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QCborStreamReader_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QCborStreamReader_Device(this.h))) } func (this *QCborStreamReader) AddData(data *QByteArray) { diff --git a/qt/gen_qcborstreamreader.h b/qt/gen_qcborstreamreader.h index 566ead4c..9c2ff37c 100644 --- a/qt/gen_qcborstreamreader.h +++ b/qt/gen_qcborstreamreader.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcborstreamwriter.cpp b/qt/gen_qcborstreamwriter.cpp index 50b36f6f..b7bf6aea 100644 --- a/qt/gen_qcborstreamwriter.cpp +++ b/qt/gen_qcborstreamwriter.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qcborstreamwriter.h" +#include #include "gen_qcborstreamwriter.h" #include "_cgo_export.h" diff --git a/qt/gen_qcborstreamwriter.go b/qt/gen_qcborstreamwriter.go index b96c68b8..43a0b22a 100644 --- a/qt/gen_qcborstreamwriter.go +++ b/qt/gen_qcborstreamwriter.go @@ -24,6 +24,13 @@ func (this *QCborStreamWriter) cPointer() *C.QCborStreamWriter { return this.h } +func (this *QCborStreamWriter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborStreamWriter(h *C.QCborStreamWriter) *QCborStreamWriter { if h == nil { return nil @@ -31,7 +38,7 @@ func newQCborStreamWriter(h *C.QCborStreamWriter) *QCborStreamWriter { return &QCborStreamWriter{h: h} } -func newQCborStreamWriter_U(h unsafe.Pointer) *QCborStreamWriter { +func UnsafeNewQCborStreamWriter(h unsafe.Pointer) *QCborStreamWriter { return newQCborStreamWriter((*C.QCborStreamWriter)(h)) } @@ -52,7 +59,7 @@ func (this *QCborStreamWriter) SetDevice(device *QIODevice) { } func (this *QCborStreamWriter) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QCborStreamWriter_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QCborStreamWriter_Device(this.h))) } func (this *QCborStreamWriter) Append(u uint64) { diff --git a/qt/gen_qcborstreamwriter.h b/qt/gen_qcborstreamwriter.h index 1857f418..5cc1fcfb 100644 --- a/qt/gen_qcborstreamwriter.h +++ b/qt/gen_qcborstreamwriter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcborvalue.cpp b/qt/gen_qcborvalue.cpp index 62eee0cf..1d752cd4 100644 --- a/qt/gen_qcborvalue.cpp +++ b/qt/gen_qcborvalue.cpp @@ -15,7 +15,7 @@ #include #include #include -#include "qcborvalue.h" +#include #include "gen_qcborvalue.h" #include "_cgo_export.h" diff --git a/qt/gen_qcborvalue.go b/qt/gen_qcborvalue.go index 03d8b935..48b70039 100644 --- a/qt/gen_qcborvalue.go +++ b/qt/gen_qcborvalue.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -64,6 +65,13 @@ func (this *QCborParserError) cPointer() *C.QCborParserError { return this.h } +func (this *QCborParserError) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborParserError(h *C.QCborParserError) *QCborParserError { if h == nil { return nil @@ -71,7 +79,7 @@ func newQCborParserError(h *C.QCborParserError) *QCborParserError { return &QCborParserError{h: h} } -func newQCborParserError_U(h unsafe.Pointer) *QCborParserError { +func UnsafeNewQCborParserError(h unsafe.Pointer) *QCborParserError { return newQCborParserError((*C.QCborParserError)(h)) } @@ -107,6 +115,13 @@ func (this *QCborValue) cPointer() *C.QCborValue { return this.h } +func (this *QCborValue) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborValue(h *C.QCborValue) *QCborValue { if h == nil { return nil @@ -114,7 +129,7 @@ func newQCborValue(h *C.QCborValue) *QCborValue { return &QCborValue{h: h} } -func newQCborValue_U(h unsafe.Pointer) *QCborValue { +func UnsafeNewQCborValue(h unsafe.Pointer) *QCborValue { return newQCborValue((*C.QCborValue)(h)) } @@ -174,7 +189,7 @@ func NewQCborValue9(ba *QByteArray) *QCborValue { // NewQCborValue10 constructs a new QCborValue object. func NewQCborValue10(s string) *QCborValue { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) ret := C.QCborValue_new10((*C.struct_miqt_string)(s_ms)) return newQCborValue(ret) @@ -444,7 +459,7 @@ func (this *QCborValue) ToMapWithDefaultValue(defaultValue *QCborMap) *QCborMap } func (this *QCborValue) OperatorSubscript(key string) *QCborValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborValue_OperatorSubscript(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValue(_ret) @@ -467,7 +482,7 @@ func (this *QCborValue) OperatorSubscript3(key int64) *QCborValueRef { } func (this *QCborValue) OperatorSubscript5(key string) *QCborValueRef { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborValue_OperatorSubscript5(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValueRef(_ret) @@ -602,7 +617,7 @@ func (this *QCborValue) ToByteArray1(defaultValue *QByteArray) *QByteArray { } func (this *QCborValue) ToString1(defaultValue string) string { - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) var _ms *C.struct_miqt_string = C.QCborValue_ToString1(this.h, (*C.struct_miqt_string)(defaultValue_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -704,6 +719,13 @@ func (this *QCborValueRef) cPointer() *C.QCborValueRef { return this.h } +func (this *QCborValueRef) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCborValueRef(h *C.QCborValueRef) *QCborValueRef { if h == nil { return nil @@ -711,7 +733,7 @@ func newQCborValueRef(h *C.QCborValueRef) *QCborValueRef { return &QCborValueRef{h: h} } -func newQCborValueRef_U(h unsafe.Pointer) *QCborValueRef { +func UnsafeNewQCborValueRef(h unsafe.Pointer) *QCborValueRef { return newQCborValueRef((*C.QCborValueRef)(h)) } @@ -907,7 +929,7 @@ func (this *QCborValueRef) ToMapWithQCborMap(m *QCborMap) *QCborMap { } func (this *QCborValueRef) OperatorSubscript(key string) *QCborValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborValueRef_OperatorSubscript(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValue(_ret) @@ -930,7 +952,7 @@ func (this *QCborValueRef) OperatorSubscript3(key int64) *QCborValueRef { } func (this *QCborValueRef) OperatorSubscript5(key string) *QCborValueRef { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QCborValueRef_OperatorSubscript5(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQCborValueRef(_ret) @@ -1017,7 +1039,7 @@ func (this *QCborValueRef) ToByteArray1(defaultValue *QByteArray) *QByteArray { } func (this *QCborValueRef) ToString1(defaultValue string) string { - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) var _ms *C.struct_miqt_string = C.QCborValueRef_ToString1(this.h, (*C.struct_miqt_string)(defaultValue_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qcborvalue.h b/qt/gen_qcborvalue.h index 411f763b..e8ddebe5 100644 --- a/qt/gen_qcborvalue.h +++ b/qt/gen_qcborvalue.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qchar.cpp b/qt/gen_qchar.cpp index d41f5597..c9178487 100644 --- a/qt/gen_qchar.cpp +++ b/qt/gen_qchar.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qchar.h" +#include #include "gen_qchar.h" #include "_cgo_export.h" diff --git a/qt/gen_qchar.go b/qt/gen_qchar.go index 859821ad..211f459c 100644 --- a/qt/gen_qchar.go +++ b/qt/gen_qchar.go @@ -366,6 +366,13 @@ func (this *QLatin1Char) cPointer() *C.QLatin1Char { return this.h } +func (this *QLatin1Char) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLatin1Char(h *C.QLatin1Char) *QLatin1Char { if h == nil { return nil @@ -373,7 +380,7 @@ func newQLatin1Char(h *C.QLatin1Char) *QLatin1Char { return &QLatin1Char{h: h} } -func newQLatin1Char_U(h unsafe.Pointer) *QLatin1Char { +func UnsafeNewQLatin1Char(h unsafe.Pointer) *QLatin1Char { return newQLatin1Char((*C.QLatin1Char)(h)) } @@ -422,6 +429,13 @@ func (this *QChar) cPointer() *C.QChar { return this.h } +func (this *QChar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQChar(h *C.QChar) *QChar { if h == nil { return nil @@ -429,7 +443,7 @@ func newQChar(h *C.QChar) *QChar { return &QChar{h: h} } -func newQChar_U(h unsafe.Pointer) *QChar { +func UnsafeNewQChar(h unsafe.Pointer) *QChar { return newQChar((*C.QChar)(h)) } diff --git a/qt/gen_qchar.h b/qt/gen_qchar.h index f4610f2e..ad2f5c31 100644 --- a/qt/gen_qchar.h +++ b/qt/gen_qchar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcheckbox.cpp b/qt/gen_qcheckbox.cpp index 34a80222..f91acfa7 100644 --- a/qt/gen_qcheckbox.cpp +++ b/qt/gen_qcheckbox.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qcheckbox.h" +#include #include "gen_qcheckbox.h" #include "_cgo_export.h" diff --git a/qt/gen_qcheckbox.go b/qt/gen_qcheckbox.go index 5c82e71b..1a2d1647 100644 --- a/qt/gen_qcheckbox.go +++ b/qt/gen_qcheckbox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QCheckBox) cPointer() *C.QCheckBox { return this.h } +func (this *QCheckBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCheckBox(h *C.QCheckBox) *QCheckBox { if h == nil { return nil } - return &QCheckBox{h: h, QAbstractButton: newQAbstractButton_U(unsafe.Pointer(h))} + return &QCheckBox{h: h, QAbstractButton: UnsafeNewQAbstractButton(unsafe.Pointer(h))} } -func newQCheckBox_U(h unsafe.Pointer) *QCheckBox { +func UnsafeNewQCheckBox(h unsafe.Pointer) *QCheckBox { return newQCheckBox((*C.QCheckBox)(h)) } @@ -45,7 +53,7 @@ func NewQCheckBox() *QCheckBox { // NewQCheckBox2 constructs a new QCheckBox object. func NewQCheckBox2(text string) *QCheckBox { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QCheckBox_new2((*C.struct_miqt_string)(text_ms)) return newQCheckBox(ret) @@ -59,14 +67,14 @@ func NewQCheckBox3(parent *QWidget) *QCheckBox { // NewQCheckBox4 constructs a new QCheckBox object. func NewQCheckBox4(text string, parent *QWidget) *QCheckBox { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QCheckBox_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQCheckBox(ret) } func (this *QCheckBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QCheckBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QCheckBox_MetaObject(this.h))) } func (this *QCheckBox) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qcheckbox.h b/qt/gen_qcheckbox.h index 364ba7e1..336747dd 100644 --- a/qt/gen_qcheckbox.h +++ b/qt/gen_qcheckbox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qclipboard.cpp b/qt/gen_qclipboard.cpp index 6e1b3fe7..fb8e843e 100644 --- a/qt/gen_qclipboard.cpp +++ b/qt/gen_qclipboard.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qclipboard.h" +#include #include "gen_qclipboard.h" #include "_cgo_export.h" diff --git a/qt/gen_qclipboard.go b/qt/gen_qclipboard.go index 593af5c9..5fb33954 100644 --- a/qt/gen_qclipboard.go +++ b/qt/gen_qclipboard.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime/cgo" "unsafe" ) @@ -34,19 +35,26 @@ func (this *QClipboard) cPointer() *C.QClipboard { return this.h } +func (this *QClipboard) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQClipboard(h *C.QClipboard) *QClipboard { if h == nil { return nil } - return &QClipboard{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QClipboard{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQClipboard_U(h unsafe.Pointer) *QClipboard { +func UnsafeNewQClipboard(h unsafe.Pointer) *QClipboard { return newQClipboard((*C.QClipboard)(h)) } func (this *QClipboard) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QClipboard_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QClipboard_MetaObject(this.h))) } func (this *QClipboard) Metacast(param1 string) unsafe.Pointer { @@ -105,7 +113,7 @@ func (this *QClipboard) Text() string { } func (this *QClipboard) TextWithSubtype(subtype string) string { - subtype_ms := miqt_strdupg(subtype) + subtype_ms := libmiqt.Strdupg(subtype) defer C.free(subtype_ms) var _ms *C.struct_miqt_string = C.QClipboard_TextWithSubtype(this.h, (*C.struct_miqt_string)(subtype_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -114,13 +122,13 @@ func (this *QClipboard) TextWithSubtype(subtype string) string { } func (this *QClipboard) SetText(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QClipboard_SetText(this.h, (*C.struct_miqt_string)(param1_ms)) } func (this *QClipboard) MimeData() *QMimeData { - return newQMimeData_U(unsafe.Pointer(C.QClipboard_MimeData(this.h))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QClipboard_MimeData(this.h))) } func (this *QClipboard) SetMimeData(data *QMimeData) { @@ -276,7 +284,7 @@ func (this *QClipboard) Text1(mode QClipboard__Mode) string { } func (this *QClipboard) Text2(subtype string, mode QClipboard__Mode) string { - subtype_ms := miqt_strdupg(subtype) + subtype_ms := libmiqt.Strdupg(subtype) defer C.free(subtype_ms) var _ms *C.struct_miqt_string = C.QClipboard_Text2(this.h, (*C.struct_miqt_string)(subtype_ms), (C.int)(mode)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -285,13 +293,13 @@ func (this *QClipboard) Text2(subtype string, mode QClipboard__Mode) string { } func (this *QClipboard) SetText2(param1 string, mode QClipboard__Mode) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QClipboard_SetText2(this.h, (*C.struct_miqt_string)(param1_ms), (C.int)(mode)) } func (this *QClipboard) MimeData1(mode QClipboard__Mode) *QMimeData { - return newQMimeData_U(unsafe.Pointer(C.QClipboard_MimeData1(this.h, (C.int)(mode)))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QClipboard_MimeData1(this.h, (C.int)(mode)))) } func (this *QClipboard) SetMimeData2(data *QMimeData, mode QClipboard__Mode) { diff --git a/qt/gen_qclipboard.h b/qt/gen_qclipboard.h index d67da545..2851fed9 100644 --- a/qt/gen_qclipboard.h +++ b/qt/gen_qclipboard.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcollator.cpp b/qt/gen_qcollator.cpp index eafb4ccb..d2d9df16 100644 --- a/qt/gen_qcollator.cpp +++ b/qt/gen_qcollator.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qcollator.h" +#include #include "gen_qcollator.h" #include "_cgo_export.h" diff --git a/qt/gen_qcollator.go b/qt/gen_qcollator.go index d481a8ae..f2cd05cf 100644 --- a/qt/gen_qcollator.go +++ b/qt/gen_qcollator.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QCollatorSortKey) cPointer() *C.QCollatorSortKey { return this.h } +func (this *QCollatorSortKey) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCollatorSortKey(h *C.QCollatorSortKey) *QCollatorSortKey { if h == nil { return nil @@ -31,7 +39,7 @@ func newQCollatorSortKey(h *C.QCollatorSortKey) *QCollatorSortKey { return &QCollatorSortKey{h: h} } -func newQCollatorSortKey_U(h unsafe.Pointer) *QCollatorSortKey { +func UnsafeNewQCollatorSortKey(h unsafe.Pointer) *QCollatorSortKey { return newQCollatorSortKey((*C.QCollatorSortKey)(h)) } @@ -78,6 +86,13 @@ func (this *QCollator) cPointer() *C.QCollator { return this.h } +func (this *QCollator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCollator(h *C.QCollator) *QCollator { if h == nil { return nil @@ -85,7 +100,7 @@ func newQCollator(h *C.QCollator) *QCollator { return &QCollator{h: h} } -func newQCollator_U(h unsafe.Pointer) *QCollator { +func UnsafeNewQCollator(h unsafe.Pointer) *QCollator { return newQCollator((*C.QCollator)(h)) } @@ -151,9 +166,9 @@ func (this *QCollator) IgnorePunctuation() bool { } func (this *QCollator) Compare(s1 string, s2 string) int { - s1_ms := miqt_strdupg(s1) + s1_ms := libmiqt.Strdupg(s1) defer C.free(s1_ms) - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (int)(C.QCollator_Compare(this.h, (*C.struct_miqt_string)(s1_ms), (*C.struct_miqt_string)(s2_ms))) } @@ -163,15 +178,15 @@ func (this *QCollator) Compare3(s1 *QChar, len1 int, s2 *QChar, len2 int) int { } func (this *QCollator) OperatorCall(s1 string, s2 string) bool { - s1_ms := miqt_strdupg(s1) + s1_ms := libmiqt.Strdupg(s1) defer C.free(s1_ms) - s2_ms := miqt_strdupg(s2) + s2_ms := libmiqt.Strdupg(s2) defer C.free(s2_ms) return (bool)(C.QCollator_OperatorCall(this.h, (*C.struct_miqt_string)(s1_ms), (*C.struct_miqt_string)(s2_ms))) } func (this *QCollator) SortKey(stringVal string) *QCollatorSortKey { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QCollator_SortKey(this.h, (*C.struct_miqt_string)(stringVal_ms)) _goptr := newQCollatorSortKey(_ret) diff --git a/qt/gen_qcollator.h b/qt/gen_qcollator.h index 28a7468d..480f4f72 100644 --- a/qt/gen_qcollator.h +++ b/qt/gen_qcollator.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcolor.cpp b/qt/gen_qcolor.cpp index f28e1310..44578a92 100644 --- a/qt/gen_qcolor.cpp +++ b/qt/gen_qcolor.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qcolor.h" +#include #include "gen_qcolor.h" #include "_cgo_export.h" diff --git a/qt/gen_qcolor.go b/qt/gen_qcolor.go index 42b0f910..80c18d6f 100644 --- a/qt/gen_qcolor.go +++ b/qt/gen_qcolor.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -42,6 +43,13 @@ func (this *QColor) cPointer() *C.QColor { return this.h } +func (this *QColor) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQColor(h *C.QColor) *QColor { if h == nil { return nil @@ -49,7 +57,7 @@ func newQColor(h *C.QColor) *QColor { return &QColor{h: h} } -func newQColor_U(h unsafe.Pointer) *QColor { +func UnsafeNewQColor(h unsafe.Pointer) *QColor { return newQColor((*C.QColor)(h)) } @@ -85,7 +93,7 @@ func NewQColor5(rgba64 QRgba64) *QColor { // NewQColor6 constructs a new QColor object. func NewQColor6(name string) *QColor { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QColor_new6((*C.struct_miqt_string)(name_ms)) return newQColor(ret) @@ -156,7 +164,7 @@ func (this *QColor) NameWithFormat(format QColor__NameFormat) string { } func (this *QColor) SetNamedColor(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QColor_SetNamedColor(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -601,7 +609,7 @@ func (this *QColor) OperatorNotEqual(c *QColor) bool { } func QColor_IsValidColor(name string) bool { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (bool)(C.QColor_IsValidColor((*C.struct_miqt_string)(name_ms))) } diff --git a/qt/gen_qcolor.h b/qt/gen_qcolor.h index de31e594..5d76c747 100644 --- a/qt/gen_qcolor.h +++ b/qt/gen_qcolor.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcolordialog.cpp b/qt/gen_qcolordialog.cpp index 124ae5a0..299975ab 100644 --- a/qt/gen_qcolordialog.cpp +++ b/qt/gen_qcolordialog.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qcolordialog.h" +#include #include "gen_qcolordialog.h" #include "_cgo_export.h" diff --git a/qt/gen_qcolordialog.go b/qt/gen_qcolordialog.go index 575d9e95..afbc615f 100644 --- a/qt/gen_qcolordialog.go +++ b/qt/gen_qcolordialog.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -34,14 +35,21 @@ func (this *QColorDialog) cPointer() *C.QColorDialog { return this.h } +func (this *QColorDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQColorDialog(h *C.QColorDialog) *QColorDialog { if h == nil { return nil } - return &QColorDialog{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QColorDialog{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQColorDialog_U(h unsafe.Pointer) *QColorDialog { +func UnsafeNewQColorDialog(h unsafe.Pointer) *QColorDialog { return newQColorDialog((*C.QColorDialog)(h)) } @@ -70,7 +78,7 @@ func NewQColorDialog4(initial *QColor, parent *QWidget) *QColorDialog { } func (this *QColorDialog) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QColorDialog_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QColorDialog_MetaObject(this.h))) } func (this *QColorDialog) Metacast(param1 string) unsafe.Pointer { @@ -187,7 +195,7 @@ func miqt_exec_callback_QColorDialog_CurrentColorChanged(cb C.intptr_t, color *C } // Convert all CABI parameters to Go parameters - slotval1 := newQColor_U(unsafe.Pointer(color)) + slotval1 := UnsafeNewQColor(unsafe.Pointer(color)) gofunc(slotval1) } @@ -207,7 +215,7 @@ func miqt_exec_callback_QColorDialog_ColorSelected(cb C.intptr_t, color *C.QColo } // Convert all CABI parameters to Go parameters - slotval1 := newQColor_U(unsafe.Pointer(color)) + slotval1 := UnsafeNewQColor(unsafe.Pointer(color)) gofunc(slotval1) } @@ -275,7 +283,7 @@ func QColorDialog_GetColor2(initial *QColor, parent *QWidget) *QColor { } func QColorDialog_GetColor3(initial *QColor, parent *QWidget, title string) *QColor { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) _ret := C.QColorDialog_GetColor3(initial.cPointer(), parent.cPointer(), (*C.struct_miqt_string)(title_ms)) _goptr := newQColor(_ret) @@ -284,7 +292,7 @@ func QColorDialog_GetColor3(initial *QColor, parent *QWidget, title string) *QCo } func QColorDialog_GetColor4(initial *QColor, parent *QWidget, title string, options QColorDialog__ColorDialogOption) *QColor { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) _ret := C.QColorDialog_GetColor4(initial.cPointer(), parent.cPointer(), (*C.struct_miqt_string)(title_ms), (C.int)(options)) _goptr := newQColor(_ret) diff --git a/qt/gen_qcolordialog.h b/qt/gen_qcolordialog.h index 69020364..7d9c2028 100644 --- a/qt/gen_qcolordialog.h +++ b/qt/gen_qcolordialog.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcolormap.cpp b/qt/gen_qcolormap.cpp index 539fa962..ba436556 100644 --- a/qt/gen_qcolormap.cpp +++ b/qt/gen_qcolormap.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qcolormap.h" +#include #include "gen_qcolormap.h" #include "_cgo_export.h" diff --git a/qt/gen_qcolormap.go b/qt/gen_qcolormap.go index 1b9b38a7..ee62f7eb 100644 --- a/qt/gen_qcolormap.go +++ b/qt/gen_qcolormap.go @@ -32,6 +32,13 @@ func (this *QColormap) cPointer() *C.QColormap { return this.h } +func (this *QColormap) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQColormap(h *C.QColormap) *QColormap { if h == nil { return nil @@ -39,7 +46,7 @@ func newQColormap(h *C.QColormap) *QColormap { return &QColormap{h: h} } -func newQColormap_U(h unsafe.Pointer) *QColormap { +func UnsafeNewQColormap(h unsafe.Pointer) *QColormap { return newQColormap((*C.QColormap)(h)) } diff --git a/qt/gen_qcolormap.h b/qt/gen_qcolormap.h index bf5ddba6..f04e5257 100644 --- a/qt/gen_qcolormap.h +++ b/qt/gen_qcolormap.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcolorspace.cpp b/qt/gen_qcolorspace.cpp index d0c0dda3..899bb015 100644 --- a/qt/gen_qcolorspace.cpp +++ b/qt/gen_qcolorspace.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qcolorspace.h" +#include #include "gen_qcolorspace.h" #include "_cgo_export.h" diff --git a/qt/gen_qcolorspace.go b/qt/gen_qcolorspace.go index 6bf3482e..39f873a1 100644 --- a/qt/gen_qcolorspace.go +++ b/qt/gen_qcolorspace.go @@ -54,6 +54,13 @@ func (this *QColorSpace) cPointer() *C.QColorSpace { return this.h } +func (this *QColorSpace) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQColorSpace(h *C.QColorSpace) *QColorSpace { if h == nil { return nil @@ -61,7 +68,7 @@ func newQColorSpace(h *C.QColorSpace) *QColorSpace { return &QColorSpace{h: h} } -func newQColorSpace_U(h unsafe.Pointer) *QColorSpace { +func UnsafeNewQColorSpace(h unsafe.Pointer) *QColorSpace { return newQColorSpace((*C.QColorSpace)(h)) } diff --git a/qt/gen_qcolorspace.h b/qt/gen_qcolorspace.h index ab556954..80dd4155 100644 --- a/qt/gen_qcolorspace.h +++ b/qt/gen_qcolorspace.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcolortransform.cpp b/qt/gen_qcolortransform.cpp index df6802cd..c05a8f3b 100644 --- a/qt/gen_qcolortransform.cpp +++ b/qt/gen_qcolortransform.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qcolortransform.h" +#include #include "gen_qcolortransform.h" #include "_cgo_export.h" diff --git a/qt/gen_qcolortransform.go b/qt/gen_qcolortransform.go index a3d8fad6..f85ffdb6 100644 --- a/qt/gen_qcolortransform.go +++ b/qt/gen_qcolortransform.go @@ -24,6 +24,13 @@ func (this *QColorTransform) cPointer() *C.QColorTransform { return this.h } +func (this *QColorTransform) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQColorTransform(h *C.QColorTransform) *QColorTransform { if h == nil { return nil @@ -31,7 +38,7 @@ func newQColorTransform(h *C.QColorTransform) *QColorTransform { return &QColorTransform{h: h} } -func newQColorTransform_U(h unsafe.Pointer) *QColorTransform { +func UnsafeNewQColorTransform(h unsafe.Pointer) *QColorTransform { return newQColorTransform((*C.QColorTransform)(h)) } diff --git a/qt/gen_qcolortransform.h b/qt/gen_qcolortransform.h index 2799918c..2a3446f9 100644 --- a/qt/gen_qcolortransform.h +++ b/qt/gen_qcolortransform.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcolumnview.cpp b/qt/gen_qcolumnview.cpp index 698b295f..5378e832 100644 --- a/qt/gen_qcolumnview.cpp +++ b/qt/gen_qcolumnview.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qcolumnview.h" +#include #include "gen_qcolumnview.h" #include "_cgo_export.h" diff --git a/qt/gen_qcolumnview.go b/qt/gen_qcolumnview.go index c3cfd257..7fe307a4 100644 --- a/qt/gen_qcolumnview.go +++ b/qt/gen_qcolumnview.go @@ -26,14 +26,21 @@ func (this *QColumnView) cPointer() *C.QColumnView { return this.h } +func (this *QColumnView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQColumnView(h *C.QColumnView) *QColumnView { if h == nil { return nil } - return &QColumnView{h: h, QAbstractItemView: newQAbstractItemView_U(unsafe.Pointer(h))} + return &QColumnView{h: h, QAbstractItemView: UnsafeNewQAbstractItemView(unsafe.Pointer(h))} } -func newQColumnView_U(h unsafe.Pointer) *QColumnView { +func UnsafeNewQColumnView(h unsafe.Pointer) *QColumnView { return newQColumnView((*C.QColumnView)(h)) } @@ -50,7 +57,7 @@ func NewQColumnView2(parent *QWidget) *QColumnView { } func (this *QColumnView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QColumnView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QColumnView_MetaObject(this.h))) } func (this *QColumnView) Metacast(param1 string) unsafe.Pointer { @@ -92,7 +99,7 @@ func miqt_exec_callback_QColumnView_UpdatePreviewWidget(cb C.intptr_t, index *C. } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } @@ -147,7 +154,7 @@ func (this *QColumnView) ResizeGripsVisible() bool { } func (this *QColumnView) PreviewWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QColumnView_PreviewWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QColumnView_PreviewWidget(this.h))) } func (this *QColumnView) SetPreviewWidget(widget *QWidget) { diff --git a/qt/gen_qcolumnview.h b/qt/gen_qcolumnview.h index 4473eba8..8ae55a17 100644 --- a/qt/gen_qcolumnview.h +++ b/qt/gen_qcolumnview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcombobox.cpp b/qt/gen_qcombobox.cpp index e925ea2d..f445a7c9 100644 --- a/qt/gen_qcombobox.cpp +++ b/qt/gen_qcombobox.cpp @@ -16,7 +16,7 @@ #include #include #include -#include "qcombobox.h" +#include #include "gen_qcombobox.h" #include "_cgo_export.h" @@ -263,7 +263,7 @@ void QComboBox_AddItem2(QComboBox* self, QIcon* icon, struct miqt_string* text) } void QComboBox_AddItems(QComboBox* self, struct miqt_array* /* of struct miqt_string* */ texts) { - QList texts_QList; + QStringList texts_QList; texts_QList.reserve(texts->len); struct miqt_string** texts_arr = static_cast(texts->data); for(size_t i = 0; i < texts->len; ++i) { @@ -284,7 +284,7 @@ void QComboBox_InsertItem2(QComboBox* self, int index, QIcon* icon, struct miqt_ } void QComboBox_InsertItems(QComboBox* self, int index, struct miqt_array* /* of struct miqt_string* */ texts) { - QList texts_QList; + QStringList texts_QList; texts_QList.reserve(texts->len); struct miqt_string** texts_arr = static_cast(texts->data); for(size_t i = 0; i < texts->len; ++i) { diff --git a/qt/gen_qcombobox.go b/qt/gen_qcombobox.go index 776f3e52..1d851b60 100644 --- a/qt/gen_qcombobox.go +++ b/qt/gen_qcombobox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -47,14 +48,21 @@ func (this *QComboBox) cPointer() *C.QComboBox { return this.h } +func (this *QComboBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQComboBox(h *C.QComboBox) *QComboBox { if h == nil { return nil } - return &QComboBox{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QComboBox{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQComboBox_U(h unsafe.Pointer) *QComboBox { +func UnsafeNewQComboBox(h unsafe.Pointer) *QComboBox { return newQComboBox((*C.QComboBox)(h)) } @@ -71,7 +79,7 @@ func NewQComboBox2(parent *QWidget) *QComboBox { } func (this *QComboBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QComboBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QComboBox_MetaObject(this.h))) } func (this *QComboBox) Metacast(param1 string) unsafe.Pointer { @@ -151,7 +159,7 @@ func (this *QComboBox) HasFrame() bool { } func (this *QComboBox) FindText(text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QComboBox_FindText(this.h, (*C.struct_miqt_string)(text_ms))) } @@ -196,7 +204,7 @@ func (this *QComboBox) SetIconSize(size *QSize) { } func (this *QComboBox) SetPlaceholderText(placeholderText string) { - placeholderText_ms := miqt_strdupg(placeholderText) + placeholderText_ms := libmiqt.Strdupg(placeholderText) defer C.free(placeholderText_ms) C.QComboBox_SetPlaceholderText(this.h, (*C.struct_miqt_string)(placeholderText_ms)) } @@ -221,7 +229,7 @@ func (this *QComboBox) SetLineEdit(edit *QLineEdit) { } func (this *QComboBox) LineEdit() *QLineEdit { - return newQLineEdit_U(unsafe.Pointer(C.QComboBox_LineEdit(this.h))) + return UnsafeNewQLineEdit(unsafe.Pointer(C.QComboBox_LineEdit(this.h))) } func (this *QComboBox) SetValidator(v *QValidator) { @@ -229,7 +237,7 @@ func (this *QComboBox) SetValidator(v *QValidator) { } func (this *QComboBox) Validator() *QValidator { - return newQValidator_U(unsafe.Pointer(C.QComboBox_Validator(this.h))) + return UnsafeNewQValidator(unsafe.Pointer(C.QComboBox_Validator(this.h))) } func (this *QComboBox) SetCompleter(c *QCompleter) { @@ -237,11 +245,11 @@ func (this *QComboBox) SetCompleter(c *QCompleter) { } func (this *QComboBox) Completer() *QCompleter { - return newQCompleter_U(unsafe.Pointer(C.QComboBox_Completer(this.h))) + return UnsafeNewQCompleter(unsafe.Pointer(C.QComboBox_Completer(this.h))) } func (this *QComboBox) ItemDelegate() *QAbstractItemDelegate { - return newQAbstractItemDelegate_U(unsafe.Pointer(C.QComboBox_ItemDelegate(this.h))) + return UnsafeNewQAbstractItemDelegate(unsafe.Pointer(C.QComboBox_ItemDelegate(this.h))) } func (this *QComboBox) SetItemDelegate(delegate *QAbstractItemDelegate) { @@ -249,7 +257,7 @@ func (this *QComboBox) SetItemDelegate(delegate *QAbstractItemDelegate) { } func (this *QComboBox) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QComboBox_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QComboBox_Model(this.h))) } func (this *QComboBox) SetModel(model *QAbstractItemModel) { @@ -315,13 +323,13 @@ func (this *QComboBox) ItemData(index int) *QVariant { } func (this *QComboBox) AddItem(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_AddItem(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QComboBox) AddItem2(icon *QIcon, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_AddItem2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)) } @@ -331,7 +339,7 @@ func (this *QComboBox) AddItems(texts []string) { texts_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(texts)))) defer C.free(unsafe.Pointer(texts_CArray)) for i := range texts { - texts_i_ms := miqt_strdupg(texts[i]) + texts_i_ms := libmiqt.Strdupg(texts[i]) defer C.free(texts_i_ms) texts_CArray[i] = (*C.struct_miqt_string)(texts_i_ms) } @@ -341,13 +349,13 @@ func (this *QComboBox) AddItems(texts []string) { } func (this *QComboBox) InsertItem(index int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_InsertItem(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms)) } func (this *QComboBox) InsertItem2(index int, icon *QIcon, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_InsertItem2(this.h, (C.int)(index), icon.cPointer(), (*C.struct_miqt_string)(text_ms)) } @@ -357,7 +365,7 @@ func (this *QComboBox) InsertItems(index int, texts []string) { texts_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(texts)))) defer C.free(unsafe.Pointer(texts_CArray)) for i := range texts { - texts_i_ms := miqt_strdupg(texts[i]) + texts_i_ms := libmiqt.Strdupg(texts[i]) defer C.free(texts_i_ms) texts_CArray[i] = (*C.struct_miqt_string)(texts_i_ms) } @@ -375,7 +383,7 @@ func (this *QComboBox) RemoveItem(index int) { } func (this *QComboBox) SetItemText(index int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_SetItemText(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms)) } @@ -389,7 +397,7 @@ func (this *QComboBox) SetItemData(index int, value *QVariant) { } func (this *QComboBox) View() *QAbstractItemView { - return newQAbstractItemView_U(unsafe.Pointer(C.QComboBox_View(this.h))) + return UnsafeNewQAbstractItemView(unsafe.Pointer(C.QComboBox_View(this.h))) } func (this *QComboBox) SetView(itemView *QAbstractItemView) { @@ -445,7 +453,7 @@ func (this *QComboBox) ClearEditText() { } func (this *QComboBox) SetEditText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_SetEditText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -455,13 +463,13 @@ func (this *QComboBox) SetCurrentIndex(index int) { } func (this *QComboBox) SetCurrentText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_SetCurrentText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QComboBox) EditTextChanged(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QComboBox_EditTextChanged(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -506,7 +514,7 @@ func miqt_exec_callback_QComboBox_Activated(cb C.intptr_t, index C.int) { } func (this *QComboBox) TextActivated(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QComboBox_TextActivated(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -551,7 +559,7 @@ func miqt_exec_callback_QComboBox_Highlighted(cb C.intptr_t, index C.int) { } func (this *QComboBox) TextHighlighted(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QComboBox_TextHighlighted(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -596,7 +604,7 @@ func miqt_exec_callback_QComboBox_CurrentIndexChanged(cb C.intptr_t, index C.int } func (this *QComboBox) CurrentIndexChangedWithQString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QComboBox_CurrentIndexChangedWithQString(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -621,7 +629,7 @@ func miqt_exec_callback_QComboBox_CurrentIndexChangedWithQString(cb C.intptr_t, } func (this *QComboBox) CurrentTextChanged(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QComboBox_CurrentTextChanged(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -646,7 +654,7 @@ func miqt_exec_callback_QComboBox_CurrentTextChanged(cb C.intptr_t, param1 *C.st } func (this *QComboBox) ActivatedWithQString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QComboBox_ActivatedWithQString(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -671,7 +679,7 @@ func miqt_exec_callback_QComboBox_ActivatedWithQString(cb C.intptr_t, param1 *C. } func (this *QComboBox) HighlightedWithQString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QComboBox_HighlightedWithQString(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -740,7 +748,7 @@ func QComboBox_TrUtf83(s string, c string, n int) string { } func (this *QComboBox) FindText2(text string, flags MatchFlag) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QComboBox_FindText2(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(flags))) } @@ -768,25 +776,25 @@ func (this *QComboBox) ItemData2(index int, role int) *QVariant { } func (this *QComboBox) AddItem22(text string, userData *QVariant) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_AddItem22(this.h, (*C.struct_miqt_string)(text_ms), userData.cPointer()) } func (this *QComboBox) AddItem3(icon *QIcon, text string, userData *QVariant) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_AddItem3(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms), userData.cPointer()) } func (this *QComboBox) InsertItem3(index int, text string, userData *QVariant) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_InsertItem3(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms), userData.cPointer()) } func (this *QComboBox) InsertItem4(index int, icon *QIcon, text string, userData *QVariant) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QComboBox_InsertItem4(this.h, (C.int)(index), icon.cPointer(), (*C.struct_miqt_string)(text_ms), userData.cPointer()) } diff --git a/qt/gen_qcombobox.h b/qt/gen_qcombobox.h index cd42a6df..1c60d741 100644 --- a/qt/gen_qcombobox.h +++ b/qt/gen_qcombobox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcommandlineoption.cpp b/qt/gen_qcommandlineoption.cpp index 305555fe..cc6a522b 100644 --- a/qt/gen_qcommandlineoption.cpp +++ b/qt/gen_qcommandlineoption.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qcommandlineoption.h" +#include #include "gen_qcommandlineoption.h" #include "_cgo_export.h" @@ -13,7 +13,7 @@ QCommandLineOption* QCommandLineOption_new(struct miqt_string* name) { } QCommandLineOption* QCommandLineOption_new2(struct miqt_array* /* of struct miqt_string* */ names) { - QList names_QList; + QStringList names_QList; names_QList.reserve(names->len); struct miqt_string** names_arr = static_cast(names->data); for(size_t i = 0; i < names->len; ++i) { @@ -30,7 +30,7 @@ QCommandLineOption* QCommandLineOption_new3(struct miqt_string* name, struct miq } QCommandLineOption* QCommandLineOption_new4(struct miqt_array* /* of struct miqt_string* */ names, struct miqt_string* description) { - QList names_QList; + QStringList names_QList; names_QList.reserve(names->len); struct miqt_string** names_arr = static_cast(names->data); for(size_t i = 0; i < names->len; ++i) { @@ -61,7 +61,7 @@ QCommandLineOption* QCommandLineOption_new7(struct miqt_string* name, struct miq } QCommandLineOption* QCommandLineOption_new8(struct miqt_array* /* of struct miqt_string* */ names, struct miqt_string* description, struct miqt_string* valueName) { - QList names_QList; + QStringList names_QList; names_QList.reserve(names->len); struct miqt_string** names_arr = static_cast(names->data); for(size_t i = 0; i < names->len; ++i) { @@ -74,7 +74,7 @@ QCommandLineOption* QCommandLineOption_new8(struct miqt_array* /* of struct miqt } QCommandLineOption* QCommandLineOption_new9(struct miqt_array* /* of struct miqt_string* */ names, struct miqt_string* description, struct miqt_string* valueName, struct miqt_string* defaultValue) { - QList names_QList; + QStringList names_QList; names_QList.reserve(names->len); struct miqt_string** names_arr = static_cast(names->data); for(size_t i = 0; i < names->len; ++i) { @@ -141,7 +141,7 @@ void QCommandLineOption_SetDefaultValue(QCommandLineOption* self, struct miqt_st } void QCommandLineOption_SetDefaultValues(QCommandLineOption* self, struct miqt_array* /* of struct miqt_string* */ defaultValues) { - QList defaultValues_QList; + QStringList defaultValues_QList; defaultValues_QList.reserve(defaultValues->len); struct miqt_string** defaultValues_arr = static_cast(defaultValues->data); for(size_t i = 0; i < defaultValues->len; ++i) { diff --git a/qt/gen_qcommandlineoption.go b/qt/gen_qcommandlineoption.go index 19ab050d..f7d5c3fc 100644 --- a/qt/gen_qcommandlineoption.go +++ b/qt/gen_qcommandlineoption.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -31,6 +32,13 @@ func (this *QCommandLineOption) cPointer() *C.QCommandLineOption { return this.h } +func (this *QCommandLineOption) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCommandLineOption(h *C.QCommandLineOption) *QCommandLineOption { if h == nil { return nil @@ -38,13 +46,13 @@ func newQCommandLineOption(h *C.QCommandLineOption) *QCommandLineOption { return &QCommandLineOption{h: h} } -func newQCommandLineOption_U(h unsafe.Pointer) *QCommandLineOption { +func UnsafeNewQCommandLineOption(h unsafe.Pointer) *QCommandLineOption { return newQCommandLineOption((*C.QCommandLineOption)(h)) } // NewQCommandLineOption constructs a new QCommandLineOption object. func NewQCommandLineOption(name string) *QCommandLineOption { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QCommandLineOption_new((*C.struct_miqt_string)(name_ms)) return newQCommandLineOption(ret) @@ -56,7 +64,7 @@ func NewQCommandLineOption2(names []string) *QCommandLineOption { names_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(names)))) defer C.free(unsafe.Pointer(names_CArray)) for i := range names { - names_i_ms := miqt_strdupg(names[i]) + names_i_ms := libmiqt.Strdupg(names[i]) defer C.free(names_i_ms) names_CArray[i] = (*C.struct_miqt_string)(names_i_ms) } @@ -68,9 +76,9 @@ func NewQCommandLineOption2(names []string) *QCommandLineOption { // NewQCommandLineOption3 constructs a new QCommandLineOption object. func NewQCommandLineOption3(name string, description string) *QCommandLineOption { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) ret := C.QCommandLineOption_new3((*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(description_ms)) return newQCommandLineOption(ret) @@ -82,13 +90,13 @@ func NewQCommandLineOption4(names []string, description string) *QCommandLineOpt names_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(names)))) defer C.free(unsafe.Pointer(names_CArray)) for i := range names { - names_i_ms := miqt_strdupg(names[i]) + names_i_ms := libmiqt.Strdupg(names[i]) defer C.free(names_i_ms) names_CArray[i] = (*C.struct_miqt_string)(names_i_ms) } names_ma := &C.struct_miqt_array{len: C.size_t(len(names)), data: unsafe.Pointer(names_CArray)} defer runtime.KeepAlive(unsafe.Pointer(names_ma)) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) ret := C.QCommandLineOption_new4(names_ma, (*C.struct_miqt_string)(description_ms)) return newQCommandLineOption(ret) @@ -102,11 +110,11 @@ func NewQCommandLineOption5(other *QCommandLineOption) *QCommandLineOption { // NewQCommandLineOption6 constructs a new QCommandLineOption object. func NewQCommandLineOption6(name string, description string, valueName string) *QCommandLineOption { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) - valueName_ms := miqt_strdupg(valueName) + valueName_ms := libmiqt.Strdupg(valueName) defer C.free(valueName_ms) ret := C.QCommandLineOption_new6((*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(description_ms), (*C.struct_miqt_string)(valueName_ms)) return newQCommandLineOption(ret) @@ -114,13 +122,13 @@ func NewQCommandLineOption6(name string, description string, valueName string) * // NewQCommandLineOption7 constructs a new QCommandLineOption object. func NewQCommandLineOption7(name string, description string, valueName string, defaultValue string) *QCommandLineOption { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) - valueName_ms := miqt_strdupg(valueName) + valueName_ms := libmiqt.Strdupg(valueName) defer C.free(valueName_ms) - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) ret := C.QCommandLineOption_new7((*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(description_ms), (*C.struct_miqt_string)(valueName_ms), (*C.struct_miqt_string)(defaultValue_ms)) return newQCommandLineOption(ret) @@ -132,15 +140,15 @@ func NewQCommandLineOption8(names []string, description string, valueName string names_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(names)))) defer C.free(unsafe.Pointer(names_CArray)) for i := range names { - names_i_ms := miqt_strdupg(names[i]) + names_i_ms := libmiqt.Strdupg(names[i]) defer C.free(names_i_ms) names_CArray[i] = (*C.struct_miqt_string)(names_i_ms) } names_ma := &C.struct_miqt_array{len: C.size_t(len(names)), data: unsafe.Pointer(names_CArray)} defer runtime.KeepAlive(unsafe.Pointer(names_ma)) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) - valueName_ms := miqt_strdupg(valueName) + valueName_ms := libmiqt.Strdupg(valueName) defer C.free(valueName_ms) ret := C.QCommandLineOption_new8(names_ma, (*C.struct_miqt_string)(description_ms), (*C.struct_miqt_string)(valueName_ms)) return newQCommandLineOption(ret) @@ -152,17 +160,17 @@ func NewQCommandLineOption9(names []string, description string, valueName string names_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(names)))) defer C.free(unsafe.Pointer(names_CArray)) for i := range names { - names_i_ms := miqt_strdupg(names[i]) + names_i_ms := libmiqt.Strdupg(names[i]) defer C.free(names_i_ms) names_CArray[i] = (*C.struct_miqt_string)(names_i_ms) } names_ma := &C.struct_miqt_array{len: C.size_t(len(names)), data: unsafe.Pointer(names_CArray)} defer runtime.KeepAlive(unsafe.Pointer(names_ma)) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) - valueName_ms := miqt_strdupg(valueName) + valueName_ms := libmiqt.Strdupg(valueName) defer C.free(valueName_ms) - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) ret := C.QCommandLineOption_new9(names_ma, (*C.struct_miqt_string)(description_ms), (*C.struct_miqt_string)(valueName_ms), (*C.struct_miqt_string)(defaultValue_ms)) return newQCommandLineOption(ret) @@ -191,7 +199,7 @@ func (this *QCommandLineOption) Names() []string { } func (this *QCommandLineOption) SetValueName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QCommandLineOption_SetValueName(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -204,7 +212,7 @@ func (this *QCommandLineOption) ValueName() string { } func (this *QCommandLineOption) SetDescription(description string) { - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) C.QCommandLineOption_SetDescription(this.h, (*C.struct_miqt_string)(description_ms)) } @@ -217,7 +225,7 @@ func (this *QCommandLineOption) Description() string { } func (this *QCommandLineOption) SetDefaultValue(defaultValue string) { - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) C.QCommandLineOption_SetDefaultValue(this.h, (*C.struct_miqt_string)(defaultValue_ms)) } @@ -227,7 +235,7 @@ func (this *QCommandLineOption) SetDefaultValues(defaultValues []string) { defaultValues_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(defaultValues)))) defer C.free(unsafe.Pointer(defaultValues_CArray)) for i := range defaultValues { - defaultValues_i_ms := miqt_strdupg(defaultValues[i]) + defaultValues_i_ms := libmiqt.Strdupg(defaultValues[i]) defer C.free(defaultValues_i_ms) defaultValues_CArray[i] = (*C.struct_miqt_string)(defaultValues_i_ms) } diff --git a/qt/gen_qcommandlineoption.h b/qt/gen_qcommandlineoption.h index f2570b63..ec461da7 100644 --- a/qt/gen_qcommandlineoption.h +++ b/qt/gen_qcommandlineoption.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcommandlineparser.cpp b/qt/gen_qcommandlineparser.cpp index cfc760f1..3c2b7eae 100644 --- a/qt/gen_qcommandlineparser.cpp +++ b/qt/gen_qcommandlineparser.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qcommandlineparser.h" +#include #include "gen_qcommandlineparser.h" #include "_cgo_export.h" @@ -80,7 +80,7 @@ void QCommandLineParser_ClearPositionalArguments(QCommandLineParser* self) { } void QCommandLineParser_Process(QCommandLineParser* self, struct miqt_array* /* of struct miqt_string* */ arguments) { - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { @@ -95,7 +95,7 @@ void QCommandLineParser_ProcessWithApp(QCommandLineParser* self, QCoreApplicatio } bool QCommandLineParser_Parse(QCommandLineParser* self, struct miqt_array* /* of struct miqt_string* */ arguments) { - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { diff --git a/qt/gen_qcommandlineparser.go b/qt/gen_qcommandlineparser.go index f765da91..841e6ffa 100644 --- a/qt/gen_qcommandlineparser.go +++ b/qt/gen_qcommandlineparser.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -38,6 +39,13 @@ func (this *QCommandLineParser) cPointer() *C.QCommandLineParser { return this.h } +func (this *QCommandLineParser) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCommandLineParser(h *C.QCommandLineParser) *QCommandLineParser { if h == nil { return nil @@ -45,7 +53,7 @@ func newQCommandLineParser(h *C.QCommandLineParser) *QCommandLineParser { return &QCommandLineParser{h: h} } -func newQCommandLineParser_U(h unsafe.Pointer) *QCommandLineParser { +func UnsafeNewQCommandLineParser(h unsafe.Pointer) *QCommandLineParser { return newQCommandLineParser((*C.QCommandLineParser)(h)) } @@ -112,7 +120,7 @@ func (this *QCommandLineParser) AddHelpOption() *QCommandLineOption { } func (this *QCommandLineParser) SetApplicationDescription(description string) { - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) C.QCommandLineParser_SetApplicationDescription(this.h, (*C.struct_miqt_string)(description_ms)) } @@ -125,9 +133,9 @@ func (this *QCommandLineParser) ApplicationDescription() string { } func (this *QCommandLineParser) AddPositionalArgument(name string, description string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) C.QCommandLineParser_AddPositionalArgument(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(description_ms)) } @@ -141,7 +149,7 @@ func (this *QCommandLineParser) Process(arguments []string) { arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } @@ -159,7 +167,7 @@ func (this *QCommandLineParser) Parse(arguments []string) bool { arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } @@ -176,13 +184,13 @@ func (this *QCommandLineParser) ErrorText() string { } func (this *QCommandLineParser) IsSet(name string) bool { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (bool)(C.QCommandLineParser_IsSet(this.h, (*C.struct_miqt_string)(name_ms))) } func (this *QCommandLineParser) Value(name string) string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) var _ms *C.struct_miqt_string = C.QCommandLineParser_Value(this.h, (*C.struct_miqt_string)(name_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -191,7 +199,7 @@ func (this *QCommandLineParser) Value(name string) string { } func (this *QCommandLineParser) Values(name string) []string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) var _ma *C.struct_miqt_array = C.QCommandLineParser_Values(this.h, (*C.struct_miqt_string)(name_ms)) _ret := make([]string, int(_ma.len)) @@ -325,11 +333,11 @@ func QCommandLineParser_TrUtf83(sourceText string, disambiguation string, n int) } func (this *QCommandLineParser) AddPositionalArgument3(name string, description string, syntax string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) - syntax_ms := miqt_strdupg(syntax) + syntax_ms := libmiqt.Strdupg(syntax) defer C.free(syntax_ms) C.QCommandLineParser_AddPositionalArgument3(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(description_ms), (*C.struct_miqt_string)(syntax_ms)) } diff --git a/qt/gen_qcommandlineparser.h b/qt/gen_qcommandlineparser.h index 9826b913..1ffb9b67 100644 --- a/qt/gen_qcommandlineparser.h +++ b/qt/gen_qcommandlineparser.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcommandlinkbutton.cpp b/qt/gen_qcommandlinkbutton.cpp index c68a4267..5ea00b85 100644 --- a/qt/gen_qcommandlinkbutton.cpp +++ b/qt/gen_qcommandlinkbutton.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qcommandlinkbutton.h" +#include #include "gen_qcommandlinkbutton.h" #include "_cgo_export.h" diff --git a/qt/gen_qcommandlinkbutton.go b/qt/gen_qcommandlinkbutton.go index 552b1f91..5984deed 100644 --- a/qt/gen_qcommandlinkbutton.go +++ b/qt/gen_qcommandlinkbutton.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QCommandLinkButton) cPointer() *C.QCommandLinkButton { return this.h } +func (this *QCommandLinkButton) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCommandLinkButton(h *C.QCommandLinkButton) *QCommandLinkButton { if h == nil { return nil } - return &QCommandLinkButton{h: h, QPushButton: newQPushButton_U(unsafe.Pointer(h))} + return &QCommandLinkButton{h: h, QPushButton: UnsafeNewQPushButton(unsafe.Pointer(h))} } -func newQCommandLinkButton_U(h unsafe.Pointer) *QCommandLinkButton { +func UnsafeNewQCommandLinkButton(h unsafe.Pointer) *QCommandLinkButton { return newQCommandLinkButton((*C.QCommandLinkButton)(h)) } @@ -44,7 +52,7 @@ func NewQCommandLinkButton() *QCommandLinkButton { // NewQCommandLinkButton2 constructs a new QCommandLinkButton object. func NewQCommandLinkButton2(text string) *QCommandLinkButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QCommandLinkButton_new2((*C.struct_miqt_string)(text_ms)) return newQCommandLinkButton(ret) @@ -52,9 +60,9 @@ func NewQCommandLinkButton2(text string) *QCommandLinkButton { // NewQCommandLinkButton3 constructs a new QCommandLinkButton object. func NewQCommandLinkButton3(text string, description string) *QCommandLinkButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) ret := C.QCommandLinkButton_new3((*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(description_ms)) return newQCommandLinkButton(ret) @@ -68,7 +76,7 @@ func NewQCommandLinkButton4(parent *QWidget) *QCommandLinkButton { // NewQCommandLinkButton5 constructs a new QCommandLinkButton object. func NewQCommandLinkButton5(text string, parent *QWidget) *QCommandLinkButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QCommandLinkButton_new5((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQCommandLinkButton(ret) @@ -76,16 +84,16 @@ func NewQCommandLinkButton5(text string, parent *QWidget) *QCommandLinkButton { // NewQCommandLinkButton6 constructs a new QCommandLinkButton object. func NewQCommandLinkButton6(text string, description string, parent *QWidget) *QCommandLinkButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) ret := C.QCommandLinkButton_new6((*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(description_ms), parent.cPointer()) return newQCommandLinkButton(ret) } func (this *QCommandLinkButton) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QCommandLinkButton_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QCommandLinkButton_MetaObject(this.h))) } func (this *QCommandLinkButton) Metacast(param1 string) unsafe.Pointer { @@ -120,7 +128,7 @@ func (this *QCommandLinkButton) Description() string { } func (this *QCommandLinkButton) SetDescription(description string) { - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) C.QCommandLinkButton_SetDescription(this.h, (*C.struct_miqt_string)(description_ms)) } diff --git a/qt/gen_qcommandlinkbutton.h b/qt/gen_qcommandlinkbutton.h index 17020017..77a813cc 100644 --- a/qt/gen_qcommandlinkbutton.h +++ b/qt/gen_qcommandlinkbutton.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcommonstyle.cpp b/qt/gen_qcommonstyle.cpp index 9ae54594..e67db4a7 100644 --- a/qt/gen_qcommonstyle.cpp +++ b/qt/gen_qcommonstyle.cpp @@ -15,7 +15,7 @@ #include #include #include -#include "qcommonstyle.h" +#include #include "gen_qcommonstyle.h" #include "_cgo_export.h" diff --git a/qt/gen_qcommonstyle.go b/qt/gen_qcommonstyle.go index 0659ccce..49530bd3 100644 --- a/qt/gen_qcommonstyle.go +++ b/qt/gen_qcommonstyle.go @@ -25,14 +25,21 @@ func (this *QCommonStyle) cPointer() *C.QCommonStyle { return this.h } +func (this *QCommonStyle) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCommonStyle(h *C.QCommonStyle) *QCommonStyle { if h == nil { return nil } - return &QCommonStyle{h: h, QStyle: newQStyle_U(unsafe.Pointer(h))} + return &QCommonStyle{h: h, QStyle: UnsafeNewQStyle(unsafe.Pointer(h))} } -func newQCommonStyle_U(h unsafe.Pointer) *QCommonStyle { +func UnsafeNewQCommonStyle(h unsafe.Pointer) *QCommonStyle { return newQCommonStyle((*C.QCommonStyle)(h)) } @@ -43,7 +50,7 @@ func NewQCommonStyle() *QCommonStyle { } func (this *QCommonStyle) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QCommonStyle_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QCommonStyle_MetaObject(this.h))) } func (this *QCommonStyle) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qcommonstyle.h b/qt/gen_qcommonstyle.h index 9906fab5..f93799e0 100644 --- a/qt/gen_qcommonstyle.h +++ b/qt/gen_qcommonstyle.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcompleter.cpp b/qt/gen_qcompleter.cpp index 7c2d9884..34cb5a88 100644 --- a/qt/gen_qcompleter.cpp +++ b/qt/gen_qcompleter.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qcompleter.h" +#include #include "gen_qcompleter.h" #include "_cgo_export.h" @@ -23,7 +23,7 @@ QCompleter* QCompleter_new2(QAbstractItemModel* model) { } QCompleter* QCompleter_new3(struct miqt_array* /* of struct miqt_string* */ completions) { - QList completions_QList; + QStringList completions_QList; completions_QList.reserve(completions->len); struct miqt_string** completions_arr = static_cast(completions->data); for(size_t i = 0; i < completions->len; ++i) { @@ -42,7 +42,7 @@ QCompleter* QCompleter_new5(QAbstractItemModel* model, QObject* parent) { } QCompleter* QCompleter_new6(struct miqt_array* /* of struct miqt_string* */ completions, QObject* parent) { - QList completions_QList; + QStringList completions_QList; completions_QList.reserve(completions->len); struct miqt_string** completions_arr = static_cast(completions->data); for(size_t i = 0; i < completions->len; ++i) { diff --git a/qt/gen_qcompleter.go b/qt/gen_qcompleter.go index 098836d0..90c93f36 100644 --- a/qt/gen_qcompleter.go +++ b/qt/gen_qcompleter.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -42,14 +43,21 @@ func (this *QCompleter) cPointer() *C.QCompleter { return this.h } +func (this *QCompleter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCompleter(h *C.QCompleter) *QCompleter { if h == nil { return nil } - return &QCompleter{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QCompleter{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQCompleter_U(h unsafe.Pointer) *QCompleter { +func UnsafeNewQCompleter(h unsafe.Pointer) *QCompleter { return newQCompleter((*C.QCompleter)(h)) } @@ -71,7 +79,7 @@ func NewQCompleter3(completions []string) *QCompleter { completions_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(completions)))) defer C.free(unsafe.Pointer(completions_CArray)) for i := range completions { - completions_i_ms := miqt_strdupg(completions[i]) + completions_i_ms := libmiqt.Strdupg(completions[i]) defer C.free(completions_i_ms) completions_CArray[i] = (*C.struct_miqt_string)(completions_i_ms) } @@ -99,7 +107,7 @@ func NewQCompleter6(completions []string, parent *QObject) *QCompleter { completions_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(completions)))) defer C.free(unsafe.Pointer(completions_CArray)) for i := range completions { - completions_i_ms := miqt_strdupg(completions[i]) + completions_i_ms := libmiqt.Strdupg(completions[i]) defer C.free(completions_i_ms) completions_CArray[i] = (*C.struct_miqt_string)(completions_i_ms) } @@ -110,7 +118,7 @@ func NewQCompleter6(completions []string, parent *QObject) *QCompleter { } func (this *QCompleter) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QCompleter_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QCompleter_MetaObject(this.h))) } func (this *QCompleter) Metacast(param1 string) unsafe.Pointer { @@ -142,7 +150,7 @@ func (this *QCompleter) SetWidget(widget *QWidget) { } func (this *QCompleter) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QCompleter_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QCompleter_Widget(this.h))) } func (this *QCompleter) SetModel(c *QAbstractItemModel) { @@ -150,7 +158,7 @@ func (this *QCompleter) SetModel(c *QAbstractItemModel) { } func (this *QCompleter) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QCompleter_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QCompleter_Model(this.h))) } func (this *QCompleter) SetCompletionMode(mode QCompleter__CompletionMode) { @@ -170,7 +178,7 @@ func (this *QCompleter) FilterMode() MatchFlag { } func (this *QCompleter) Popup() *QAbstractItemView { - return newQAbstractItemView_U(unsafe.Pointer(C.QCompleter_Popup(this.h))) + return UnsafeNewQAbstractItemView(unsafe.Pointer(C.QCompleter_Popup(this.h))) } func (this *QCompleter) SetPopup(popup *QAbstractItemView) { @@ -248,7 +256,7 @@ func (this *QCompleter) CurrentCompletion() string { } func (this *QCompleter) CompletionModel() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QCompleter_CompletionModel(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QCompleter_CompletionModel(this.h))) } func (this *QCompleter) CompletionPrefix() string { @@ -259,7 +267,7 @@ func (this *QCompleter) CompletionPrefix() string { } func (this *QCompleter) SetCompletionPrefix(prefix string) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) C.QCompleter_SetCompletionPrefix(this.h, (*C.struct_miqt_string)(prefix_ms)) } @@ -280,7 +288,7 @@ func (this *QCompleter) PathFromIndex(index *QModelIndex) string { } func (this *QCompleter) SplitPath(path string) []string { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) var _ma *C.struct_miqt_array = C.QCompleter_SplitPath(this.h, (*C.struct_miqt_string)(path_ms)) _ret := make([]string, int(_ma.len)) @@ -296,7 +304,7 @@ func (this *QCompleter) SplitPath(path string) []string { } func (this *QCompleter) Activated(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QCompleter_Activated(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -335,13 +343,13 @@ func miqt_exec_callback_QCompleter_ActivatedWithIndex(cb C.intptr_t, index *C.QM } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } func (this *QCompleter) Highlighted(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QCompleter_Highlighted(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -380,7 +388,7 @@ func miqt_exec_callback_QCompleter_HighlightedWithIndex(cb C.intptr_t, index *C. } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } diff --git a/qt/gen_qcompleter.h b/qt/gen_qcompleter.h index 0bd2022a..6c88e8a5 100644 --- a/qt/gen_qcompleter.h +++ b/qt/gen_qcompleter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qconcatenatetablesproxymodel.cpp b/qt/gen_qconcatenatetablesproxymodel.cpp index bc894986..39ebc0a5 100644 --- a/qt/gen_qconcatenatetablesproxymodel.cpp +++ b/qt/gen_qconcatenatetablesproxymodel.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qconcatenatetablesproxymodel.h" +#include #include "gen_qconcatenatetablesproxymodel.h" #include "_cgo_export.h" @@ -123,7 +123,7 @@ struct miqt_array* QConcatenateTablesProxyModel_MimeTypes(const QConcatenateTabl } QMimeData* QConcatenateTablesProxyModel_MimeData(const QConcatenateTablesProxyModel* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { diff --git a/qt/gen_qconcatenatetablesproxymodel.go b/qt/gen_qconcatenatetablesproxymodel.go index dc488580..ca88980a 100644 --- a/qt/gen_qconcatenatetablesproxymodel.go +++ b/qt/gen_qconcatenatetablesproxymodel.go @@ -25,14 +25,21 @@ func (this *QConcatenateTablesProxyModel) cPointer() *C.QConcatenateTablesProxyM return this.h } +func (this *QConcatenateTablesProxyModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQConcatenateTablesProxyModel(h *C.QConcatenateTablesProxyModel) *QConcatenateTablesProxyModel { if h == nil { return nil } - return &QConcatenateTablesProxyModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))} + return &QConcatenateTablesProxyModel{h: h, QAbstractItemModel: UnsafeNewQAbstractItemModel(unsafe.Pointer(h))} } -func newQConcatenateTablesProxyModel_U(h unsafe.Pointer) *QConcatenateTablesProxyModel { +func UnsafeNewQConcatenateTablesProxyModel(h unsafe.Pointer) *QConcatenateTablesProxyModel { return newQConcatenateTablesProxyModel((*C.QConcatenateTablesProxyModel)(h)) } @@ -49,7 +56,7 @@ func NewQConcatenateTablesProxyModel2(parent *QObject) *QConcatenateTablesProxyM } func (this *QConcatenateTablesProxyModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QConcatenateTablesProxyModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QConcatenateTablesProxyModel_MetaObject(this.h))) } func (this *QConcatenateTablesProxyModel) Metacast(param1 string) unsafe.Pointer { @@ -81,7 +88,7 @@ func (this *QConcatenateTablesProxyModel) SourceModels() []*QAbstractItemModel { _ret := make([]*QAbstractItemModel, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractItemModel)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractItemModel_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractItemModel(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -176,7 +183,7 @@ func (this *QConcatenateTablesProxyModel) MimeData(indexes []QModelIndex) *QMime } indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)} defer runtime.KeepAlive(unsafe.Pointer(indexes_ma)) - return newQMimeData_U(unsafe.Pointer(C.QConcatenateTablesProxyModel_MimeData(this.h, indexes_ma))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QConcatenateTablesProxyModel_MimeData(this.h, indexes_ma))) } func (this *QConcatenateTablesProxyModel) CanDropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool { diff --git a/qt/gen_qconcatenatetablesproxymodel.h b/qt/gen_qconcatenatetablesproxymodel.h index 5b57e269..691e6d2f 100644 --- a/qt/gen_qconcatenatetablesproxymodel.h +++ b/qt/gen_qconcatenatetablesproxymodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcontainerfwd.cpp b/qt/gen_qcontainerfwd.cpp index 8f19bf96..296e13c7 100644 --- a/qt/gen_qcontainerfwd.cpp +++ b/qt/gen_qcontainerfwd.cpp @@ -1,4 +1,4 @@ -#include "qcontainerfwd.h" +#include #include "gen_qcontainerfwd.h" #include "_cgo_export.h" diff --git a/qt/gen_qcontainerfwd.h b/qt/gen_qcontainerfwd.h index c796f309..4f35142f 100644 --- a/qt/gen_qcontainerfwd.h +++ b/qt/gen_qcontainerfwd.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcontiguouscache.cpp b/qt/gen_qcontiguouscache.cpp index 8209cc52..5f2fc363 100644 --- a/qt/gen_qcontiguouscache.cpp +++ b/qt/gen_qcontiguouscache.cpp @@ -1,5 +1,5 @@ #include -#include "qcontiguouscache.h" +#include #include "gen_qcontiguouscache.h" #include "_cgo_export.h" diff --git a/qt/gen_qcontiguouscache.go b/qt/gen_qcontiguouscache.go index 94f8fbc2..cba2d6d4 100644 --- a/qt/gen_qcontiguouscache.go +++ b/qt/gen_qcontiguouscache.go @@ -24,6 +24,13 @@ func (this *QContiguousCacheData) cPointer() *C.QContiguousCacheData { return this.h } +func (this *QContiguousCacheData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQContiguousCacheData(h *C.QContiguousCacheData) *QContiguousCacheData { if h == nil { return nil @@ -31,12 +38,12 @@ func newQContiguousCacheData(h *C.QContiguousCacheData) *QContiguousCacheData { return &QContiguousCacheData{h: h} } -func newQContiguousCacheData_U(h unsafe.Pointer) *QContiguousCacheData { +func UnsafeNewQContiguousCacheData(h unsafe.Pointer) *QContiguousCacheData { return newQContiguousCacheData((*C.QContiguousCacheData)(h)) } func QContiguousCacheData_AllocateData(size int, alignment int) *QContiguousCacheData { - return newQContiguousCacheData_U(unsafe.Pointer(C.QContiguousCacheData_AllocateData((C.int)(size), (C.int)(alignment)))) + return UnsafeNewQContiguousCacheData(unsafe.Pointer(C.QContiguousCacheData_AllocateData((C.int)(size), (C.int)(alignment)))) } func QContiguousCacheData_FreeData(data *QContiguousCacheData) { diff --git a/qt/gen_qcontiguouscache.h b/qt/gen_qcontiguouscache.h index 809b724f..012a01a0 100644 --- a/qt/gen_qcontiguouscache.h +++ b/qt/gen_qcontiguouscache.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcoreapplication.cpp b/qt/gen_qcoreapplication.cpp index c04aaecf..1d77a725 100644 --- a/qt/gen_qcoreapplication.cpp +++ b/qt/gen_qcoreapplication.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qcoreapplication.h" +#include #include "gen_qcoreapplication.h" #include "_cgo_export.h" @@ -203,7 +203,7 @@ long long QCoreApplication_ApplicationPid() { } void QCoreApplication_SetLibraryPaths(struct miqt_array* /* of struct miqt_string* */ libraryPaths) { - QList libraryPaths_QList; + QStringList libraryPaths_QList; libraryPaths_QList.reserve(libraryPaths->len); struct miqt_string** libraryPaths_arr = static_cast(libraryPaths->data); for(size_t i = 0; i < libraryPaths->len; ++i) { diff --git a/qt/gen_qcoreapplication.go b/qt/gen_qcoreapplication.go index 23d60c0f..d81539fc 100644 --- a/qt/gen_qcoreapplication.go +++ b/qt/gen_qcoreapplication.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -32,14 +33,21 @@ func (this *QCoreApplication) cPointer() *C.QCoreApplication { return this.h } +func (this *QCoreApplication) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCoreApplication(h *C.QCoreApplication) *QCoreApplication { if h == nil { return nil } - return &QCoreApplication{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QCoreApplication{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQCoreApplication_U(h unsafe.Pointer) *QCoreApplication { +func UnsafeNewQCoreApplication(h unsafe.Pointer) *QCoreApplication { return newQCoreApplication((*C.QCoreApplication)(h)) } @@ -70,7 +78,7 @@ func NewQCoreApplication2(args []string, param3 int) *QCoreApplication { } func (this *QCoreApplication) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QCoreApplication_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QCoreApplication_MetaObject(this.h))) } func (this *QCoreApplication) Metacast(param1 string) unsafe.Pointer { @@ -120,7 +128,7 @@ func QCoreApplication_TestAttribute(attribute ApplicationAttribute) bool { } func QCoreApplication_SetOrganizationDomain(orgDomain string) { - orgDomain_ms := miqt_strdupg(orgDomain) + orgDomain_ms := libmiqt.Strdupg(orgDomain) defer C.free(orgDomain_ms) C.QCoreApplication_SetOrganizationDomain((*C.struct_miqt_string)(orgDomain_ms)) } @@ -133,7 +141,7 @@ func QCoreApplication_OrganizationDomain() string { } func QCoreApplication_SetOrganizationName(orgName string) { - orgName_ms := miqt_strdupg(orgName) + orgName_ms := libmiqt.Strdupg(orgName) defer C.free(orgName_ms) C.QCoreApplication_SetOrganizationName((*C.struct_miqt_string)(orgName_ms)) } @@ -146,7 +154,7 @@ func QCoreApplication_OrganizationName() string { } func QCoreApplication_SetApplicationName(application string) { - application_ms := miqt_strdupg(application) + application_ms := libmiqt.Strdupg(application) defer C.free(application_ms) C.QCoreApplication_SetApplicationName((*C.struct_miqt_string)(application_ms)) } @@ -159,7 +167,7 @@ func QCoreApplication_ApplicationName() string { } func QCoreApplication_SetApplicationVersion(version string) { - version_ms := miqt_strdupg(version) + version_ms := libmiqt.Strdupg(version) defer C.free(version_ms) C.QCoreApplication_SetApplicationVersion((*C.struct_miqt_string)(version_ms)) } @@ -180,7 +188,7 @@ func QCoreApplication_IsSetuidAllowed() bool { } func QCoreApplication_Instance() *QCoreApplication { - return newQCoreApplication_U(unsafe.Pointer(C.QCoreApplication_Instance())) + return UnsafeNewQCoreApplication(unsafe.Pointer(C.QCoreApplication_Instance())) } func QCoreApplication_Exec() int { @@ -220,7 +228,7 @@ func QCoreApplication_HasPendingEvents() bool { } func QCoreApplication_EventDispatcher() *QAbstractEventDispatcher { - return newQAbstractEventDispatcher_U(unsafe.Pointer(C.QCoreApplication_EventDispatcher())) + return UnsafeNewQAbstractEventDispatcher(unsafe.Pointer(C.QCoreApplication_EventDispatcher())) } func QCoreApplication_SetEventDispatcher(eventDispatcher *QAbstractEventDispatcher) { @@ -262,7 +270,7 @@ func QCoreApplication_SetLibraryPaths(libraryPaths []string) { libraryPaths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(libraryPaths)))) defer C.free(unsafe.Pointer(libraryPaths_CArray)) for i := range libraryPaths { - libraryPaths_i_ms := miqt_strdupg(libraryPaths[i]) + libraryPaths_i_ms := libmiqt.Strdupg(libraryPaths[i]) defer C.free(libraryPaths_i_ms) libraryPaths_CArray[i] = (*C.struct_miqt_string)(libraryPaths_i_ms) } @@ -286,13 +294,13 @@ func QCoreApplication_LibraryPaths() []string { } func QCoreApplication_AddLibraryPath(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QCoreApplication_AddLibraryPath((*C.struct_miqt_string)(param1_ms)) } func QCoreApplication_RemoveLibraryPath(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QCoreApplication_RemoveLibraryPath((*C.struct_miqt_string)(param1_ms)) } diff --git a/qt/gen_qcoreapplication.h b/qt/gen_qcoreapplication.h index a5200143..4acfa967 100644 --- a/qt/gen_qcoreapplication.h +++ b/qt/gen_qcoreapplication.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcoreevent.cpp b/qt/gen_qcoreevent.cpp index 306f3f6e..3f2bf751 100644 --- a/qt/gen_qcoreevent.cpp +++ b/qt/gen_qcoreevent.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qcoreevent.h" +#include #include "gen_qcoreevent.h" #include "_cgo_export.h" diff --git a/qt/gen_qcoreevent.go b/qt/gen_qcoreevent.go index ed3ac0b0..47bf0856 100644 --- a/qt/gen_qcoreevent.go +++ b/qt/gen_qcoreevent.go @@ -201,6 +201,13 @@ func (this *QEvent) cPointer() *C.QEvent { return this.h } +func (this *QEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQEvent(h *C.QEvent) *QEvent { if h == nil { return nil @@ -208,7 +215,7 @@ func newQEvent(h *C.QEvent) *QEvent { return &QEvent{h: h} } -func newQEvent_U(h unsafe.Pointer) *QEvent { +func UnsafeNewQEvent(h unsafe.Pointer) *QEvent { return newQEvent((*C.QEvent)(h)) } @@ -286,14 +293,21 @@ func (this *QTimerEvent) cPointer() *C.QTimerEvent { return this.h } +func (this *QTimerEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTimerEvent(h *C.QTimerEvent) *QTimerEvent { if h == nil { return nil } - return &QTimerEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QTimerEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQTimerEvent_U(h unsafe.Pointer) *QTimerEvent { +func UnsafeNewQTimerEvent(h unsafe.Pointer) *QTimerEvent { return newQTimerEvent((*C.QTimerEvent)(h)) } @@ -339,14 +353,21 @@ func (this *QChildEvent) cPointer() *C.QChildEvent { return this.h } +func (this *QChildEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQChildEvent(h *C.QChildEvent) *QChildEvent { if h == nil { return nil } - return &QChildEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QChildEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQChildEvent_U(h unsafe.Pointer) *QChildEvent { +func UnsafeNewQChildEvent(h unsafe.Pointer) *QChildEvent { return newQChildEvent((*C.QChildEvent)(h)) } @@ -363,7 +384,7 @@ func NewQChildEvent2(param1 *QChildEvent) *QChildEvent { } func (this *QChildEvent) Child() *QObject { - return newQObject_U(unsafe.Pointer(C.QChildEvent_Child(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QChildEvent_Child(this.h))) } func (this *QChildEvent) Added() bool { @@ -404,14 +425,21 @@ func (this *QDynamicPropertyChangeEvent) cPointer() *C.QDynamicPropertyChangeEve return this.h } +func (this *QDynamicPropertyChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDynamicPropertyChangeEvent(h *C.QDynamicPropertyChangeEvent) *QDynamicPropertyChangeEvent { if h == nil { return nil } - return &QDynamicPropertyChangeEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QDynamicPropertyChangeEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQDynamicPropertyChangeEvent_U(h unsafe.Pointer) *QDynamicPropertyChangeEvent { +func UnsafeNewQDynamicPropertyChangeEvent(h unsafe.Pointer) *QDynamicPropertyChangeEvent { return newQDynamicPropertyChangeEvent((*C.QDynamicPropertyChangeEvent)(h)) } @@ -460,14 +488,21 @@ func (this *QDeferredDeleteEvent) cPointer() *C.QDeferredDeleteEvent { return this.h } +func (this *QDeferredDeleteEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDeferredDeleteEvent(h *C.QDeferredDeleteEvent) *QDeferredDeleteEvent { if h == nil { return nil } - return &QDeferredDeleteEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QDeferredDeleteEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQDeferredDeleteEvent_U(h unsafe.Pointer) *QDeferredDeleteEvent { +func UnsafeNewQDeferredDeleteEvent(h unsafe.Pointer) *QDeferredDeleteEvent { return newQDeferredDeleteEvent((*C.QDeferredDeleteEvent)(h)) } diff --git a/qt/gen_qcoreevent.h b/qt/gen_qcoreevent.h index 57e3c3d6..dc98051c 100644 --- a/qt/gen_qcoreevent.h +++ b/qt/gen_qcoreevent.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcryptographichash.cpp b/qt/gen_qcryptographichash.cpp index 63ceba6b..c9ab3a2e 100644 --- a/qt/gen_qcryptographichash.cpp +++ b/qt/gen_qcryptographichash.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qcryptographichash.h" +#include #include "gen_qcryptographichash.h" #include "_cgo_export.h" diff --git a/qt/gen_qcryptographichash.go b/qt/gen_qcryptographichash.go index 8f6c3cdf..43e8de34 100644 --- a/qt/gen_qcryptographichash.go +++ b/qt/gen_qcryptographichash.go @@ -48,6 +48,13 @@ func (this *QCryptographicHash) cPointer() *C.QCryptographicHash { return this.h } +func (this *QCryptographicHash) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCryptographicHash(h *C.QCryptographicHash) *QCryptographicHash { if h == nil { return nil @@ -55,7 +62,7 @@ func newQCryptographicHash(h *C.QCryptographicHash) *QCryptographicHash { return &QCryptographicHash{h: h} } -func newQCryptographicHash_U(h unsafe.Pointer) *QCryptographicHash { +func UnsafeNewQCryptographicHash(h unsafe.Pointer) *QCryptographicHash { return newQCryptographicHash((*C.QCryptographicHash)(h)) } diff --git a/qt/gen_qcryptographichash.h b/qt/gen_qcryptographichash.h index 2f484218..d5194089 100644 --- a/qt/gen_qcryptographichash.h +++ b/qt/gen_qcryptographichash.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qcursor.cpp b/qt/gen_qcursor.cpp index 4c5ae795..d3569665 100644 --- a/qt/gen_qcursor.cpp +++ b/qt/gen_qcursor.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qcursor.h" +#include #include "gen_qcursor.h" #include "_cgo_export.h" diff --git a/qt/gen_qcursor.go b/qt/gen_qcursor.go index 04044a29..e53bcde6 100644 --- a/qt/gen_qcursor.go +++ b/qt/gen_qcursor.go @@ -24,6 +24,13 @@ func (this *QCursor) cPointer() *C.QCursor { return this.h } +func (this *QCursor) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCursor(h *C.QCursor) *QCursor { if h == nil { return nil @@ -31,7 +38,7 @@ func newQCursor(h *C.QCursor) *QCursor { return &QCursor{h: h} } -func newQCursor_U(h unsafe.Pointer) *QCursor { +func UnsafeNewQCursor(h unsafe.Pointer) *QCursor { return newQCursor((*C.QCursor)(h)) } @@ -106,11 +113,11 @@ func (this *QCursor) SetShape(newShape CursorShape) { } func (this *QCursor) Bitmap() *QBitmap { - return newQBitmap_U(unsafe.Pointer(C.QCursor_Bitmap(this.h))) + return UnsafeNewQBitmap(unsafe.Pointer(C.QCursor_Bitmap(this.h))) } func (this *QCursor) Mask() *QBitmap { - return newQBitmap_U(unsafe.Pointer(C.QCursor_Mask(this.h))) + return UnsafeNewQBitmap(unsafe.Pointer(C.QCursor_Mask(this.h))) } func (this *QCursor) BitmapWithQtReturnByValueConstant(param1 ReturnByValueConstant) *QBitmap { diff --git a/qt/gen_qcursor.h b/qt/gen_qcursor.h index 8e34845c..b6ea6726 100644 --- a/qt/gen_qcursor.h +++ b/qt/gen_qcursor.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdatastream.cpp b/qt/gen_qdatastream.cpp index e4763964..fa1369de 100644 --- a/qt/gen_qdatastream.cpp +++ b/qt/gen_qdatastream.cpp @@ -2,7 +2,7 @@ #include #include #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__StreamStateSaver -#include "qdatastream.h" +#include #include "gen_qdatastream.h" #include "_cgo_export.h" diff --git a/qt/gen_qdatastream.go b/qt/gen_qdatastream.go index f27e2fbe..32aacdb5 100644 --- a/qt/gen_qdatastream.go +++ b/qt/gen_qdatastream.go @@ -85,6 +85,13 @@ func (this *QDataStream) cPointer() *C.QDataStream { return this.h } +func (this *QDataStream) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDataStream(h *C.QDataStream) *QDataStream { if h == nil { return nil @@ -92,7 +99,7 @@ func newQDataStream(h *C.QDataStream) *QDataStream { return &QDataStream{h: h} } -func newQDataStream_U(h unsafe.Pointer) *QDataStream { +func UnsafeNewQDataStream(h unsafe.Pointer) *QDataStream { return newQDataStream((*C.QDataStream)(h)) } @@ -121,7 +128,7 @@ func NewQDataStream4(param1 *QByteArray) *QDataStream { } func (this *QDataStream) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QDataStream_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QDataStream_Device(this.h))) } func (this *QDataStream) SetDevice(device *QIODevice) { @@ -275,7 +282,7 @@ func (this *QDataStream) OperatorShiftLeftWithStr(str string) { func (this *QDataStream) ReadBytes(param1 string, lenVal *uint) *QDataStream { param1_Cstring := C.CString(param1) defer C.free(unsafe.Pointer(param1_Cstring)) - return newQDataStream_U(unsafe.Pointer(C.QDataStream_ReadBytes(this.h, param1_Cstring, (*C.uint)(unsafe.Pointer(lenVal))))) + return UnsafeNewQDataStream(unsafe.Pointer(C.QDataStream_ReadBytes(this.h, param1_Cstring, (*C.uint)(unsafe.Pointer(lenVal))))) } func (this *QDataStream) ReadRawData(param1 string, lenVal int) int { @@ -341,6 +348,13 @@ func (this *QtPrivate__StreamStateSaver) cPointer() *C.QtPrivate__StreamStateSav return this.h } +func (this *QtPrivate__StreamStateSaver) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__StreamStateSaver(h *C.QtPrivate__StreamStateSaver) *QtPrivate__StreamStateSaver { if h == nil { return nil @@ -348,7 +362,7 @@ func newQtPrivate__StreamStateSaver(h *C.QtPrivate__StreamStateSaver) *QtPrivate return &QtPrivate__StreamStateSaver{h: h} } -func newQtPrivate__StreamStateSaver_U(h unsafe.Pointer) *QtPrivate__StreamStateSaver { +func UnsafeNewQtPrivate__StreamStateSaver(h unsafe.Pointer) *QtPrivate__StreamStateSaver { return newQtPrivate__StreamStateSaver((*C.QtPrivate__StreamStateSaver)(h)) } diff --git a/qt/gen_qdatastream.h b/qt/gen_qdatastream.h index ac9982c9..932dd137 100644 --- a/qt/gen_qdatastream.h +++ b/qt/gen_qdatastream.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdatawidgetmapper.cpp b/qt/gen_qdatawidgetmapper.cpp index a57ad43f..fdb0eb99 100644 --- a/qt/gen_qdatawidgetmapper.cpp +++ b/qt/gen_qdatawidgetmapper.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qdatawidgetmapper.h" +#include #include "gen_qdatawidgetmapper.h" #include "_cgo_export.h" diff --git a/qt/gen_qdatawidgetmapper.go b/qt/gen_qdatawidgetmapper.go index c9ddb1ed..aa95bd07 100644 --- a/qt/gen_qdatawidgetmapper.go +++ b/qt/gen_qdatawidgetmapper.go @@ -33,14 +33,21 @@ func (this *QDataWidgetMapper) cPointer() *C.QDataWidgetMapper { return this.h } +func (this *QDataWidgetMapper) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDataWidgetMapper(h *C.QDataWidgetMapper) *QDataWidgetMapper { if h == nil { return nil } - return &QDataWidgetMapper{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QDataWidgetMapper{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQDataWidgetMapper_U(h unsafe.Pointer) *QDataWidgetMapper { +func UnsafeNewQDataWidgetMapper(h unsafe.Pointer) *QDataWidgetMapper { return newQDataWidgetMapper((*C.QDataWidgetMapper)(h)) } @@ -57,7 +64,7 @@ func NewQDataWidgetMapper2(parent *QObject) *QDataWidgetMapper { } func (this *QDataWidgetMapper) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDataWidgetMapper_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDataWidgetMapper_MetaObject(this.h))) } func (this *QDataWidgetMapper) Metacast(param1 string) unsafe.Pointer { @@ -89,7 +96,7 @@ func (this *QDataWidgetMapper) SetModel(model *QAbstractItemModel) { } func (this *QDataWidgetMapper) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QDataWidgetMapper_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QDataWidgetMapper_Model(this.h))) } func (this *QDataWidgetMapper) SetItemDelegate(delegate *QAbstractItemDelegate) { @@ -97,7 +104,7 @@ func (this *QDataWidgetMapper) SetItemDelegate(delegate *QAbstractItemDelegate) } func (this *QDataWidgetMapper) ItemDelegate() *QAbstractItemDelegate { - return newQAbstractItemDelegate_U(unsafe.Pointer(C.QDataWidgetMapper_ItemDelegate(this.h))) + return UnsafeNewQAbstractItemDelegate(unsafe.Pointer(C.QDataWidgetMapper_ItemDelegate(this.h))) } func (this *QDataWidgetMapper) SetRootIndex(index *QModelIndex) { @@ -151,7 +158,7 @@ func (this *QDataWidgetMapper) MappedPropertyName(widget *QWidget) *QByteArray { } func (this *QDataWidgetMapper) MappedWidgetAt(section int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QDataWidgetMapper_MappedWidgetAt(this.h, (C.int)(section)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QDataWidgetMapper_MappedWidgetAt(this.h, (C.int)(section)))) } func (this *QDataWidgetMapper) ClearMapping() { diff --git a/qt/gen_qdatawidgetmapper.h b/qt/gen_qdatawidgetmapper.h index f001bce2..db84f927 100644 --- a/qt/gen_qdatawidgetmapper.h +++ b/qt/gen_qdatawidgetmapper.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdatetime.cpp b/qt/gen_qdatetime.cpp index 853236da..aabc96bf 100644 --- a/qt/gen_qdatetime.cpp +++ b/qt/gen_qdatetime.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qdatetime.h" +#include #include "gen_qdatetime.h" #include "_cgo_export.h" diff --git a/qt/gen_qdatetime.go b/qt/gen_qdatetime.go index c69fc7ba..0ca2aa82 100644 --- a/qt/gen_qdatetime.go +++ b/qt/gen_qdatetime.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -38,6 +39,13 @@ func (this *QDate) cPointer() *C.QDate { return this.h } +func (this *QDate) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDate(h *C.QDate) *QDate { if h == nil { return nil @@ -45,7 +53,7 @@ func newQDate(h *C.QDate) *QDate { return &QDate{h: h} } -func newQDate_U(h unsafe.Pointer) *QDate { +func UnsafeNewQDate(h unsafe.Pointer) *QDate { return newQDate((*C.QDate)(h)) } @@ -212,7 +220,7 @@ func (this *QDate) ToString2(format DateFormat, cal QCalendar) string { } func (this *QDate) ToStringWithFormat(format string) string { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) var _ms *C.struct_miqt_string = C.QDate_ToStringWithFormat(this.h, (*C.struct_miqt_string)(format_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -221,7 +229,7 @@ func (this *QDate) ToStringWithFormat(format string) string { } func (this *QDate) ToString3(format string, cal QCalendar) string { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) var _ms *C.struct_miqt_string = C.QDate_ToString3(this.h, (*C.struct_miqt_string)(format_ms), cal.cPointer()) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -316,7 +324,7 @@ func QDate_CurrentDate() *QDate { } func QDate_FromString(s string) *QDate { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) _ret := C.QDate_FromString((*C.struct_miqt_string)(s_ms)) _goptr := newQDate(_ret) @@ -325,9 +333,9 @@ func QDate_FromString(s string) *QDate { } func QDate_FromString2(s string, format string) *QDate { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QDate_FromString2((*C.struct_miqt_string)(s_ms), (*C.struct_miqt_string)(format_ms)) _goptr := newQDate(_ret) @@ -336,9 +344,9 @@ func QDate_FromString2(s string, format string) *QDate { } func QDate_FromString3(s string, format string, cal QCalendar) *QDate { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QDate_FromString3((*C.struct_miqt_string)(s_ms), (*C.struct_miqt_string)(format_ms), cal.cPointer()) _goptr := newQDate(_ret) @@ -433,7 +441,7 @@ func (this *QDate) ToString1(format DateFormat) string { } func QDate_FromString22(s string, f DateFormat) *QDate { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) _ret := C.QDate_FromString22((*C.struct_miqt_string)(s_ms), (C.int)(f)) _goptr := newQDate(_ret) @@ -466,6 +474,13 @@ func (this *QTime) cPointer() *C.QTime { return this.h } +func (this *QTime) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTime(h *C.QTime) *QTime { if h == nil { return nil @@ -473,7 +488,7 @@ func newQTime(h *C.QTime) *QTime { return &QTime{h: h} } -func newQTime_U(h unsafe.Pointer) *QTime { +func UnsafeNewQTime(h unsafe.Pointer) *QTime { return newQTime((*C.QTime)(h)) } @@ -539,7 +554,7 @@ func (this *QTime) ToString() string { } func (this *QTime) ToStringWithFormat(format string) string { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) var _ms *C.struct_miqt_string = C.QTime_ToStringWithFormat(this.h, (*C.struct_miqt_string)(format_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -616,7 +631,7 @@ func QTime_CurrentTime() *QTime { } func QTime_FromString(s string) *QTime { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) _ret := C.QTime_FromString((*C.struct_miqt_string)(s_ms)) _goptr := newQTime(_ret) @@ -625,9 +640,9 @@ func QTime_FromString(s string) *QTime { } func QTime_FromString2(s string, format string) *QTime { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QTime_FromString2((*C.struct_miqt_string)(s_ms), (*C.struct_miqt_string)(format_ms)) _goptr := newQTime(_ret) @@ -663,7 +678,7 @@ func (this *QTime) SetHMS4(h int, m int, s int, ms int) bool { } func QTime_FromString22(s string, f DateFormat) *QTime { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) _ret := C.QTime_FromString22((*C.struct_miqt_string)(s_ms), (C.int)(f)) _goptr := newQTime(_ret) @@ -700,6 +715,13 @@ func (this *QDateTime) cPointer() *C.QDateTime { return this.h } +func (this *QDateTime) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDateTime(h *C.QDateTime) *QDateTime { if h == nil { return nil @@ -707,7 +729,7 @@ func newQDateTime(h *C.QDateTime) *QDateTime { return &QDateTime{h: h} } -func newQDateTime_U(h unsafe.Pointer) *QDateTime { +func UnsafeNewQDateTime(h unsafe.Pointer) *QDateTime { return newQDateTime((*C.QDateTime)(h)) } @@ -847,7 +869,7 @@ func (this *QDateTime) ToString() string { } func (this *QDateTime) ToStringWithFormat(format string) string { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) var _ms *C.struct_miqt_string = C.QDateTime_ToStringWithFormat(this.h, (*C.struct_miqt_string)(format_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -856,7 +878,7 @@ func (this *QDateTime) ToStringWithFormat(format string) string { } func (this *QDateTime) ToString2(format string, cal QCalendar) string { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) var _ms *C.struct_miqt_string = C.QDateTime_ToString2(this.h, (*C.struct_miqt_string)(format_ms), cal.cPointer()) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -993,7 +1015,7 @@ func QDateTime_CurrentDateTimeUtc() *QDateTime { } func QDateTime_FromString(s string) *QDateTime { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) _ret := C.QDateTime_FromString((*C.struct_miqt_string)(s_ms)) _goptr := newQDateTime(_ret) @@ -1002,9 +1024,9 @@ func QDateTime_FromString(s string) *QDateTime { } func QDateTime_FromString2(s string, format string) *QDateTime { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QDateTime_FromString2((*C.struct_miqt_string)(s_ms), (*C.struct_miqt_string)(format_ms)) _goptr := newQDateTime(_ret) @@ -1013,9 +1035,9 @@ func QDateTime_FromString2(s string, format string) *QDateTime { } func QDateTime_FromString3(s string, format string, cal QCalendar) *QDateTime { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QDateTime_FromString3((*C.struct_miqt_string)(s_ms), (*C.struct_miqt_string)(format_ms), cal.cPointer()) _goptr := newQDateTime(_ret) @@ -1103,7 +1125,7 @@ func (this *QDateTime) ToString1(format DateFormat) string { } func QDateTime_FromString22(s string, f DateFormat) *QDateTime { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) _ret := C.QDateTime_FromString22((*C.struct_miqt_string)(s_ms), (C.int)(f)) _goptr := newQDateTime(_ret) diff --git a/qt/gen_qdatetime.h b/qt/gen_qdatetime.h index 99d5dd01..7b097f27 100644 --- a/qt/gen_qdatetime.h +++ b/qt/gen_qdatetime.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdatetimeedit.cpp b/qt/gen_qdatetimeedit.cpp index 6ba66968..896d77db 100644 --- a/qt/gen_qdatetimeedit.cpp +++ b/qt/gen_qdatetimeedit.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qdatetimeedit.h" +#include #include "gen_qdatetimeedit.h" #include "_cgo_export.h" diff --git a/qt/gen_qdatetimeedit.go b/qt/gen_qdatetimeedit.go index fd7012ee..bf6707cd 100644 --- a/qt/gen_qdatetimeedit.go +++ b/qt/gen_qdatetimeedit.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -42,14 +43,21 @@ func (this *QDateTimeEdit) cPointer() *C.QDateTimeEdit { return this.h } +func (this *QDateTimeEdit) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDateTimeEdit(h *C.QDateTimeEdit) *QDateTimeEdit { if h == nil { return nil } - return &QDateTimeEdit{h: h, QAbstractSpinBox: newQAbstractSpinBox_U(unsafe.Pointer(h))} + return &QDateTimeEdit{h: h, QAbstractSpinBox: UnsafeNewQAbstractSpinBox(unsafe.Pointer(h))} } -func newQDateTimeEdit_U(h unsafe.Pointer) *QDateTimeEdit { +func UnsafeNewQDateTimeEdit(h unsafe.Pointer) *QDateTimeEdit { return newQDateTimeEdit((*C.QDateTimeEdit)(h)) } @@ -102,7 +110,7 @@ func NewQDateTimeEdit8(t *QTime, parent *QWidget) *QDateTimeEdit { } func (this *QDateTimeEdit) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDateTimeEdit_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDateTimeEdit_MetaObject(this.h))) } func (this *QDateTimeEdit) Metacast(param1 string) unsafe.Pointer { @@ -288,7 +296,7 @@ func (this *QDateTimeEdit) SetCurrentSectionIndex(index int) { } func (this *QDateTimeEdit) CalendarWidget() *QCalendarWidget { - return newQCalendarWidget_U(unsafe.Pointer(C.QDateTimeEdit_CalendarWidget(this.h))) + return UnsafeNewQCalendarWidget(unsafe.Pointer(C.QDateTimeEdit_CalendarWidget(this.h))) } func (this *QDateTimeEdit) SetCalendarWidget(calendarWidget *QCalendarWidget) { @@ -318,7 +326,7 @@ func (this *QDateTimeEdit) DisplayFormat() string { } func (this *QDateTimeEdit) SetDisplayFormat(format string) { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) C.QDateTimeEdit_SetDisplayFormat(this.h, (*C.struct_miqt_string)(format_ms)) } @@ -373,7 +381,7 @@ func miqt_exec_callback_QDateTimeEdit_DateTimeChanged(cb C.intptr_t, dateTime *C } // Convert all CABI parameters to Go parameters - slotval1 := newQDateTime_U(unsafe.Pointer(dateTime)) + slotval1 := UnsafeNewQDateTime(unsafe.Pointer(dateTime)) gofunc(slotval1) } @@ -393,7 +401,7 @@ func miqt_exec_callback_QDateTimeEdit_TimeChanged(cb C.intptr_t, time *C.QTime) } // Convert all CABI parameters to Go parameters - slotval1 := newQTime_U(unsafe.Pointer(time)) + slotval1 := UnsafeNewQTime(unsafe.Pointer(time)) gofunc(slotval1) } @@ -413,7 +421,7 @@ func miqt_exec_callback_QDateTimeEdit_DateChanged(cb C.intptr_t, date *C.QDate) } // Convert all CABI parameters to Go parameters - slotval1 := newQDate_U(unsafe.Pointer(date)) + slotval1 := UnsafeNewQDate(unsafe.Pointer(date)) gofunc(slotval1) } @@ -500,14 +508,21 @@ func (this *QTimeEdit) cPointer() *C.QTimeEdit { return this.h } +func (this *QTimeEdit) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTimeEdit(h *C.QTimeEdit) *QTimeEdit { if h == nil { return nil } - return &QTimeEdit{h: h, QDateTimeEdit: newQDateTimeEdit_U(unsafe.Pointer(h))} + return &QTimeEdit{h: h, QDateTimeEdit: UnsafeNewQDateTimeEdit(unsafe.Pointer(h))} } -func newQTimeEdit_U(h unsafe.Pointer) *QTimeEdit { +func UnsafeNewQTimeEdit(h unsafe.Pointer) *QTimeEdit { return newQTimeEdit((*C.QTimeEdit)(h)) } @@ -536,7 +551,7 @@ func NewQTimeEdit4(time *QTime, parent *QWidget) *QTimeEdit { } func (this *QTimeEdit) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTimeEdit_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTimeEdit_MetaObject(this.h))) } func (this *QTimeEdit) Metacast(param1 string) unsafe.Pointer { @@ -578,7 +593,7 @@ func miqt_exec_callback_QTimeEdit_UserTimeChanged(cb C.intptr_t, time *C.QTime) } // Convert all CABI parameters to Go parameters - slotval1 := newQTime_U(unsafe.Pointer(time)) + slotval1 := UnsafeNewQTime(unsafe.Pointer(time)) gofunc(slotval1) } @@ -653,14 +668,21 @@ func (this *QDateEdit) cPointer() *C.QDateEdit { return this.h } +func (this *QDateEdit) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDateEdit(h *C.QDateEdit) *QDateEdit { if h == nil { return nil } - return &QDateEdit{h: h, QDateTimeEdit: newQDateTimeEdit_U(unsafe.Pointer(h))} + return &QDateEdit{h: h, QDateTimeEdit: UnsafeNewQDateTimeEdit(unsafe.Pointer(h))} } -func newQDateEdit_U(h unsafe.Pointer) *QDateEdit { +func UnsafeNewQDateEdit(h unsafe.Pointer) *QDateEdit { return newQDateEdit((*C.QDateEdit)(h)) } @@ -689,7 +711,7 @@ func NewQDateEdit4(date *QDate, parent *QWidget) *QDateEdit { } func (this *QDateEdit) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDateEdit_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDateEdit_MetaObject(this.h))) } func (this *QDateEdit) Metacast(param1 string) unsafe.Pointer { @@ -731,7 +753,7 @@ func miqt_exec_callback_QDateEdit_UserDateChanged(cb C.intptr_t, date *C.QDate) } // Convert all CABI parameters to Go parameters - slotval1 := newQDate_U(unsafe.Pointer(date)) + slotval1 := UnsafeNewQDate(unsafe.Pointer(date)) gofunc(slotval1) } diff --git a/qt/gen_qdatetimeedit.h b/qt/gen_qdatetimeedit.h index 071a31aa..39f34a68 100644 --- a/qt/gen_qdatetimeedit.h +++ b/qt/gen_qdatetimeedit.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdeadlinetimer.cpp b/qt/gen_qdeadlinetimer.cpp index cbf1e5c2..2a93ec7b 100644 --- a/qt/gen_qdeadlinetimer.cpp +++ b/qt/gen_qdeadlinetimer.cpp @@ -1,5 +1,5 @@ #include -#include "qdeadlinetimer.h" +#include #include "gen_qdeadlinetimer.h" #include "_cgo_export.h" diff --git a/qt/gen_qdeadlinetimer.go b/qt/gen_qdeadlinetimer.go index 3337e657..04b53016 100644 --- a/qt/gen_qdeadlinetimer.go +++ b/qt/gen_qdeadlinetimer.go @@ -30,6 +30,13 @@ func (this *QDeadlineTimer) cPointer() *C.QDeadlineTimer { return this.h } +func (this *QDeadlineTimer) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDeadlineTimer(h *C.QDeadlineTimer) *QDeadlineTimer { if h == nil { return nil @@ -37,7 +44,7 @@ func newQDeadlineTimer(h *C.QDeadlineTimer) *QDeadlineTimer { return &QDeadlineTimer{h: h} } -func newQDeadlineTimer_U(h unsafe.Pointer) *QDeadlineTimer { +func UnsafeNewQDeadlineTimer(h unsafe.Pointer) *QDeadlineTimer { return newQDeadlineTimer((*C.QDeadlineTimer)(h)) } @@ -150,11 +157,11 @@ func QDeadlineTimer_Current() *QDeadlineTimer { } func (this *QDeadlineTimer) OperatorPlusAssign(msecs int64) *QDeadlineTimer { - return newQDeadlineTimer_U(unsafe.Pointer(C.QDeadlineTimer_OperatorPlusAssign(this.h, (C.longlong)(msecs)))) + return UnsafeNewQDeadlineTimer(unsafe.Pointer(C.QDeadlineTimer_OperatorPlusAssign(this.h, (C.longlong)(msecs)))) } func (this *QDeadlineTimer) OperatorMinusAssign(msecs int64) *QDeadlineTimer { - return newQDeadlineTimer_U(unsafe.Pointer(C.QDeadlineTimer_OperatorMinusAssign(this.h, (C.longlong)(msecs)))) + return UnsafeNewQDeadlineTimer(unsafe.Pointer(C.QDeadlineTimer_OperatorMinusAssign(this.h, (C.longlong)(msecs)))) } func (this *QDeadlineTimer) OperatorAssign(param1 *QDeadlineTimer) { diff --git a/qt/gen_qdeadlinetimer.h b/qt/gen_qdeadlinetimer.h index a4db5bfb..bae9d82c 100644 --- a/qt/gen_qdeadlinetimer.h +++ b/qt/gen_qdeadlinetimer.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdebug.cpp b/qt/gen_qdebug.cpp index 888ea3b7..f4e88fc6 100644 --- a/qt/gen_qdebug.cpp +++ b/qt/gen_qdebug.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qdebug.h" +#include #include "gen_qdebug.h" #include "_cgo_export.h" diff --git a/qt/gen_qdebug.go b/qt/gen_qdebug.go index cefe1a29..6bf405fa 100644 --- a/qt/gen_qdebug.go +++ b/qt/gen_qdebug.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -32,6 +33,13 @@ func (this *QDebug) cPointer() *C.QDebug { return this.h } +func (this *QDebug) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDebug(h *C.QDebug) *QDebug { if h == nil { return nil @@ -39,7 +47,7 @@ func newQDebug(h *C.QDebug) *QDebug { return &QDebug{h: h} } -func newQDebug_U(h unsafe.Pointer) *QDebug { +func UnsafeNewQDebug(h unsafe.Pointer) *QDebug { return newQDebug((*C.QDebug)(h)) } @@ -64,23 +72,23 @@ func (this *QDebug) Swap(other *QDebug) { } func (this *QDebug) ResetFormat() *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_ResetFormat(this.h))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_ResetFormat(this.h))) } func (this *QDebug) Space() *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_Space(this.h))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_Space(this.h))) } func (this *QDebug) Nospace() *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_Nospace(this.h))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_Nospace(this.h))) } func (this *QDebug) MaybeSpace() *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_MaybeSpace(this.h))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_MaybeSpace(this.h))) } func (this *QDebug) Verbosity(verbosityLevel int) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_Verbosity(this.h, (C.int)(verbosityLevel)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_Verbosity(this.h, (C.int)(verbosityLevel)))) } func (this *QDebug) Verbosity2() int { @@ -100,91 +108,91 @@ func (this *QDebug) SetAutoInsertSpaces(b bool) { } func (this *QDebug) Quote() *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_Quote(this.h))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_Quote(this.h))) } func (this *QDebug) Noquote() *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_Noquote(this.h))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_Noquote(this.h))) } func (this *QDebug) MaybeQuote() *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_MaybeQuote(this.h))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_MaybeQuote(this.h))) } func (this *QDebug) OperatorShiftLeft(t QChar) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeft(this.h, t.cPointer()))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeft(this.h, t.cPointer()))) } func (this *QDebug) OperatorShiftLeftWithBool(t bool) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithBool(this.h, (C.bool)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithBool(this.h, (C.bool)(t)))) } func (this *QDebug) OperatorShiftLeftWithChar(t int8) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithChar(this.h, (C.char)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithChar(this.h, (C.char)(t)))) } func (this *QDebug) OperatorShiftLeftWithShort(t int16) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithShort(this.h, (C.int16_t)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithShort(this.h, (C.int16_t)(t)))) } func (this *QDebug) OperatorShiftLeftWithUnsignedshort(t uint16) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithUnsignedshort(this.h, (C.uint16_t)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithUnsignedshort(this.h, (C.uint16_t)(t)))) } func (this *QDebug) OperatorShiftLeftWithInt(t int) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithInt(this.h, (C.int)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithInt(this.h, (C.int)(t)))) } func (this *QDebug) OperatorShiftLeftWithUnsignedint(t uint) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithUnsignedint(this.h, (C.uint)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithUnsignedint(this.h, (C.uint)(t)))) } func (this *QDebug) OperatorShiftLeftWithLong(t int64) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithLong(this.h, (C.long)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithLong(this.h, (C.long)(t)))) } func (this *QDebug) OperatorShiftLeftWithUnsignedlong(t uint64) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithUnsignedlong(this.h, (C.ulong)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithUnsignedlong(this.h, (C.ulong)(t)))) } func (this *QDebug) OperatorShiftLeftWithQint64(t int64) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQint64(this.h, (C.longlong)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQint64(this.h, (C.longlong)(t)))) } func (this *QDebug) OperatorShiftLeftWithQuint64(t uint64) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQuint64(this.h, (C.ulonglong)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQuint64(this.h, (C.ulonglong)(t)))) } func (this *QDebug) OperatorShiftLeftWithFloat(t float32) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithFloat(this.h, (C.float)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithFloat(this.h, (C.float)(t)))) } func (this *QDebug) OperatorShiftLeftWithDouble(t float64) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithDouble(this.h, (C.double)(t)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithDouble(this.h, (C.double)(t)))) } func (this *QDebug) OperatorShiftLeft2(t string) *QDebug { t_Cstring := C.CString(t) defer C.free(unsafe.Pointer(t_Cstring)) - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeft2(this.h, t_Cstring))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeft2(this.h, t_Cstring))) } func (this *QDebug) OperatorShiftLeftWithQString(t string) *QDebug { - t_ms := miqt_strdupg(t) + t_ms := libmiqt.Strdupg(t) defer C.free(t_ms) - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQString(this.h, (*C.struct_miqt_string)(t_ms)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQString(this.h, (*C.struct_miqt_string)(t_ms)))) } func (this *QDebug) OperatorShiftLeftWithQByteArray(t *QByteArray) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQByteArray(this.h, t.cPointer()))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithQByteArray(this.h, t.cPointer()))) } func (this *QDebug) OperatorShiftLeftWithVoid(t unsafe.Pointer) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithVoid(this.h, t))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_OperatorShiftLeftWithVoid(this.h, t))) } func (this *QDebug) MaybeQuote1(c int8) *QDebug { - return newQDebug_U(unsafe.Pointer(C.QDebug_MaybeQuote1(this.h, (C.char)(c)))) + return UnsafeNewQDebug(unsafe.Pointer(C.QDebug_MaybeQuote1(this.h, (C.char)(c)))) } // Delete this object from C++ memory. @@ -212,6 +220,13 @@ func (this *QDebugStateSaver) cPointer() *C.QDebugStateSaver { return this.h } +func (this *QDebugStateSaver) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDebugStateSaver(h *C.QDebugStateSaver) *QDebugStateSaver { if h == nil { return nil @@ -219,7 +234,7 @@ func newQDebugStateSaver(h *C.QDebugStateSaver) *QDebugStateSaver { return &QDebugStateSaver{h: h} } -func newQDebugStateSaver_U(h unsafe.Pointer) *QDebugStateSaver { +func UnsafeNewQDebugStateSaver(h unsafe.Pointer) *QDebugStateSaver { return newQDebugStateSaver((*C.QDebugStateSaver)(h)) } @@ -254,6 +269,13 @@ func (this *QNoDebug) cPointer() *C.QNoDebug { return this.h } +func (this *QNoDebug) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQNoDebug(h *C.QNoDebug) *QNoDebug { if h == nil { return nil @@ -261,40 +283,40 @@ func newQNoDebug(h *C.QNoDebug) *QNoDebug { return &QNoDebug{h: h} } -func newQNoDebug_U(h unsafe.Pointer) *QNoDebug { +func UnsafeNewQNoDebug(h unsafe.Pointer) *QNoDebug { return newQNoDebug((*C.QNoDebug)(h)) } func (this *QNoDebug) Space() *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_Space(this.h))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_Space(this.h))) } func (this *QNoDebug) Nospace() *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_Nospace(this.h))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_Nospace(this.h))) } func (this *QNoDebug) MaybeSpace() *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_MaybeSpace(this.h))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_MaybeSpace(this.h))) } func (this *QNoDebug) Quote() *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_Quote(this.h))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_Quote(this.h))) } func (this *QNoDebug) Noquote() *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_Noquote(this.h))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_Noquote(this.h))) } func (this *QNoDebug) MaybeQuote() *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_MaybeQuote(this.h))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_MaybeQuote(this.h))) } func (this *QNoDebug) Verbosity(param1 int) *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_Verbosity(this.h, (C.int)(param1)))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_Verbosity(this.h, (C.int)(param1)))) } func (this *QNoDebug) MaybeQuote1(param1 int8) *QNoDebug { - return newQNoDebug_U(unsafe.Pointer(C.QNoDebug_MaybeQuote1(this.h, (C.char)(param1)))) + return UnsafeNewQNoDebug(unsafe.Pointer(C.QNoDebug_MaybeQuote1(this.h, (C.const_char)(param1)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qdebug.h b/qt/gen_qdebug.h index d0730aa5..e395ffa4 100644 --- a/qt/gen_qdebug.h +++ b/qt/gen_qdebug.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdesktopservices.cpp b/qt/gen_qdesktopservices.cpp index 3cceabab..9511f1a8 100644 --- a/qt/gen_qdesktopservices.cpp +++ b/qt/gen_qdesktopservices.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qdesktopservices.h" +#include #include "gen_qdesktopservices.h" #include "_cgo_export.h" diff --git a/qt/gen_qdesktopservices.go b/qt/gen_qdesktopservices.go index d04de273..93ea1b34 100644 --- a/qt/gen_qdesktopservices.go +++ b/qt/gen_qdesktopservices.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QDesktopServices) cPointer() *C.QDesktopServices { return this.h } +func (this *QDesktopServices) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDesktopServices(h *C.QDesktopServices) *QDesktopServices { if h == nil { return nil @@ -31,7 +39,7 @@ func newQDesktopServices(h *C.QDesktopServices) *QDesktopServices { return &QDesktopServices{h: h} } -func newQDesktopServices_U(h unsafe.Pointer) *QDesktopServices { +func UnsafeNewQDesktopServices(h unsafe.Pointer) *QDesktopServices { return newQDesktopServices((*C.QDesktopServices)(h)) } @@ -40,7 +48,7 @@ func QDesktopServices_OpenUrl(url *QUrl) bool { } func QDesktopServices_SetUrlHandler(scheme string, receiver *QObject, method string) { - scheme_ms := miqt_strdupg(scheme) + scheme_ms := libmiqt.Strdupg(scheme) defer C.free(scheme_ms) method_Cstring := C.CString(method) defer C.free(unsafe.Pointer(method_Cstring)) @@ -48,7 +56,7 @@ func QDesktopServices_SetUrlHandler(scheme string, receiver *QObject, method str } func QDesktopServices_UnsetUrlHandler(scheme string) { - scheme_ms := miqt_strdupg(scheme) + scheme_ms := libmiqt.Strdupg(scheme) defer C.free(scheme_ms) C.QDesktopServices_UnsetUrlHandler((*C.struct_miqt_string)(scheme_ms)) } diff --git a/qt/gen_qdesktopservices.h b/qt/gen_qdesktopservices.h index 4a8b7d4c..b6d00040 100644 --- a/qt/gen_qdesktopservices.h +++ b/qt/gen_qdesktopservices.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdesktopwidget.cpp b/qt/gen_qdesktopwidget.cpp index ebe82019..1270d331 100644 --- a/qt/gen_qdesktopwidget.cpp +++ b/qt/gen_qdesktopwidget.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qdesktopwidget.h" +#include #include "gen_qdesktopwidget.h" #include "_cgo_export.h" diff --git a/qt/gen_qdesktopwidget.go b/qt/gen_qdesktopwidget.go index e5681d18..26ed0051 100644 --- a/qt/gen_qdesktopwidget.go +++ b/qt/gen_qdesktopwidget.go @@ -26,14 +26,21 @@ func (this *QDesktopWidget) cPointer() *C.QDesktopWidget { return this.h } +func (this *QDesktopWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDesktopWidget(h *C.QDesktopWidget) *QDesktopWidget { if h == nil { return nil } - return &QDesktopWidget{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QDesktopWidget{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQDesktopWidget_U(h unsafe.Pointer) *QDesktopWidget { +func UnsafeNewQDesktopWidget(h unsafe.Pointer) *QDesktopWidget { return newQDesktopWidget((*C.QDesktopWidget)(h)) } @@ -44,7 +51,7 @@ func NewQDesktopWidget() *QDesktopWidget { } func (this *QDesktopWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDesktopWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDesktopWidget_MetaObject(this.h))) } func (this *QDesktopWidget) Metacast(param1 string) unsafe.Pointer { @@ -110,7 +117,7 @@ func (this *QDesktopWidget) ScreenNumberWithQPoint(param1 *QPoint) int { } func (this *QDesktopWidget) Screen() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QDesktopWidget_Screen(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QDesktopWidget_Screen(this.h))) } func (this *QDesktopWidget) ScreenGeometry2() *QRect { @@ -267,7 +274,7 @@ func (this *QDesktopWidget) ScreenNumber1(widget *QWidget) int { } func (this *QDesktopWidget) Screen1(screen int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QDesktopWidget_Screen1(this.h, (C.int)(screen)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QDesktopWidget_Screen1(this.h, (C.int)(screen)))) } func (this *QDesktopWidget) ScreenGeometry1(screen int) *QRect { diff --git a/qt/gen_qdesktopwidget.h b/qt/gen_qdesktopwidget.h index 3ff94c3c..798240b7 100644 --- a/qt/gen_qdesktopwidget.h +++ b/qt/gen_qdesktopwidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdial.cpp b/qt/gen_qdial.cpp index 0e993dd8..3963ed90 100644 --- a/qt/gen_qdial.cpp +++ b/qt/gen_qdial.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qdial.h" +#include #include "gen_qdial.h" #include "_cgo_export.h" diff --git a/qt/gen_qdial.go b/qt/gen_qdial.go index b98c4942..eab42b17 100644 --- a/qt/gen_qdial.go +++ b/qt/gen_qdial.go @@ -25,14 +25,21 @@ func (this *QDial) cPointer() *C.QDial { return this.h } +func (this *QDial) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDial(h *C.QDial) *QDial { if h == nil { return nil } - return &QDial{h: h, QAbstractSlider: newQAbstractSlider_U(unsafe.Pointer(h))} + return &QDial{h: h, QAbstractSlider: UnsafeNewQAbstractSlider(unsafe.Pointer(h))} } -func newQDial_U(h unsafe.Pointer) *QDial { +func UnsafeNewQDial(h unsafe.Pointer) *QDial { return newQDial((*C.QDial)(h)) } @@ -49,7 +56,7 @@ func NewQDial2(parent *QWidget) *QDial { } func (this *QDial) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDial_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDial_MetaObject(this.h))) } func (this *QDial) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qdial.h b/qt/gen_qdial.h index cae6bf0d..32420240 100644 --- a/qt/gen_qdial.h +++ b/qt/gen_qdial.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdialog.cpp b/qt/gen_qdialog.cpp index cb13c980..af90afdf 100644 --- a/qt/gen_qdialog.cpp +++ b/qt/gen_qdialog.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qdialog.h" +#include #include "gen_qdialog.h" #include "_cgo_export.h" diff --git a/qt/gen_qdialog.go b/qt/gen_qdialog.go index 11586d5f..2330bddb 100644 --- a/qt/gen_qdialog.go +++ b/qt/gen_qdialog.go @@ -33,14 +33,21 @@ func (this *QDialog) cPointer() *C.QDialog { return this.h } +func (this *QDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDialog(h *C.QDialog) *QDialog { if h == nil { return nil } - return &QDialog{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QDialog{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQDialog_U(h unsafe.Pointer) *QDialog { +func UnsafeNewQDialog(h unsafe.Pointer) *QDialog { return newQDialog((*C.QDialog)(h)) } @@ -63,7 +70,7 @@ func NewQDialog3(parent *QWidget, f WindowType) *QDialog { } func (this *QDialog) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDialog_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDialog_MetaObject(this.h))) } func (this *QDialog) Metacast(param1 string) unsafe.Pointer { @@ -111,7 +118,7 @@ func (this *QDialog) SetExtension(extension *QWidget) { } func (this *QDialog) Extension() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QDialog_Extension(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QDialog_Extension(this.h))) } func (this *QDialog) SizeHint() *QSize { diff --git a/qt/gen_qdialog.h b/qt/gen_qdialog.h index 34537032..e4132036 100644 --- a/qt/gen_qdialog.h +++ b/qt/gen_qdialog.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdialogbuttonbox.cpp b/qt/gen_qdialogbuttonbox.cpp index b7e1200a..a9fc7eab 100644 --- a/qt/gen_qdialogbuttonbox.cpp +++ b/qt/gen_qdialogbuttonbox.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qdialogbuttonbox.h" +#include #include "gen_qdialogbuttonbox.h" #include "_cgo_export.h" diff --git a/qt/gen_qdialogbuttonbox.go b/qt/gen_qdialogbuttonbox.go index a8282f2f..c01e82b4 100644 --- a/qt/gen_qdialogbuttonbox.go +++ b/qt/gen_qdialogbuttonbox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -78,14 +79,21 @@ func (this *QDialogButtonBox) cPointer() *C.QDialogButtonBox { return this.h } +func (this *QDialogButtonBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDialogButtonBox(h *C.QDialogButtonBox) *QDialogButtonBox { if h == nil { return nil } - return &QDialogButtonBox{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QDialogButtonBox{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQDialogButtonBox_U(h unsafe.Pointer) *QDialogButtonBox { +func UnsafeNewQDialogButtonBox(h unsafe.Pointer) *QDialogButtonBox { return newQDialogButtonBox((*C.QDialogButtonBox)(h)) } @@ -138,7 +146,7 @@ func NewQDialogButtonBox8(buttons QDialogButtonBox__StandardButton, orientation } func (this *QDialogButtonBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDialogButtonBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDialogButtonBox_MetaObject(this.h))) } func (this *QDialogButtonBox) Metacast(param1 string) unsafe.Pointer { @@ -178,13 +186,13 @@ func (this *QDialogButtonBox) AddButton(button *QAbstractButton, role QDialogBut } func (this *QDialogButtonBox) AddButton2(text string, role QDialogButtonBox__ButtonRole) *QPushButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQPushButton_U(unsafe.Pointer(C.QDialogButtonBox_AddButton2(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(role)))) + return UnsafeNewQPushButton(unsafe.Pointer(C.QDialogButtonBox_AddButton2(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(role)))) } func (this *QDialogButtonBox) AddButtonWithButton(button QDialogButtonBox__StandardButton) *QPushButton { - return newQPushButton_U(unsafe.Pointer(C.QDialogButtonBox_AddButtonWithButton(this.h, (C.int)(button)))) + return UnsafeNewQPushButton(unsafe.Pointer(C.QDialogButtonBox_AddButtonWithButton(this.h, (C.int)(button)))) } func (this *QDialogButtonBox) RemoveButton(button *QAbstractButton) { @@ -200,7 +208,7 @@ func (this *QDialogButtonBox) Buttons() []*QAbstractButton { _ret := make([]*QAbstractButton, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractButton)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractButton_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractButton(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -223,7 +231,7 @@ func (this *QDialogButtonBox) StandardButton(button *QAbstractButton) QDialogBut } func (this *QDialogButtonBox) Button(which QDialogButtonBox__StandardButton) *QPushButton { - return newQPushButton_U(unsafe.Pointer(C.QDialogButtonBox_Button(this.h, (C.int)(which)))) + return UnsafeNewQPushButton(unsafe.Pointer(C.QDialogButtonBox_Button(this.h, (C.int)(which)))) } func (this *QDialogButtonBox) SetCenterButtons(center bool) { @@ -249,7 +257,7 @@ func miqt_exec_callback_QDialogButtonBox_Clicked(cb C.intptr_t, button *C.QAbstr } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractButton_U(unsafe.Pointer(button)) + slotval1 := UnsafeNewQAbstractButton(unsafe.Pointer(button)) gofunc(slotval1) } diff --git a/qt/gen_qdialogbuttonbox.h b/qt/gen_qdialogbuttonbox.h index 7db25714..b80c48d9 100644 --- a/qt/gen_qdialogbuttonbox.h +++ b/qt/gen_qdialogbuttonbox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdir.cpp b/qt/gen_qdir.cpp index d6d17f06..5c905afb 100644 --- a/qt/gen_qdir.cpp +++ b/qt/gen_qdir.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qdir.h" +#include #include "gen_qdir.h" #include "_cgo_export.h" @@ -86,7 +86,7 @@ void QDir_AddResourceSearchPath(struct miqt_string* path) { void QDir_SetSearchPaths(struct miqt_string* prefix, struct miqt_array* /* of struct miqt_string* */ searchPaths) { QString prefix_QString = QString::fromUtf8(&prefix->data, prefix->len); - QList searchPaths_QList; + QStringList searchPaths_QList; searchPaths_QList.reserve(searchPaths->len); struct miqt_string** searchPaths_arr = static_cast(searchPaths->data); for(size_t i = 0; i < searchPaths->len; ++i) { @@ -192,7 +192,7 @@ struct miqt_array* QDir_NameFilters(const QDir* self) { } void QDir_SetNameFilters(QDir* self, struct miqt_array* /* of struct miqt_string* */ nameFilters) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -270,7 +270,7 @@ struct miqt_array* QDir_EntryList(const QDir* self) { } struct miqt_array* QDir_EntryListWithNameFilters(const QDir* self, struct miqt_array* /* of struct miqt_string* */ nameFilters) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -306,7 +306,7 @@ struct miqt_array* QDir_EntryInfoList(const QDir* self) { } struct miqt_array* QDir_EntryInfoListWithNameFilters(const QDir* self, struct miqt_array* /* of struct miqt_string* */ nameFilters) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -478,7 +478,7 @@ struct miqt_string* QDir_TempPath() { } bool QDir_Match(struct miqt_array* /* of struct miqt_string* */ filters, struct miqt_string* fileName) { - QList filters_QList; + QStringList filters_QList; filters_QList.reserve(filters->len); struct miqt_string** filters_arr = static_cast(filters->data); for(size_t i = 0; i < filters->len; ++i) { @@ -544,7 +544,7 @@ struct miqt_array* QDir_EntryList2(const QDir* self, int filters, int sort) { } struct miqt_array* QDir_EntryList22(const QDir* self, struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -567,7 +567,7 @@ struct miqt_array* QDir_EntryList22(const QDir* self, struct miqt_array* /* of s } struct miqt_array* QDir_EntryList3(const QDir* self, struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters, int sort) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -616,7 +616,7 @@ struct miqt_array* QDir_EntryInfoList2(const QDir* self, int filters, int sort) } struct miqt_array* QDir_EntryInfoList22(const QDir* self, struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -636,7 +636,7 @@ struct miqt_array* QDir_EntryInfoList22(const QDir* self, struct miqt_array* /* } struct miqt_array* QDir_EntryInfoList3(const QDir* self, struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters, int sort) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { diff --git a/qt/gen_qdir.go b/qt/gen_qdir.go index 9705ad26..d81104cc 100644 --- a/qt/gen_qdir.go +++ b/qt/gen_qdir.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -66,6 +67,13 @@ func (this *QDir) cPointer() *C.QDir { return this.h } +func (this *QDir) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDir(h *C.QDir) *QDir { if h == nil { return nil @@ -73,7 +81,7 @@ func newQDir(h *C.QDir) *QDir { return &QDir{h: h} } -func newQDir_U(h unsafe.Pointer) *QDir { +func UnsafeNewQDir(h unsafe.Pointer) *QDir { return newQDir((*C.QDir)(h)) } @@ -91,9 +99,9 @@ func NewQDir2() *QDir { // NewQDir3 constructs a new QDir object. func NewQDir3(path string, nameFilter string) *QDir { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) - nameFilter_ms := miqt_strdupg(nameFilter) + nameFilter_ms := libmiqt.Strdupg(nameFilter) defer C.free(nameFilter_ms) ret := C.QDir_new3((*C.struct_miqt_string)(path_ms), (*C.struct_miqt_string)(nameFilter_ms)) return newQDir(ret) @@ -101,7 +109,7 @@ func NewQDir3(path string, nameFilter string) *QDir { // NewQDir4 constructs a new QDir object. func NewQDir4(path string) *QDir { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) ret := C.QDir_new4((*C.struct_miqt_string)(path_ms)) return newQDir(ret) @@ -109,9 +117,9 @@ func NewQDir4(path string) *QDir { // NewQDir5 constructs a new QDir object. func NewQDir5(path string, nameFilter string, sort QDir__SortFlag) *QDir { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) - nameFilter_ms := miqt_strdupg(nameFilter) + nameFilter_ms := libmiqt.Strdupg(nameFilter) defer C.free(nameFilter_ms) ret := C.QDir_new5((*C.struct_miqt_string)(path_ms), (*C.struct_miqt_string)(nameFilter_ms), (C.int)(sort)) return newQDir(ret) @@ -119,9 +127,9 @@ func NewQDir5(path string, nameFilter string, sort QDir__SortFlag) *QDir { // NewQDir6 constructs a new QDir object. func NewQDir6(path string, nameFilter string, sort QDir__SortFlag, filter QDir__Filter) *QDir { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) - nameFilter_ms := miqt_strdupg(nameFilter) + nameFilter_ms := libmiqt.Strdupg(nameFilter) defer C.free(nameFilter_ms) ret := C.QDir_new6((*C.struct_miqt_string)(path_ms), (*C.struct_miqt_string)(nameFilter_ms), (C.int)(sort), (C.int)(filter)) return newQDir(ret) @@ -132,7 +140,7 @@ func (this *QDir) OperatorAssign(param1 *QDir) { } func (this *QDir) OperatorAssignWithPath(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QDir_OperatorAssignWithPath(this.h, (*C.struct_miqt_string)(path_ms)) } @@ -142,7 +150,7 @@ func (this *QDir) Swap(other *QDir) { } func (this *QDir) SetPath(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QDir_SetPath(this.h, (*C.struct_miqt_string)(path_ms)) } @@ -169,19 +177,19 @@ func (this *QDir) CanonicalPath() string { } func QDir_AddResourceSearchPath(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QDir_AddResourceSearchPath((*C.struct_miqt_string)(path_ms)) } func QDir_SetSearchPaths(prefix string, searchPaths []string) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) // For the C ABI, malloc a C array of raw pointers searchPaths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(searchPaths)))) defer C.free(unsafe.Pointer(searchPaths_CArray)) for i := range searchPaths { - searchPaths_i_ms := miqt_strdupg(searchPaths[i]) + searchPaths_i_ms := libmiqt.Strdupg(searchPaths[i]) defer C.free(searchPaths_i_ms) searchPaths_CArray[i] = (*C.struct_miqt_string)(searchPaths_i_ms) } @@ -191,15 +199,15 @@ func QDir_SetSearchPaths(prefix string, searchPaths []string) { } func QDir_AddSearchPath(prefix string, path string) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QDir_AddSearchPath((*C.struct_miqt_string)(prefix_ms), (*C.struct_miqt_string)(path_ms)) } func QDir_SearchPaths(prefix string) []string { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) var _ma *C.struct_miqt_array = C.QDir_SearchPaths((*C.struct_miqt_string)(prefix_ms)) _ret := make([]string, int(_ma.len)) @@ -222,7 +230,7 @@ func (this *QDir) DirName() string { } func (this *QDir) FilePath(fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QDir_FilePath(this.h, (*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -231,7 +239,7 @@ func (this *QDir) FilePath(fileName string) string { } func (this *QDir) AbsoluteFilePath(fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QDir_AbsoluteFilePath(this.h, (*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -240,7 +248,7 @@ func (this *QDir) AbsoluteFilePath(fileName string) string { } func (this *QDir) RelativeFilePath(fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QDir_RelativeFilePath(this.h, (*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -249,7 +257,7 @@ func (this *QDir) RelativeFilePath(fileName string) string { } func QDir_ToNativeSeparators(pathName string) string { - pathName_ms := miqt_strdupg(pathName) + pathName_ms := libmiqt.Strdupg(pathName) defer C.free(pathName_ms) var _ms *C.struct_miqt_string = C.QDir_ToNativeSeparators((*C.struct_miqt_string)(pathName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -258,7 +266,7 @@ func QDir_ToNativeSeparators(pathName string) string { } func QDir_FromNativeSeparators(pathName string) string { - pathName_ms := miqt_strdupg(pathName) + pathName_ms := libmiqt.Strdupg(pathName) defer C.free(pathName_ms) var _ms *C.struct_miqt_string = C.QDir_FromNativeSeparators((*C.struct_miqt_string)(pathName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -267,7 +275,7 @@ func QDir_FromNativeSeparators(pathName string) string { } func (this *QDir) Cd(dirName string) bool { - dirName_ms := miqt_strdupg(dirName) + dirName_ms := libmiqt.Strdupg(dirName) defer C.free(dirName_ms) return (bool)(C.QDir_Cd(this.h, (*C.struct_miqt_string)(dirName_ms))) } @@ -295,7 +303,7 @@ func (this *QDir) SetNameFilters(nameFilters []string) { nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -336,7 +344,7 @@ func (this *QDir) OperatorSubscript(param1 int) string { } func QDir_NameFiltersFromString(nameFilter string) []string { - nameFilter_ms := miqt_strdupg(nameFilter) + nameFilter_ms := libmiqt.Strdupg(nameFilter) defer C.free(nameFilter_ms) var _ma *C.struct_miqt_array = C.QDir_NameFiltersFromString((*C.struct_miqt_string)(nameFilter_ms)) _ret := make([]string, int(_ma.len)) @@ -370,7 +378,7 @@ func (this *QDir) EntryListWithNameFilters(nameFilters []string) []string { nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -408,7 +416,7 @@ func (this *QDir) EntryInfoListWithNameFilters(nameFilters []string) []QFileInfo nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -428,25 +436,25 @@ func (this *QDir) EntryInfoListWithNameFilters(nameFilters []string) []QFileInfo } func (this *QDir) Mkdir(dirName string) bool { - dirName_ms := miqt_strdupg(dirName) + dirName_ms := libmiqt.Strdupg(dirName) defer C.free(dirName_ms) return (bool)(C.QDir_Mkdir(this.h, (*C.struct_miqt_string)(dirName_ms))) } func (this *QDir) Rmdir(dirName string) bool { - dirName_ms := miqt_strdupg(dirName) + dirName_ms := libmiqt.Strdupg(dirName) defer C.free(dirName_ms) return (bool)(C.QDir_Rmdir(this.h, (*C.struct_miqt_string)(dirName_ms))) } func (this *QDir) Mkpath(dirPath string) bool { - dirPath_ms := miqt_strdupg(dirPath) + dirPath_ms := libmiqt.Strdupg(dirPath) defer C.free(dirPath_ms) return (bool)(C.QDir_Mkpath(this.h, (*C.struct_miqt_string)(dirPath_ms))) } func (this *QDir) Rmpath(dirPath string) bool { - dirPath_ms := miqt_strdupg(dirPath) + dirPath_ms := libmiqt.Strdupg(dirPath) defer C.free(dirPath_ms) return (bool)(C.QDir_Rmpath(this.h, (*C.struct_miqt_string)(dirPath_ms))) } @@ -468,13 +476,13 @@ func (this *QDir) IsRoot() bool { } func QDir_IsRelativePath(path string) bool { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) return (bool)(C.QDir_IsRelativePath((*C.struct_miqt_string)(path_ms))) } func QDir_IsAbsolutePath(path string) bool { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) return (bool)(C.QDir_IsAbsolutePath((*C.struct_miqt_string)(path_ms))) } @@ -500,21 +508,21 @@ func (this *QDir) OperatorNotEqual(dir *QDir) bool { } func (this *QDir) Remove(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QDir_Remove(this.h, (*C.struct_miqt_string)(fileName_ms))) } func (this *QDir) Rename(oldName string, newName string) bool { - oldName_ms := miqt_strdupg(oldName) + oldName_ms := libmiqt.Strdupg(oldName) defer C.free(oldName_ms) - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QDir_Rename(this.h, (*C.struct_miqt_string)(oldName_ms), (*C.struct_miqt_string)(newName_ms))) } func (this *QDir) ExistsWithName(name string) bool { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (bool)(C.QDir_ExistsWithName(this.h, (*C.struct_miqt_string)(name_ms))) } @@ -548,7 +556,7 @@ func QDir_Separator() *QChar { } func QDir_SetCurrent(path string) bool { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) return (bool)(C.QDir_SetCurrent((*C.struct_miqt_string)(path_ms))) } @@ -614,27 +622,27 @@ func QDir_Match(filters []string, fileName string) bool { filters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(filters)))) defer C.free(unsafe.Pointer(filters_CArray)) for i := range filters { - filters_i_ms := miqt_strdupg(filters[i]) + filters_i_ms := libmiqt.Strdupg(filters[i]) defer C.free(filters_i_ms) filters_CArray[i] = (*C.struct_miqt_string)(filters_i_ms) } filters_ma := &C.struct_miqt_array{len: C.size_t(len(filters)), data: unsafe.Pointer(filters_CArray)} defer runtime.KeepAlive(unsafe.Pointer(filters_ma)) - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QDir_Match(filters_ma, (*C.struct_miqt_string)(fileName_ms))) } func QDir_Match2(filter string, fileName string) bool { - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QDir_Match2((*C.struct_miqt_string)(filter_ms), (*C.struct_miqt_string)(fileName_ms))) } func QDir_CleanPath(path string) string { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) var _ms *C.struct_miqt_string = C.QDir_CleanPath((*C.struct_miqt_string)(path_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -683,7 +691,7 @@ func (this *QDir) EntryList22(nameFilters []string, filters QDir__Filter) []stri nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -707,7 +715,7 @@ func (this *QDir) EntryList3(nameFilters []string, filters QDir__Filter, sort QD nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -759,7 +767,7 @@ func (this *QDir) EntryInfoList22(nameFilters []string, filters QDir__Filter) [] nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -783,7 +791,7 @@ func (this *QDir) EntryInfoList3(nameFilters []string, filters QDir__Filter, sor nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } diff --git a/qt/gen_qdir.h b/qt/gen_qdir.h index 373dc514..2668a1dd 100644 --- a/qt/gen_qdir.h +++ b/qt/gen_qdir.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdiriterator.cpp b/qt/gen_qdiriterator.cpp index b87d6abf..5ff2f05a 100644 --- a/qt/gen_qdiriterator.cpp +++ b/qt/gen_qdiriterator.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qdiriterator.h" +#include #include "gen_qdiriterator.h" #include "_cgo_export.h" @@ -25,7 +25,7 @@ QDirIterator* QDirIterator_new3(struct miqt_string* path, int filter) { QDirIterator* QDirIterator_new4(struct miqt_string* path, struct miqt_array* /* of struct miqt_string* */ nameFilters) { QString path_QString = QString::fromUtf8(&path->data, path->len); - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -51,7 +51,7 @@ QDirIterator* QDirIterator_new7(struct miqt_string* path, int filter, int flags) QDirIterator* QDirIterator_new8(struct miqt_string* path, struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters) { QString path_QString = QString::fromUtf8(&path->data, path->len); - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -63,7 +63,7 @@ QDirIterator* QDirIterator_new8(struct miqt_string* path, struct miqt_array* /* QDirIterator* QDirIterator_new9(struct miqt_string* path, struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters, int flags) { QString path_QString = QString::fromUtf8(&path->data, path->len); - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { diff --git a/qt/gen_qdiriterator.go b/qt/gen_qdiriterator.go index 2aab7489..248ac1bd 100644 --- a/qt/gen_qdiriterator.go +++ b/qt/gen_qdiriterator.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -32,6 +33,13 @@ func (this *QDirIterator) cPointer() *C.QDirIterator { return this.h } +func (this *QDirIterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDirIterator(h *C.QDirIterator) *QDirIterator { if h == nil { return nil @@ -39,7 +47,7 @@ func newQDirIterator(h *C.QDirIterator) *QDirIterator { return &QDirIterator{h: h} } -func newQDirIterator_U(h unsafe.Pointer) *QDirIterator { +func UnsafeNewQDirIterator(h unsafe.Pointer) *QDirIterator { return newQDirIterator((*C.QDirIterator)(h)) } @@ -51,7 +59,7 @@ func NewQDirIterator(dir *QDir) *QDirIterator { // NewQDirIterator2 constructs a new QDirIterator object. func NewQDirIterator2(path string) *QDirIterator { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) ret := C.QDirIterator_new2((*C.struct_miqt_string)(path_ms)) return newQDirIterator(ret) @@ -59,7 +67,7 @@ func NewQDirIterator2(path string) *QDirIterator { // NewQDirIterator3 constructs a new QDirIterator object. func NewQDirIterator3(path string, filter QDir__Filter) *QDirIterator { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) ret := C.QDirIterator_new3((*C.struct_miqt_string)(path_ms), (C.int)(filter)) return newQDirIterator(ret) @@ -67,13 +75,13 @@ func NewQDirIterator3(path string, filter QDir__Filter) *QDirIterator { // NewQDirIterator4 constructs a new QDirIterator object. func NewQDirIterator4(path string, nameFilters []string) *QDirIterator { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) // For the C ABI, malloc a C array of raw pointers nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -91,7 +99,7 @@ func NewQDirIterator5(dir *QDir, flags QDirIterator__IteratorFlag) *QDirIterator // NewQDirIterator6 constructs a new QDirIterator object. func NewQDirIterator6(path string, flags QDirIterator__IteratorFlag) *QDirIterator { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) ret := C.QDirIterator_new6((*C.struct_miqt_string)(path_ms), (C.int)(flags)) return newQDirIterator(ret) @@ -99,7 +107,7 @@ func NewQDirIterator6(path string, flags QDirIterator__IteratorFlag) *QDirIterat // NewQDirIterator7 constructs a new QDirIterator object. func NewQDirIterator7(path string, filter QDir__Filter, flags QDirIterator__IteratorFlag) *QDirIterator { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) ret := C.QDirIterator_new7((*C.struct_miqt_string)(path_ms), (C.int)(filter), (C.int)(flags)) return newQDirIterator(ret) @@ -107,13 +115,13 @@ func NewQDirIterator7(path string, filter QDir__Filter, flags QDirIterator__Iter // NewQDirIterator8 constructs a new QDirIterator object. func NewQDirIterator8(path string, nameFilters []string, filters QDir__Filter) *QDirIterator { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) // For the C ABI, malloc a C array of raw pointers nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -125,13 +133,13 @@ func NewQDirIterator8(path string, nameFilters []string, filters QDir__Filter) * // NewQDirIterator9 constructs a new QDirIterator object. func NewQDirIterator9(path string, nameFilters []string, filters QDir__Filter, flags QDirIterator__IteratorFlag) *QDirIterator { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) // For the C ABI, malloc a C array of raw pointers nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } diff --git a/qt/gen_qdiriterator.h b/qt/gen_qdiriterator.h index 59077e49..00e093e9 100644 --- a/qt/gen_qdiriterator.h +++ b/qt/gen_qdiriterator.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdirmodel.cpp b/qt/gen_qdirmodel.cpp index fe706cc9..a206f180 100644 --- a/qt/gen_qdirmodel.cpp +++ b/qt/gen_qdirmodel.cpp @@ -11,12 +11,12 @@ #include #include #include -#include "qdirmodel.h" +#include #include "gen_qdirmodel.h" #include "_cgo_export.h" QDirModel* QDirModel_new(struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters, int sort) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -31,7 +31,7 @@ QDirModel* QDirModel_new2() { } QDirModel* QDirModel_new3(struct miqt_array* /* of struct miqt_string* */ nameFilters, int filters, int sort, QObject* parent) { - QList nameFilters_QList; + QStringList nameFilters_QList; nameFilters_QList.reserve(nameFilters->len); struct miqt_string** nameFilters_arr = static_cast(nameFilters->data); for(size_t i = 0; i < nameFilters->len; ++i) { @@ -125,7 +125,7 @@ struct miqt_array* QDirModel_MimeTypes(const QDirModel* self) { } QMimeData* QDirModel_MimeData(const QDirModel* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { @@ -152,7 +152,7 @@ QFileIconProvider* QDirModel_IconProvider(const QDirModel* self) { } void QDirModel_SetNameFilters(QDirModel* self, struct miqt_array* /* of struct miqt_string* */ filters) { - QList filters_QList; + QStringList filters_QList; filters_QList.reserve(filters->len); struct miqt_string** filters_arr = static_cast(filters->data); for(size_t i = 0; i < filters->len; ++i) { diff --git a/qt/gen_qdirmodel.go b/qt/gen_qdirmodel.go index 9c9cc5bb..9c0ef9fa 100644 --- a/qt/gen_qdirmodel.go +++ b/qt/gen_qdirmodel.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -33,14 +34,21 @@ func (this *QDirModel) cPointer() *C.QDirModel { return this.h } +func (this *QDirModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDirModel(h *C.QDirModel) *QDirModel { if h == nil { return nil } - return &QDirModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))} + return &QDirModel{h: h, QAbstractItemModel: UnsafeNewQAbstractItemModel(unsafe.Pointer(h))} } -func newQDirModel_U(h unsafe.Pointer) *QDirModel { +func UnsafeNewQDirModel(h unsafe.Pointer) *QDirModel { return newQDirModel((*C.QDirModel)(h)) } @@ -50,7 +58,7 @@ func NewQDirModel(nameFilters []string, filters QDir__Filter, sort QDir__SortFla nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -72,7 +80,7 @@ func NewQDirModel3(nameFilters []string, filters QDir__Filter, sort QDir__SortFl nameFilters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(nameFilters)))) defer C.free(unsafe.Pointer(nameFilters_CArray)) for i := range nameFilters { - nameFilters_i_ms := miqt_strdupg(nameFilters[i]) + nameFilters_i_ms := libmiqt.Strdupg(nameFilters[i]) defer C.free(nameFilters_i_ms) nameFilters_CArray[i] = (*C.struct_miqt_string)(nameFilters_i_ms) } @@ -89,7 +97,7 @@ func NewQDirModel4(parent *QObject) *QDirModel { } func (this *QDirModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDirModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDirModel_MetaObject(this.h))) } func (this *QDirModel) Metacast(param1 string) unsafe.Pointer { @@ -191,7 +199,7 @@ func (this *QDirModel) MimeData(indexes []QModelIndex) *QMimeData { } indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)} defer runtime.KeepAlive(unsafe.Pointer(indexes_ma)) - return newQMimeData_U(unsafe.Pointer(C.QDirModel_MimeData(this.h, indexes_ma))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QDirModel_MimeData(this.h, indexes_ma))) } func (this *QDirModel) DropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool { @@ -207,7 +215,7 @@ func (this *QDirModel) SetIconProvider(provider *QFileIconProvider) { } func (this *QDirModel) IconProvider() *QFileIconProvider { - return newQFileIconProvider_U(unsafe.Pointer(C.QDirModel_IconProvider(this.h))) + return UnsafeNewQFileIconProvider(unsafe.Pointer(C.QDirModel_IconProvider(this.h))) } func (this *QDirModel) SetNameFilters(filters []string) { @@ -215,7 +223,7 @@ func (this *QDirModel) SetNameFilters(filters []string) { filters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(filters)))) defer C.free(unsafe.Pointer(filters_CArray)) for i := range filters { - filters_i_ms := miqt_strdupg(filters[i]) + filters_i_ms := libmiqt.Strdupg(filters[i]) defer C.free(filters_i_ms) filters_CArray[i] = (*C.struct_miqt_string)(filters_i_ms) } @@ -279,7 +287,7 @@ func (this *QDirModel) LazyChildCount() bool { } func (this *QDirModel) IndexWithPath(path string) *QModelIndex { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) _ret := C.QDirModel_IndexWithPath(this.h, (*C.struct_miqt_string)(path_ms)) _goptr := newQModelIndex(_ret) @@ -292,7 +300,7 @@ func (this *QDirModel) IsDir(index *QModelIndex) bool { } func (this *QDirModel) Mkdir(parent *QModelIndex, name string) *QModelIndex { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) _ret := C.QDirModel_Mkdir(this.h, parent.cPointer(), (*C.struct_miqt_string)(name_ms)) _goptr := newQModelIndex(_ret) @@ -426,7 +434,7 @@ func (this *QDirModel) Sort2(column int, order SortOrder) { } func (this *QDirModel) Index2(path string, column int) *QModelIndex { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) _ret := C.QDirModel_Index2(this.h, (*C.struct_miqt_string)(path_ms), (C.int)(column)) _goptr := newQModelIndex(_ret) diff --git a/qt/gen_qdirmodel.h b/qt/gen_qdirmodel.h index 91771160..209f83b9 100644 --- a/qt/gen_qdirmodel.h +++ b/qt/gen_qdirmodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdockwidget.cpp b/qt/gen_qdockwidget.cpp index 1a34cb54..ef46043a 100644 --- a/qt/gen_qdockwidget.cpp +++ b/qt/gen_qdockwidget.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qdockwidget.h" +#include #include "gen_qdockwidget.h" #include "_cgo_export.h" diff --git a/qt/gen_qdockwidget.go b/qt/gen_qdockwidget.go index ec049c06..706b77fd 100644 --- a/qt/gen_qdockwidget.go +++ b/qt/gen_qdockwidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -39,20 +40,27 @@ func (this *QDockWidget) cPointer() *C.QDockWidget { return this.h } +func (this *QDockWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDockWidget(h *C.QDockWidget) *QDockWidget { if h == nil { return nil } - return &QDockWidget{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QDockWidget{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQDockWidget_U(h unsafe.Pointer) *QDockWidget { +func UnsafeNewQDockWidget(h unsafe.Pointer) *QDockWidget { return newQDockWidget((*C.QDockWidget)(h)) } // NewQDockWidget constructs a new QDockWidget object. func NewQDockWidget(title string) *QDockWidget { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QDockWidget_new((*C.struct_miqt_string)(title_ms)) return newQDockWidget(ret) @@ -66,7 +74,7 @@ func NewQDockWidget2() *QDockWidget { // NewQDockWidget3 constructs a new QDockWidget object. func NewQDockWidget3(title string, parent *QWidget) *QDockWidget { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QDockWidget_new3((*C.struct_miqt_string)(title_ms), parent.cPointer()) return newQDockWidget(ret) @@ -74,7 +82,7 @@ func NewQDockWidget3(title string, parent *QWidget) *QDockWidget { // NewQDockWidget4 constructs a new QDockWidget object. func NewQDockWidget4(title string, parent *QWidget, flags WindowType) *QDockWidget { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QDockWidget_new4((*C.struct_miqt_string)(title_ms), parent.cPointer(), (C.int)(flags)) return newQDockWidget(ret) @@ -93,7 +101,7 @@ func NewQDockWidget6(parent *QWidget, flags WindowType) *QDockWidget { } func (this *QDockWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDockWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDockWidget_MetaObject(this.h))) } func (this *QDockWidget) Metacast(param1 string) unsafe.Pointer { @@ -121,7 +129,7 @@ func QDockWidget_TrUtf8(s string) string { } func (this *QDockWidget) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QDockWidget_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QDockWidget_Widget(this.h))) } func (this *QDockWidget) SetWidget(widget *QWidget) { @@ -157,7 +165,7 @@ func (this *QDockWidget) SetTitleBarWidget(widget *QWidget) { } func (this *QDockWidget) TitleBarWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QDockWidget_TitleBarWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QDockWidget_TitleBarWidget(this.h))) } func (this *QDockWidget) IsAreaAllowed(area DockWidgetArea) bool { @@ -165,7 +173,7 @@ func (this *QDockWidget) IsAreaAllowed(area DockWidgetArea) bool { } func (this *QDockWidget) ToggleViewAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QDockWidget_ToggleViewAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QDockWidget_ToggleViewAction(this.h))) } func (this *QDockWidget) FeaturesChanged(features QDockWidget__DockWidgetFeature) { diff --git a/qt/gen_qdockwidget.h b/qt/gen_qdockwidget.h index e7ef1632..7472aca9 100644 --- a/qt/gen_qdockwidget.h +++ b/qt/gen_qdockwidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdrag.cpp b/qt/gen_qdrag.cpp index 5ab23759..a0c1ebe9 100644 --- a/qt/gen_qdrag.cpp +++ b/qt/gen_qdrag.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qdrag.h" +#include #include "gen_qdrag.h" #include "_cgo_export.h" diff --git a/qt/gen_qdrag.go b/qt/gen_qdrag.go index 781b98e2..8e8530bd 100644 --- a/qt/gen_qdrag.go +++ b/qt/gen_qdrag.go @@ -26,14 +26,21 @@ func (this *QDrag) cPointer() *C.QDrag { return this.h } +func (this *QDrag) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDrag(h *C.QDrag) *QDrag { if h == nil { return nil } - return &QDrag{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QDrag{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQDrag_U(h unsafe.Pointer) *QDrag { +func UnsafeNewQDrag(h unsafe.Pointer) *QDrag { return newQDrag((*C.QDrag)(h)) } @@ -44,7 +51,7 @@ func NewQDrag(dragSource *QObject) *QDrag { } func (this *QDrag) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDrag_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDrag_MetaObject(this.h))) } func (this *QDrag) Metacast(param1 string) unsafe.Pointer { @@ -76,7 +83,7 @@ func (this *QDrag) SetMimeData(data *QMimeData) { } func (this *QDrag) MimeData() *QMimeData { - return newQMimeData_U(unsafe.Pointer(C.QDrag_MimeData(this.h))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QDrag_MimeData(this.h))) } func (this *QDrag) SetPixmap(pixmap *QPixmap) { @@ -102,11 +109,11 @@ func (this *QDrag) HotSpot() *QPoint { } func (this *QDrag) Source() *QObject { - return newQObject_U(unsafe.Pointer(C.QDrag_Source(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QDrag_Source(this.h))) } func (this *QDrag) Target() *QObject { - return newQObject_U(unsafe.Pointer(C.QDrag_Target(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QDrag_Target(this.h))) } func (this *QDrag) Start() DropAction { @@ -179,7 +186,7 @@ func miqt_exec_callback_QDrag_TargetChanged(cb C.intptr_t, newTarget *C.QObject) } // Convert all CABI parameters to Go parameters - slotval1 := newQObject_U(unsafe.Pointer(newTarget)) + slotval1 := UnsafeNewQObject(unsafe.Pointer(newTarget)) gofunc(slotval1) } diff --git a/qt/gen_qdrag.h b/qt/gen_qdrag.h index 4f8032d2..3f633880 100644 --- a/qt/gen_qdrag.h +++ b/qt/gen_qdrag.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qdrawutil.cpp b/qt/gen_qdrawutil.cpp index b4904743..f279b759 100644 --- a/qt/gen_qdrawutil.cpp +++ b/qt/gen_qdrawutil.cpp @@ -1,5 +1,5 @@ #include -#include "qdrawutil.h" +#include #include "gen_qdrawutil.h" #include "_cgo_export.h" diff --git a/qt/gen_qdrawutil.go b/qt/gen_qdrawutil.go index d67350c5..d159167a 100644 --- a/qt/gen_qdrawutil.go +++ b/qt/gen_qdrawutil.go @@ -42,6 +42,13 @@ func (this *QTileRules) cPointer() *C.QTileRules { return this.h } +func (this *QTileRules) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTileRules(h *C.QTileRules) *QTileRules { if h == nil { return nil @@ -49,7 +56,7 @@ func newQTileRules(h *C.QTileRules) *QTileRules { return &QTileRules{h: h} } -func newQTileRules_U(h unsafe.Pointer) *QTileRules { +func UnsafeNewQTileRules(h unsafe.Pointer) *QTileRules { return newQTileRules((*C.QTileRules)(h)) } diff --git a/qt/gen_qdrawutil.h b/qt/gen_qdrawutil.h index b8533aac..dcab4e72 100644 --- a/qt/gen_qdrawutil.h +++ b/qt/gen_qdrawutil.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qeasingcurve.cpp b/qt/gen_qeasingcurve.cpp index 59a830af..76a227a2 100644 --- a/qt/gen_qeasingcurve.cpp +++ b/qt/gen_qeasingcurve.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qeasingcurve.h" +#include #include "gen_qeasingcurve.h" #include "_cgo_export.h" diff --git a/qt/gen_qeasingcurve.go b/qt/gen_qeasingcurve.go index 45185705..0cd61dea 100644 --- a/qt/gen_qeasingcurve.go +++ b/qt/gen_qeasingcurve.go @@ -78,6 +78,13 @@ func (this *QEasingCurve) cPointer() *C.QEasingCurve { return this.h } +func (this *QEasingCurve) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQEasingCurve(h *C.QEasingCurve) *QEasingCurve { if h == nil { return nil @@ -85,7 +92,7 @@ func newQEasingCurve(h *C.QEasingCurve) *QEasingCurve { return &QEasingCurve{h: h} } -func newQEasingCurve_U(h unsafe.Pointer) *QEasingCurve { +func UnsafeNewQEasingCurve(h unsafe.Pointer) *QEasingCurve { return newQEasingCurve((*C.QEasingCurve)(h)) } diff --git a/qt/gen_qeasingcurve.h b/qt/gen_qeasingcurve.h index 9350e2d9..72694465 100644 --- a/qt/gen_qeasingcurve.h +++ b/qt/gen_qeasingcurve.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qelapsedtimer.cpp b/qt/gen_qelapsedtimer.cpp index c43ef091..fff70637 100644 --- a/qt/gen_qelapsedtimer.cpp +++ b/qt/gen_qelapsedtimer.cpp @@ -1,5 +1,5 @@ #include -#include "qelapsedtimer.h" +#include #include "gen_qelapsedtimer.h" #include "_cgo_export.h" diff --git a/qt/gen_qelapsedtimer.go b/qt/gen_qelapsedtimer.go index 5bcbd484..b117631d 100644 --- a/qt/gen_qelapsedtimer.go +++ b/qt/gen_qelapsedtimer.go @@ -34,6 +34,13 @@ func (this *QElapsedTimer) cPointer() *C.QElapsedTimer { return this.h } +func (this *QElapsedTimer) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQElapsedTimer(h *C.QElapsedTimer) *QElapsedTimer { if h == nil { return nil @@ -41,7 +48,7 @@ func newQElapsedTimer(h *C.QElapsedTimer) *QElapsedTimer { return &QElapsedTimer{h: h} } -func newQElapsedTimer_U(h unsafe.Pointer) *QElapsedTimer { +func UnsafeNewQElapsedTimer(h unsafe.Pointer) *QElapsedTimer { return newQElapsedTimer((*C.QElapsedTimer)(h)) } diff --git a/qt/gen_qelapsedtimer.h b/qt/gen_qelapsedtimer.h index 229f0687..21b90646 100644 --- a/qt/gen_qelapsedtimer.h +++ b/qt/gen_qelapsedtimer.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qendian.cpp b/qt/gen_qendian.cpp index ebff11ed..01fb9302 100644 --- a/qt/gen_qendian.cpp +++ b/qt/gen_qendian.cpp @@ -1,4 +1,4 @@ -#include "qendian.h" +#include #include "gen_qendian.h" #include "_cgo_export.h" diff --git a/qt/gen_qendian.h b/qt/gen_qendian.h index d4b9d8c3..43d79a26 100644 --- a/qt/gen_qendian.h +++ b/qt/gen_qendian.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qerrormessage.cpp b/qt/gen_qerrormessage.cpp index f2d58606..b750da0e 100644 --- a/qt/gen_qerrormessage.cpp +++ b/qt/gen_qerrormessage.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qerrormessage.h" +#include #include "gen_qerrormessage.h" #include "_cgo_export.h" diff --git a/qt/gen_qerrormessage.go b/qt/gen_qerrormessage.go index 0514ddd4..5d32f1c7 100644 --- a/qt/gen_qerrormessage.go +++ b/qt/gen_qerrormessage.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QErrorMessage) cPointer() *C.QErrorMessage { return this.h } +func (this *QErrorMessage) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQErrorMessage(h *C.QErrorMessage) *QErrorMessage { if h == nil { return nil } - return &QErrorMessage{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QErrorMessage{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQErrorMessage_U(h unsafe.Pointer) *QErrorMessage { +func UnsafeNewQErrorMessage(h unsafe.Pointer) *QErrorMessage { return newQErrorMessage((*C.QErrorMessage)(h)) } @@ -49,7 +57,7 @@ func NewQErrorMessage2(parent *QWidget) *QErrorMessage { } func (this *QErrorMessage) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QErrorMessage_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QErrorMessage_MetaObject(this.h))) } func (this *QErrorMessage) Metacast(param1 string) unsafe.Pointer { @@ -77,19 +85,19 @@ func QErrorMessage_TrUtf8(s string) string { } func QErrorMessage_QtHandler() *QErrorMessage { - return newQErrorMessage_U(unsafe.Pointer(C.QErrorMessage_QtHandler())) + return UnsafeNewQErrorMessage(unsafe.Pointer(C.QErrorMessage_QtHandler())) } func (this *QErrorMessage) ShowMessage(message string) { - message_ms := miqt_strdupg(message) + message_ms := libmiqt.Strdupg(message) defer C.free(message_ms) C.QErrorMessage_ShowMessage(this.h, (*C.struct_miqt_string)(message_ms)) } func (this *QErrorMessage) ShowMessage2(message string, typeVal string) { - message_ms := miqt_strdupg(message) + message_ms := libmiqt.Strdupg(message) defer C.free(message_ms) - typeVal_ms := miqt_strdupg(typeVal) + typeVal_ms := libmiqt.Strdupg(typeVal) defer C.free(typeVal_ms) C.QErrorMessage_ShowMessage2(this.h, (*C.struct_miqt_string)(message_ms), (*C.struct_miqt_string)(typeVal_ms)) } diff --git a/qt/gen_qerrormessage.h b/qt/gen_qerrormessage.h index 9bf729c2..9704e41e 100644 --- a/qt/gen_qerrormessage.h +++ b/qt/gen_qerrormessage.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qevent.cpp b/qt/gen_qevent.cpp index ff54c132..0ebca36a 100644 --- a/qt/gen_qevent.cpp +++ b/qt/gen_qevent.cpp @@ -60,7 +60,7 @@ #include #include #include -#include "qevent.h" +#include #include "gen_qevent.h" #include "_cgo_export.h" diff --git a/qt/gen_qevent.go b/qt/gen_qevent.go index ea6f4430..57e2dffa 100644 --- a/qt/gen_qevent.go +++ b/qt/gen_qevent.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -92,14 +93,21 @@ func (this *QInputEvent) cPointer() *C.QInputEvent { return this.h } +func (this *QInputEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQInputEvent(h *C.QInputEvent) *QInputEvent { if h == nil { return nil } - return &QInputEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QInputEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQInputEvent_U(h unsafe.Pointer) *QInputEvent { +func UnsafeNewQInputEvent(h unsafe.Pointer) *QInputEvent { return newQInputEvent((*C.QInputEvent)(h)) } @@ -163,14 +171,21 @@ func (this *QEnterEvent) cPointer() *C.QEnterEvent { return this.h } +func (this *QEnterEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQEnterEvent(h *C.QEnterEvent) *QEnterEvent { if h == nil { return nil } - return &QEnterEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QEnterEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQEnterEvent_U(h unsafe.Pointer) *QEnterEvent { +func UnsafeNewQEnterEvent(h unsafe.Pointer) *QEnterEvent { return newQEnterEvent((*C.QEnterEvent)(h)) } @@ -217,15 +232,15 @@ func (this *QEnterEvent) GlobalY() int { } func (this *QEnterEvent) LocalPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QEnterEvent_LocalPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QEnterEvent_LocalPos(this.h))) } func (this *QEnterEvent) WindowPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QEnterEvent_WindowPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QEnterEvent_WindowPos(this.h))) } func (this *QEnterEvent) ScreenPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QEnterEvent_ScreenPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QEnterEvent_ScreenPos(this.h))) } // Delete this object from C++ memory. @@ -254,14 +269,21 @@ func (this *QMouseEvent) cPointer() *C.QMouseEvent { return this.h } +func (this *QMouseEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMouseEvent(h *C.QMouseEvent) *QMouseEvent { if h == nil { return nil } - return &QMouseEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QMouseEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQMouseEvent_U(h unsafe.Pointer) *QMouseEvent { +func UnsafeNewQMouseEvent(h unsafe.Pointer) *QMouseEvent { return newQMouseEvent((*C.QMouseEvent)(h)) } @@ -326,15 +348,15 @@ func (this *QMouseEvent) GlobalY() int { } func (this *QMouseEvent) LocalPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QMouseEvent_LocalPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QMouseEvent_LocalPos(this.h))) } func (this *QMouseEvent) WindowPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QMouseEvent_WindowPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QMouseEvent_WindowPos(this.h))) } func (this *QMouseEvent) ScreenPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QMouseEvent_ScreenPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QMouseEvent_ScreenPos(this.h))) } func (this *QMouseEvent) Button() MouseButton { @@ -383,14 +405,21 @@ func (this *QHoverEvent) cPointer() *C.QHoverEvent { return this.h } +func (this *QHoverEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHoverEvent(h *C.QHoverEvent) *QHoverEvent { if h == nil { return nil } - return &QHoverEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QHoverEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQHoverEvent_U(h unsafe.Pointer) *QHoverEvent { +func UnsafeNewQHoverEvent(h unsafe.Pointer) *QHoverEvent { return newQHoverEvent((*C.QHoverEvent)(h)) } @@ -427,11 +456,11 @@ func (this *QHoverEvent) OldPos() *QPoint { } func (this *QHoverEvent) PosF() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QHoverEvent_PosF(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QHoverEvent_PosF(this.h))) } func (this *QHoverEvent) OldPosF() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QHoverEvent_OldPosF(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QHoverEvent_OldPosF(this.h))) } // Delete this object from C++ memory. @@ -460,14 +489,21 @@ func (this *QWheelEvent) cPointer() *C.QWheelEvent { return this.h } +func (this *QWheelEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWheelEvent(h *C.QWheelEvent) *QWheelEvent { if h == nil { return nil } - return &QWheelEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QWheelEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQWheelEvent_U(h unsafe.Pointer) *QWheelEvent { +func UnsafeNewQWheelEvent(h unsafe.Pointer) *QWheelEvent { return newQWheelEvent((*C.QWheelEvent)(h)) } @@ -590,11 +626,11 @@ func (this *QWheelEvent) GlobalY() int { } func (this *QWheelEvent) PosF() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QWheelEvent_PosF(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QWheelEvent_PosF(this.h))) } func (this *QWheelEvent) GlobalPosF() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QWheelEvent_GlobalPosF(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QWheelEvent_GlobalPosF(this.h))) } func (this *QWheelEvent) Position() *QPointF { @@ -653,14 +689,21 @@ func (this *QTabletEvent) cPointer() *C.QTabletEvent { return this.h } +func (this *QTabletEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTabletEvent(h *C.QTabletEvent) *QTabletEvent { if h == nil { return nil } - return &QTabletEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QTabletEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQTabletEvent_U(h unsafe.Pointer) *QTabletEvent { +func UnsafeNewQTabletEvent(h unsafe.Pointer) *QTabletEvent { return newQTabletEvent((*C.QTabletEvent)(h)) } @@ -697,11 +740,11 @@ func (this *QTabletEvent) GlobalPos() *QPoint { } func (this *QTabletEvent) PosF() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QTabletEvent_PosF(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QTabletEvent_PosF(this.h))) } func (this *QTabletEvent) GlobalPosF() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QTabletEvent_GlobalPosF(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QTabletEvent_GlobalPosF(this.h))) } func (this *QTabletEvent) X() int { @@ -802,14 +845,21 @@ func (this *QNativeGestureEvent) cPointer() *C.QNativeGestureEvent { return this.h } +func (this *QNativeGestureEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQNativeGestureEvent(h *C.QNativeGestureEvent) *QNativeGestureEvent { if h == nil { return nil } - return &QNativeGestureEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QNativeGestureEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQNativeGestureEvent_U(h unsafe.Pointer) *QNativeGestureEvent { +func UnsafeNewQNativeGestureEvent(h unsafe.Pointer) *QNativeGestureEvent { return newQNativeGestureEvent((*C.QNativeGestureEvent)(h)) } @@ -854,19 +904,19 @@ func (this *QNativeGestureEvent) GlobalPos() *QPoint { } func (this *QNativeGestureEvent) LocalPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QNativeGestureEvent_LocalPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QNativeGestureEvent_LocalPos(this.h))) } func (this *QNativeGestureEvent) WindowPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QNativeGestureEvent_WindowPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QNativeGestureEvent_WindowPos(this.h))) } func (this *QNativeGestureEvent) ScreenPos() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QNativeGestureEvent_ScreenPos(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QNativeGestureEvent_ScreenPos(this.h))) } func (this *QNativeGestureEvent) Device() *QTouchDevice { - return newQTouchDevice_U(unsafe.Pointer(C.QNativeGestureEvent_Device(this.h))) + return UnsafeNewQTouchDevice(unsafe.Pointer(C.QNativeGestureEvent_Device(this.h))) } // Delete this object from C++ memory. @@ -895,14 +945,21 @@ func (this *QKeyEvent) cPointer() *C.QKeyEvent { return this.h } +func (this *QKeyEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQKeyEvent(h *C.QKeyEvent) *QKeyEvent { if h == nil { return nil } - return &QKeyEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QKeyEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQKeyEvent_U(h unsafe.Pointer) *QKeyEvent { +func UnsafeNewQKeyEvent(h unsafe.Pointer) *QKeyEvent { return newQKeyEvent((*C.QKeyEvent)(h)) } @@ -926,7 +983,7 @@ func NewQKeyEvent3(param1 *QKeyEvent) *QKeyEvent { // NewQKeyEvent4 constructs a new QKeyEvent object. func NewQKeyEvent4(typeVal QEvent__Type, key int, modifiers KeyboardModifier, text string) *QKeyEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QKeyEvent_new4((C.int)(typeVal), (C.int)(key), (C.int)(modifiers), (*C.struct_miqt_string)(text_ms)) return newQKeyEvent(ret) @@ -934,7 +991,7 @@ func NewQKeyEvent4(typeVal QEvent__Type, key int, modifiers KeyboardModifier, te // NewQKeyEvent5 constructs a new QKeyEvent object. func NewQKeyEvent5(typeVal QEvent__Type, key int, modifiers KeyboardModifier, text string, autorep bool) *QKeyEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QKeyEvent_new5((C.int)(typeVal), (C.int)(key), (C.int)(modifiers), (*C.struct_miqt_string)(text_ms), (C.bool)(autorep)) return newQKeyEvent(ret) @@ -942,7 +999,7 @@ func NewQKeyEvent5(typeVal QEvent__Type, key int, modifiers KeyboardModifier, te // NewQKeyEvent6 constructs a new QKeyEvent object. func NewQKeyEvent6(typeVal QEvent__Type, key int, modifiers KeyboardModifier, text string, autorep bool, count uint16) *QKeyEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QKeyEvent_new6((C.int)(typeVal), (C.int)(key), (C.int)(modifiers), (*C.struct_miqt_string)(text_ms), (C.bool)(autorep), (C.uint16_t)(count)) return newQKeyEvent(ret) @@ -950,7 +1007,7 @@ func NewQKeyEvent6(typeVal QEvent__Type, key int, modifiers KeyboardModifier, te // NewQKeyEvent7 constructs a new QKeyEvent object. func NewQKeyEvent7(typeVal QEvent__Type, key int, modifiers KeyboardModifier, nativeScanCode uint, nativeVirtualKey uint, nativeModifiers uint, text string) *QKeyEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QKeyEvent_new7((C.int)(typeVal), (C.int)(key), (C.int)(modifiers), (C.uint)(nativeScanCode), (C.uint)(nativeVirtualKey), (C.uint)(nativeModifiers), (*C.struct_miqt_string)(text_ms)) return newQKeyEvent(ret) @@ -958,7 +1015,7 @@ func NewQKeyEvent7(typeVal QEvent__Type, key int, modifiers KeyboardModifier, na // NewQKeyEvent8 constructs a new QKeyEvent object. func NewQKeyEvent8(typeVal QEvent__Type, key int, modifiers KeyboardModifier, nativeScanCode uint, nativeVirtualKey uint, nativeModifiers uint, text string, autorep bool) *QKeyEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QKeyEvent_new8((C.int)(typeVal), (C.int)(key), (C.int)(modifiers), (C.uint)(nativeScanCode), (C.uint)(nativeVirtualKey), (C.uint)(nativeModifiers), (*C.struct_miqt_string)(text_ms), (C.bool)(autorep)) return newQKeyEvent(ret) @@ -966,7 +1023,7 @@ func NewQKeyEvent8(typeVal QEvent__Type, key int, modifiers KeyboardModifier, na // NewQKeyEvent9 constructs a new QKeyEvent object. func NewQKeyEvent9(typeVal QEvent__Type, key int, modifiers KeyboardModifier, nativeScanCode uint, nativeVirtualKey uint, nativeModifiers uint, text string, autorep bool, count uint16) *QKeyEvent { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QKeyEvent_new9((C.int)(typeVal), (C.int)(key), (C.int)(modifiers), (C.uint)(nativeScanCode), (C.uint)(nativeVirtualKey), (C.uint)(nativeModifiers), (*C.struct_miqt_string)(text_ms), (C.bool)(autorep), (C.uint16_t)(count)) return newQKeyEvent(ret) @@ -1037,14 +1094,21 @@ func (this *QFocusEvent) cPointer() *C.QFocusEvent { return this.h } +func (this *QFocusEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFocusEvent(h *C.QFocusEvent) *QFocusEvent { if h == nil { return nil } - return &QFocusEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QFocusEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQFocusEvent_U(h unsafe.Pointer) *QFocusEvent { +func UnsafeNewQFocusEvent(h unsafe.Pointer) *QFocusEvent { return newQFocusEvent((*C.QFocusEvent)(h)) } @@ -1104,14 +1168,21 @@ func (this *QPaintEvent) cPointer() *C.QPaintEvent { return this.h } +func (this *QPaintEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPaintEvent(h *C.QPaintEvent) *QPaintEvent { if h == nil { return nil } - return &QPaintEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QPaintEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQPaintEvent_U(h unsafe.Pointer) *QPaintEvent { +func UnsafeNewQPaintEvent(h unsafe.Pointer) *QPaintEvent { return newQPaintEvent((*C.QPaintEvent)(h)) } @@ -1134,11 +1205,11 @@ func NewQPaintEvent3(param1 *QPaintEvent) *QPaintEvent { } func (this *QPaintEvent) Rect() *QRect { - return newQRect_U(unsafe.Pointer(C.QPaintEvent_Rect(this.h))) + return UnsafeNewQRect(unsafe.Pointer(C.QPaintEvent_Rect(this.h))) } func (this *QPaintEvent) Region() *QRegion { - return newQRegion_U(unsafe.Pointer(C.QPaintEvent_Region(this.h))) + return UnsafeNewQRegion(unsafe.Pointer(C.QPaintEvent_Region(this.h))) } // Delete this object from C++ memory. @@ -1167,14 +1238,21 @@ func (this *QMoveEvent) cPointer() *C.QMoveEvent { return this.h } +func (this *QMoveEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMoveEvent(h *C.QMoveEvent) *QMoveEvent { if h == nil { return nil } - return &QMoveEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QMoveEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQMoveEvent_U(h unsafe.Pointer) *QMoveEvent { +func UnsafeNewQMoveEvent(h unsafe.Pointer) *QMoveEvent { return newQMoveEvent((*C.QMoveEvent)(h)) } @@ -1191,11 +1269,11 @@ func NewQMoveEvent2(param1 *QMoveEvent) *QMoveEvent { } func (this *QMoveEvent) Pos() *QPoint { - return newQPoint_U(unsafe.Pointer(C.QMoveEvent_Pos(this.h))) + return UnsafeNewQPoint(unsafe.Pointer(C.QMoveEvent_Pos(this.h))) } func (this *QMoveEvent) OldPos() *QPoint { - return newQPoint_U(unsafe.Pointer(C.QMoveEvent_OldPos(this.h))) + return UnsafeNewQPoint(unsafe.Pointer(C.QMoveEvent_OldPos(this.h))) } // Delete this object from C++ memory. @@ -1224,14 +1302,21 @@ func (this *QExposeEvent) cPointer() *C.QExposeEvent { return this.h } +func (this *QExposeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQExposeEvent(h *C.QExposeEvent) *QExposeEvent { if h == nil { return nil } - return &QExposeEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QExposeEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQExposeEvent_U(h unsafe.Pointer) *QExposeEvent { +func UnsafeNewQExposeEvent(h unsafe.Pointer) *QExposeEvent { return newQExposeEvent((*C.QExposeEvent)(h)) } @@ -1248,7 +1333,7 @@ func NewQExposeEvent2(param1 *QExposeEvent) *QExposeEvent { } func (this *QExposeEvent) Region() *QRegion { - return newQRegion_U(unsafe.Pointer(C.QExposeEvent_Region(this.h))) + return UnsafeNewQRegion(unsafe.Pointer(C.QExposeEvent_Region(this.h))) } // Delete this object from C++ memory. @@ -1277,14 +1362,21 @@ func (this *QPlatformSurfaceEvent) cPointer() *C.QPlatformSurfaceEvent { return this.h } +func (this *QPlatformSurfaceEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPlatformSurfaceEvent(h *C.QPlatformSurfaceEvent) *QPlatformSurfaceEvent { if h == nil { return nil } - return &QPlatformSurfaceEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QPlatformSurfaceEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQPlatformSurfaceEvent_U(h unsafe.Pointer) *QPlatformSurfaceEvent { +func UnsafeNewQPlatformSurfaceEvent(h unsafe.Pointer) *QPlatformSurfaceEvent { return newQPlatformSurfaceEvent((*C.QPlatformSurfaceEvent)(h)) } @@ -1330,14 +1422,21 @@ func (this *QResizeEvent) cPointer() *C.QResizeEvent { return this.h } +func (this *QResizeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQResizeEvent(h *C.QResizeEvent) *QResizeEvent { if h == nil { return nil } - return &QResizeEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QResizeEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQResizeEvent_U(h unsafe.Pointer) *QResizeEvent { +func UnsafeNewQResizeEvent(h unsafe.Pointer) *QResizeEvent { return newQResizeEvent((*C.QResizeEvent)(h)) } @@ -1354,11 +1453,11 @@ func NewQResizeEvent2(param1 *QResizeEvent) *QResizeEvent { } func (this *QResizeEvent) Size() *QSize { - return newQSize_U(unsafe.Pointer(C.QResizeEvent_Size(this.h))) + return UnsafeNewQSize(unsafe.Pointer(C.QResizeEvent_Size(this.h))) } func (this *QResizeEvent) OldSize() *QSize { - return newQSize_U(unsafe.Pointer(C.QResizeEvent_OldSize(this.h))) + return UnsafeNewQSize(unsafe.Pointer(C.QResizeEvent_OldSize(this.h))) } // Delete this object from C++ memory. @@ -1387,14 +1486,21 @@ func (this *QCloseEvent) cPointer() *C.QCloseEvent { return this.h } +func (this *QCloseEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQCloseEvent(h *C.QCloseEvent) *QCloseEvent { if h == nil { return nil } - return &QCloseEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QCloseEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQCloseEvent_U(h unsafe.Pointer) *QCloseEvent { +func UnsafeNewQCloseEvent(h unsafe.Pointer) *QCloseEvent { return newQCloseEvent((*C.QCloseEvent)(h)) } @@ -1440,14 +1546,21 @@ func (this *QIconDragEvent) cPointer() *C.QIconDragEvent { return this.h } +func (this *QIconDragEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIconDragEvent(h *C.QIconDragEvent) *QIconDragEvent { if h == nil { return nil } - return &QIconDragEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QIconDragEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQIconDragEvent_U(h unsafe.Pointer) *QIconDragEvent { +func UnsafeNewQIconDragEvent(h unsafe.Pointer) *QIconDragEvent { return newQIconDragEvent((*C.QIconDragEvent)(h)) } @@ -1493,14 +1606,21 @@ func (this *QShowEvent) cPointer() *C.QShowEvent { return this.h } +func (this *QShowEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQShowEvent(h *C.QShowEvent) *QShowEvent { if h == nil { return nil } - return &QShowEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QShowEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQShowEvent_U(h unsafe.Pointer) *QShowEvent { +func UnsafeNewQShowEvent(h unsafe.Pointer) *QShowEvent { return newQShowEvent((*C.QShowEvent)(h)) } @@ -1546,14 +1666,21 @@ func (this *QHideEvent) cPointer() *C.QHideEvent { return this.h } +func (this *QHideEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHideEvent(h *C.QHideEvent) *QHideEvent { if h == nil { return nil } - return &QHideEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QHideEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQHideEvent_U(h unsafe.Pointer) *QHideEvent { +func UnsafeNewQHideEvent(h unsafe.Pointer) *QHideEvent { return newQHideEvent((*C.QHideEvent)(h)) } @@ -1599,14 +1726,21 @@ func (this *QContextMenuEvent) cPointer() *C.QContextMenuEvent { return this.h } +func (this *QContextMenuEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQContextMenuEvent(h *C.QContextMenuEvent) *QContextMenuEvent { if h == nil { return nil } - return &QContextMenuEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QContextMenuEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQContextMenuEvent_U(h unsafe.Pointer) *QContextMenuEvent { +func UnsafeNewQContextMenuEvent(h unsafe.Pointer) *QContextMenuEvent { return newQContextMenuEvent((*C.QContextMenuEvent)(h)) } @@ -1651,11 +1785,11 @@ func (this *QContextMenuEvent) GlobalY() int { } func (this *QContextMenuEvent) Pos() *QPoint { - return newQPoint_U(unsafe.Pointer(C.QContextMenuEvent_Pos(this.h))) + return UnsafeNewQPoint(unsafe.Pointer(C.QContextMenuEvent_Pos(this.h))) } func (this *QContextMenuEvent) GlobalPos() *QPoint { - return newQPoint_U(unsafe.Pointer(C.QContextMenuEvent_GlobalPos(this.h))) + return UnsafeNewQPoint(unsafe.Pointer(C.QContextMenuEvent_GlobalPos(this.h))) } func (this *QContextMenuEvent) Reason() QContextMenuEvent__Reason { @@ -1688,14 +1822,21 @@ func (this *QInputMethodEvent) cPointer() *C.QInputMethodEvent { return this.h } +func (this *QInputMethodEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQInputMethodEvent(h *C.QInputMethodEvent) *QInputMethodEvent { if h == nil { return nil } - return &QInputMethodEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QInputMethodEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQInputMethodEvent_U(h unsafe.Pointer) *QInputMethodEvent { +func UnsafeNewQInputMethodEvent(h unsafe.Pointer) *QInputMethodEvent { return newQInputMethodEvent((*C.QInputMethodEvent)(h)) } @@ -1707,7 +1848,7 @@ func NewQInputMethodEvent() *QInputMethodEvent { // NewQInputMethodEvent2 constructs a new QInputMethodEvent object. func NewQInputMethodEvent2(preeditText string, attributes []QInputMethodEvent__Attribute) *QInputMethodEvent { - preeditText_ms := miqt_strdupg(preeditText) + preeditText_ms := libmiqt.Strdupg(preeditText) defer C.free(preeditText_ms) // For the C ABI, malloc a C array of raw pointers attributes_CArray := (*[0xffff]*C.QInputMethodEvent__Attribute)(C.malloc(C.size_t(8 * len(attributes)))) @@ -1728,7 +1869,7 @@ func NewQInputMethodEvent3(other *QInputMethodEvent) *QInputMethodEvent { } func (this *QInputMethodEvent) SetCommitString(commitString string) { - commitString_ms := miqt_strdupg(commitString) + commitString_ms := libmiqt.Strdupg(commitString) defer C.free(commitString_ms) C.QInputMethodEvent_SetCommitString(this.h, (*C.struct_miqt_string)(commitString_ms)) } @@ -1770,13 +1911,13 @@ func (this *QInputMethodEvent) ReplacementLength() int { } func (this *QInputMethodEvent) SetCommitString2(commitString string, replaceFrom int) { - commitString_ms := miqt_strdupg(commitString) + commitString_ms := libmiqt.Strdupg(commitString) defer C.free(commitString_ms) C.QInputMethodEvent_SetCommitString2(this.h, (*C.struct_miqt_string)(commitString_ms), (C.int)(replaceFrom)) } func (this *QInputMethodEvent) SetCommitString3(commitString string, replaceFrom int, replaceLength int) { - commitString_ms := miqt_strdupg(commitString) + commitString_ms := libmiqt.Strdupg(commitString) defer C.free(commitString_ms) C.QInputMethodEvent_SetCommitString3(this.h, (*C.struct_miqt_string)(commitString_ms), (C.int)(replaceFrom), (C.int)(replaceLength)) } @@ -1807,14 +1948,21 @@ func (this *QInputMethodQueryEvent) cPointer() *C.QInputMethodQueryEvent { return this.h } +func (this *QInputMethodQueryEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQInputMethodQueryEvent(h *C.QInputMethodQueryEvent) *QInputMethodQueryEvent { if h == nil { return nil } - return &QInputMethodQueryEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QInputMethodQueryEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQInputMethodQueryEvent_U(h unsafe.Pointer) *QInputMethodQueryEvent { +func UnsafeNewQInputMethodQueryEvent(h unsafe.Pointer) *QInputMethodQueryEvent { return newQInputMethodQueryEvent((*C.QInputMethodQueryEvent)(h)) } @@ -1871,14 +2019,21 @@ func (this *QDropEvent) cPointer() *C.QDropEvent { return this.h } +func (this *QDropEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDropEvent(h *C.QDropEvent) *QDropEvent { if h == nil { return nil } - return &QDropEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QDropEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQDropEvent_U(h unsafe.Pointer) *QDropEvent { +func UnsafeNewQDropEvent(h unsafe.Pointer) *QDropEvent { return newQDropEvent((*C.QDropEvent)(h)) } @@ -1908,7 +2063,7 @@ func (this *QDropEvent) Pos() *QPoint { } func (this *QDropEvent) PosF() *QPointF { - return newQPointF_U(unsafe.Pointer(C.QDropEvent_PosF(this.h))) + return UnsafeNewQPointF(unsafe.Pointer(C.QDropEvent_PosF(this.h))) } func (this *QDropEvent) MouseButtons() MouseButton { @@ -1940,11 +2095,11 @@ func (this *QDropEvent) SetDropAction(action DropAction) { } func (this *QDropEvent) Source() *QObject { - return newQObject_U(unsafe.Pointer(C.QDropEvent_Source(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QDropEvent_Source(this.h))) } func (this *QDropEvent) MimeData() *QMimeData { - return newQMimeData_U(unsafe.Pointer(C.QDropEvent_MimeData(this.h))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QDropEvent_MimeData(this.h))) } // Delete this object from C++ memory. @@ -1973,14 +2128,21 @@ func (this *QDragMoveEvent) cPointer() *C.QDragMoveEvent { return this.h } +func (this *QDragMoveEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDragMoveEvent(h *C.QDragMoveEvent) *QDragMoveEvent { if h == nil { return nil } - return &QDragMoveEvent{h: h, QDropEvent: newQDropEvent_U(unsafe.Pointer(h))} + return &QDragMoveEvent{h: h, QDropEvent: UnsafeNewQDropEvent(unsafe.Pointer(h))} } -func newQDragMoveEvent_U(h unsafe.Pointer) *QDragMoveEvent { +func UnsafeNewQDragMoveEvent(h unsafe.Pointer) *QDragMoveEvent { return newQDragMoveEvent((*C.QDragMoveEvent)(h)) } @@ -2051,14 +2213,21 @@ func (this *QDragEnterEvent) cPointer() *C.QDragEnterEvent { return this.h } +func (this *QDragEnterEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDragEnterEvent(h *C.QDragEnterEvent) *QDragEnterEvent { if h == nil { return nil } - return &QDragEnterEvent{h: h, QDragMoveEvent: newQDragMoveEvent_U(unsafe.Pointer(h))} + return &QDragEnterEvent{h: h, QDragMoveEvent: UnsafeNewQDragMoveEvent(unsafe.Pointer(h))} } -func newQDragEnterEvent_U(h unsafe.Pointer) *QDragEnterEvent { +func UnsafeNewQDragEnterEvent(h unsafe.Pointer) *QDragEnterEvent { return newQDragEnterEvent((*C.QDragEnterEvent)(h)) } @@ -2104,14 +2273,21 @@ func (this *QDragLeaveEvent) cPointer() *C.QDragLeaveEvent { return this.h } +func (this *QDragLeaveEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDragLeaveEvent(h *C.QDragLeaveEvent) *QDragLeaveEvent { if h == nil { return nil } - return &QDragLeaveEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QDragLeaveEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQDragLeaveEvent_U(h unsafe.Pointer) *QDragLeaveEvent { +func UnsafeNewQDragLeaveEvent(h unsafe.Pointer) *QDragLeaveEvent { return newQDragLeaveEvent((*C.QDragLeaveEvent)(h)) } @@ -2157,14 +2333,21 @@ func (this *QHelpEvent) cPointer() *C.QHelpEvent { return this.h } +func (this *QHelpEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHelpEvent(h *C.QHelpEvent) *QHelpEvent { if h == nil { return nil } - return &QHelpEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QHelpEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQHelpEvent_U(h unsafe.Pointer) *QHelpEvent { +func UnsafeNewQHelpEvent(h unsafe.Pointer) *QHelpEvent { return newQHelpEvent((*C.QHelpEvent)(h)) } @@ -2197,11 +2380,11 @@ func (this *QHelpEvent) GlobalY() int { } func (this *QHelpEvent) Pos() *QPoint { - return newQPoint_U(unsafe.Pointer(C.QHelpEvent_Pos(this.h))) + return UnsafeNewQPoint(unsafe.Pointer(C.QHelpEvent_Pos(this.h))) } func (this *QHelpEvent) GlobalPos() *QPoint { - return newQPoint_U(unsafe.Pointer(C.QHelpEvent_GlobalPos(this.h))) + return UnsafeNewQPoint(unsafe.Pointer(C.QHelpEvent_GlobalPos(this.h))) } // Delete this object from C++ memory. @@ -2230,20 +2413,27 @@ func (this *QStatusTipEvent) cPointer() *C.QStatusTipEvent { return this.h } +func (this *QStatusTipEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStatusTipEvent(h *C.QStatusTipEvent) *QStatusTipEvent { if h == nil { return nil } - return &QStatusTipEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QStatusTipEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQStatusTipEvent_U(h unsafe.Pointer) *QStatusTipEvent { +func UnsafeNewQStatusTipEvent(h unsafe.Pointer) *QStatusTipEvent { return newQStatusTipEvent((*C.QStatusTipEvent)(h)) } // NewQStatusTipEvent constructs a new QStatusTipEvent object. func NewQStatusTipEvent(tip string) *QStatusTipEvent { - tip_ms := miqt_strdupg(tip) + tip_ms := libmiqt.Strdupg(tip) defer C.free(tip_ms) ret := C.QStatusTipEvent_new((*C.struct_miqt_string)(tip_ms)) return newQStatusTipEvent(ret) @@ -2288,20 +2478,27 @@ func (this *QWhatsThisClickedEvent) cPointer() *C.QWhatsThisClickedEvent { return this.h } +func (this *QWhatsThisClickedEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWhatsThisClickedEvent(h *C.QWhatsThisClickedEvent) *QWhatsThisClickedEvent { if h == nil { return nil } - return &QWhatsThisClickedEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QWhatsThisClickedEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQWhatsThisClickedEvent_U(h unsafe.Pointer) *QWhatsThisClickedEvent { +func UnsafeNewQWhatsThisClickedEvent(h unsafe.Pointer) *QWhatsThisClickedEvent { return newQWhatsThisClickedEvent((*C.QWhatsThisClickedEvent)(h)) } // NewQWhatsThisClickedEvent constructs a new QWhatsThisClickedEvent object. func NewQWhatsThisClickedEvent(href string) *QWhatsThisClickedEvent { - href_ms := miqt_strdupg(href) + href_ms := libmiqt.Strdupg(href) defer C.free(href_ms) ret := C.QWhatsThisClickedEvent_new((*C.struct_miqt_string)(href_ms)) return newQWhatsThisClickedEvent(ret) @@ -2346,14 +2543,21 @@ func (this *QActionEvent) cPointer() *C.QActionEvent { return this.h } +func (this *QActionEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQActionEvent(h *C.QActionEvent) *QActionEvent { if h == nil { return nil } - return &QActionEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QActionEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQActionEvent_U(h unsafe.Pointer) *QActionEvent { +func UnsafeNewQActionEvent(h unsafe.Pointer) *QActionEvent { return newQActionEvent((*C.QActionEvent)(h)) } @@ -2376,11 +2580,11 @@ func NewQActionEvent3(typeVal int, action *QAction, before *QAction) *QActionEve } func (this *QActionEvent) Action() *QAction { - return newQAction_U(unsafe.Pointer(C.QActionEvent_Action(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QActionEvent_Action(this.h))) } func (this *QActionEvent) Before() *QAction { - return newQAction_U(unsafe.Pointer(C.QActionEvent_Before(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QActionEvent_Before(this.h))) } func (this *QActionEvent) OperatorAssign(param1 *QActionEvent) { @@ -2413,20 +2617,27 @@ func (this *QFileOpenEvent) cPointer() *C.QFileOpenEvent { return this.h } +func (this *QFileOpenEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileOpenEvent(h *C.QFileOpenEvent) *QFileOpenEvent { if h == nil { return nil } - return &QFileOpenEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QFileOpenEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQFileOpenEvent_U(h unsafe.Pointer) *QFileOpenEvent { +func UnsafeNewQFileOpenEvent(h unsafe.Pointer) *QFileOpenEvent { return newQFileOpenEvent((*C.QFileOpenEvent)(h)) } // NewQFileOpenEvent constructs a new QFileOpenEvent object. func NewQFileOpenEvent(file string) *QFileOpenEvent { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) ret := C.QFileOpenEvent_new((*C.struct_miqt_string)(file_ms)) return newQFileOpenEvent(ret) @@ -2488,14 +2699,21 @@ func (this *QToolBarChangeEvent) cPointer() *C.QToolBarChangeEvent { return this.h } +func (this *QToolBarChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQToolBarChangeEvent(h *C.QToolBarChangeEvent) *QToolBarChangeEvent { if h == nil { return nil } - return &QToolBarChangeEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QToolBarChangeEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQToolBarChangeEvent_U(h unsafe.Pointer) *QToolBarChangeEvent { +func UnsafeNewQToolBarChangeEvent(h unsafe.Pointer) *QToolBarChangeEvent { return newQToolBarChangeEvent((*C.QToolBarChangeEvent)(h)) } @@ -2541,14 +2759,21 @@ func (this *QShortcutEvent) cPointer() *C.QShortcutEvent { return this.h } +func (this *QShortcutEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQShortcutEvent(h *C.QShortcutEvent) *QShortcutEvent { if h == nil { return nil } - return &QShortcutEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QShortcutEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQShortcutEvent_U(h unsafe.Pointer) *QShortcutEvent { +func UnsafeNewQShortcutEvent(h unsafe.Pointer) *QShortcutEvent { return newQShortcutEvent((*C.QShortcutEvent)(h)) } @@ -2571,7 +2796,7 @@ func NewQShortcutEvent3(key *QKeySequence, id int, ambiguous bool) *QShortcutEve } func (this *QShortcutEvent) Key() *QKeySequence { - return newQKeySequence_U(unsafe.Pointer(C.QShortcutEvent_Key(this.h))) + return UnsafeNewQKeySequence(unsafe.Pointer(C.QShortcutEvent_Key(this.h))) } func (this *QShortcutEvent) ShortcutId() int { @@ -2608,14 +2833,21 @@ func (this *QWindowStateChangeEvent) cPointer() *C.QWindowStateChangeEvent { return this.h } +func (this *QWindowStateChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWindowStateChangeEvent(h *C.QWindowStateChangeEvent) *QWindowStateChangeEvent { if h == nil { return nil } - return &QWindowStateChangeEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QWindowStateChangeEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQWindowStateChangeEvent_U(h unsafe.Pointer) *QWindowStateChangeEvent { +func UnsafeNewQWindowStateChangeEvent(h unsafe.Pointer) *QWindowStateChangeEvent { return newQWindowStateChangeEvent((*C.QWindowStateChangeEvent)(h)) } @@ -2670,6 +2902,13 @@ func (this *QPointingDeviceUniqueId) cPointer() *C.QPointingDeviceUniqueId { return this.h } +func (this *QPointingDeviceUniqueId) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPointingDeviceUniqueId(h *C.QPointingDeviceUniqueId) *QPointingDeviceUniqueId { if h == nil { return nil @@ -2677,7 +2916,7 @@ func newQPointingDeviceUniqueId(h *C.QPointingDeviceUniqueId) *QPointingDeviceUn return &QPointingDeviceUniqueId{h: h} } -func newQPointingDeviceUniqueId_U(h unsafe.Pointer) *QPointingDeviceUniqueId { +func UnsafeNewQPointingDeviceUniqueId(h unsafe.Pointer) *QPointingDeviceUniqueId { return newQPointingDeviceUniqueId((*C.QPointingDeviceUniqueId)(h)) } @@ -2734,14 +2973,21 @@ func (this *QTouchEvent) cPointer() *C.QTouchEvent { return this.h } +func (this *QTouchEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTouchEvent(h *C.QTouchEvent) *QTouchEvent { if h == nil { return nil } - return &QTouchEvent{h: h, QInputEvent: newQInputEvent_U(unsafe.Pointer(h))} + return &QTouchEvent{h: h, QInputEvent: UnsafeNewQInputEvent(unsafe.Pointer(h))} } -func newQTouchEvent_U(h unsafe.Pointer) *QTouchEvent { +func UnsafeNewQTouchEvent(h unsafe.Pointer) *QTouchEvent { return newQTouchEvent((*C.QTouchEvent)(h)) } @@ -2790,11 +3036,11 @@ func NewQTouchEvent6(eventType QEvent__Type, device *QTouchDevice, modifiers Key } func (this *QTouchEvent) Window() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QTouchEvent_Window(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QTouchEvent_Window(this.h))) } func (this *QTouchEvent) Target() *QObject { - return newQObject_U(unsafe.Pointer(C.QTouchEvent_Target(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QTouchEvent_Target(this.h))) } func (this *QTouchEvent) TouchPointStates() TouchPointState { @@ -2816,7 +3062,7 @@ func (this *QTouchEvent) TouchPoints() []QTouchEvent__TouchPoint { } func (this *QTouchEvent) Device() *QTouchDevice { - return newQTouchDevice_U(unsafe.Pointer(C.QTouchEvent_Device(this.h))) + return UnsafeNewQTouchDevice(unsafe.Pointer(C.QTouchEvent_Device(this.h))) } func (this *QTouchEvent) SetWindow(awindow *QWindow) { @@ -2873,14 +3119,21 @@ func (this *QScrollPrepareEvent) cPointer() *C.QScrollPrepareEvent { return this.h } +func (this *QScrollPrepareEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScrollPrepareEvent(h *C.QScrollPrepareEvent) *QScrollPrepareEvent { if h == nil { return nil } - return &QScrollPrepareEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QScrollPrepareEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQScrollPrepareEvent_U(h unsafe.Pointer) *QScrollPrepareEvent { +func UnsafeNewQScrollPrepareEvent(h unsafe.Pointer) *QScrollPrepareEvent { return newQScrollPrepareEvent((*C.QScrollPrepareEvent)(h)) } @@ -2962,14 +3215,21 @@ func (this *QScrollEvent) cPointer() *C.QScrollEvent { return this.h } +func (this *QScrollEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScrollEvent(h *C.QScrollEvent) *QScrollEvent { if h == nil { return nil } - return &QScrollEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QScrollEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQScrollEvent_U(h unsafe.Pointer) *QScrollEvent { +func UnsafeNewQScrollEvent(h unsafe.Pointer) *QScrollEvent { return newQScrollEvent((*C.QScrollEvent)(h)) } @@ -3029,14 +3289,21 @@ func (this *QScreenOrientationChangeEvent) cPointer() *C.QScreenOrientationChang return this.h } +func (this *QScreenOrientationChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScreenOrientationChangeEvent(h *C.QScreenOrientationChangeEvent) *QScreenOrientationChangeEvent { if h == nil { return nil } - return &QScreenOrientationChangeEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QScreenOrientationChangeEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQScreenOrientationChangeEvent_U(h unsafe.Pointer) *QScreenOrientationChangeEvent { +func UnsafeNewQScreenOrientationChangeEvent(h unsafe.Pointer) *QScreenOrientationChangeEvent { return newQScreenOrientationChangeEvent((*C.QScreenOrientationChangeEvent)(h)) } @@ -3053,7 +3320,7 @@ func NewQScreenOrientationChangeEvent2(param1 *QScreenOrientationChangeEvent) *Q } func (this *QScreenOrientationChangeEvent) Screen() *QScreen { - return newQScreen_U(unsafe.Pointer(C.QScreenOrientationChangeEvent_Screen(this.h))) + return UnsafeNewQScreen(unsafe.Pointer(C.QScreenOrientationChangeEvent_Screen(this.h))) } func (this *QScreenOrientationChangeEvent) Orientation() ScreenOrientation { @@ -3086,14 +3353,21 @@ func (this *QApplicationStateChangeEvent) cPointer() *C.QApplicationStateChangeE return this.h } +func (this *QApplicationStateChangeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQApplicationStateChangeEvent(h *C.QApplicationStateChangeEvent) *QApplicationStateChangeEvent { if h == nil { return nil } - return &QApplicationStateChangeEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QApplicationStateChangeEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQApplicationStateChangeEvent_U(h unsafe.Pointer) *QApplicationStateChangeEvent { +func UnsafeNewQApplicationStateChangeEvent(h unsafe.Pointer) *QApplicationStateChangeEvent { return newQApplicationStateChangeEvent((*C.QApplicationStateChangeEvent)(h)) } @@ -3138,6 +3412,13 @@ func (this *QInputMethodEvent__Attribute) cPointer() *C.QInputMethodEvent__Attri return this.h } +func (this *QInputMethodEvent__Attribute) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQInputMethodEvent__Attribute(h *C.QInputMethodEvent__Attribute) *QInputMethodEvent__Attribute { if h == nil { return nil @@ -3145,7 +3426,7 @@ func newQInputMethodEvent__Attribute(h *C.QInputMethodEvent__Attribute) *QInputM return &QInputMethodEvent__Attribute{h: h} } -func newQInputMethodEvent__Attribute_U(h unsafe.Pointer) *QInputMethodEvent__Attribute { +func UnsafeNewQInputMethodEvent__Attribute(h unsafe.Pointer) *QInputMethodEvent__Attribute { return newQInputMethodEvent__Attribute((*C.QInputMethodEvent__Attribute)(h)) } @@ -3196,6 +3477,13 @@ func (this *QTouchEvent__TouchPoint) cPointer() *C.QTouchEvent__TouchPoint { return this.h } +func (this *QTouchEvent__TouchPoint) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTouchEvent__TouchPoint(h *C.QTouchEvent__TouchPoint) *QTouchEvent__TouchPoint { if h == nil { return nil @@ -3203,7 +3491,7 @@ func newQTouchEvent__TouchPoint(h *C.QTouchEvent__TouchPoint) *QTouchEvent__Touc return &QTouchEvent__TouchPoint{h: h} } -func newQTouchEvent__TouchPoint_U(h unsafe.Pointer) *QTouchEvent__TouchPoint { +func UnsafeNewQTouchEvent__TouchPoint(h unsafe.Pointer) *QTouchEvent__TouchPoint { return newQTouchEvent__TouchPoint((*C.QTouchEvent__TouchPoint)(h)) } diff --git a/qt/gen_qevent.h b/qt/gen_qevent.h index 3c9210ab..8484b5ab 100644 --- a/qt/gen_qevent.h +++ b/qt/gen_qevent.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qeventloop.cpp b/qt/gen_qeventloop.cpp index ec27ef81..428ef538 100644 --- a/qt/gen_qeventloop.cpp +++ b/qt/gen_qeventloop.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qeventloop.h" +#include #include "gen_qeventloop.h" #include "_cgo_export.h" diff --git a/qt/gen_qeventloop.go b/qt/gen_qeventloop.go index 413bf7c5..20320963 100644 --- a/qt/gen_qeventloop.go +++ b/qt/gen_qeventloop.go @@ -37,14 +37,21 @@ func (this *QEventLoop) cPointer() *C.QEventLoop { return this.h } +func (this *QEventLoop) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQEventLoop(h *C.QEventLoop) *QEventLoop { if h == nil { return nil } - return &QEventLoop{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QEventLoop{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQEventLoop_U(h unsafe.Pointer) *QEventLoop { +func UnsafeNewQEventLoop(h unsafe.Pointer) *QEventLoop { return newQEventLoop((*C.QEventLoop)(h)) } @@ -61,7 +68,7 @@ func NewQEventLoop2(parent *QObject) *QEventLoop { } func (this *QEventLoop) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QEventLoop_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QEventLoop_MetaObject(this.h))) } func (this *QEventLoop) Metacast(param1 string) unsafe.Pointer { @@ -201,6 +208,13 @@ func (this *QEventLoopLocker) cPointer() *C.QEventLoopLocker { return this.h } +func (this *QEventLoopLocker) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQEventLoopLocker(h *C.QEventLoopLocker) *QEventLoopLocker { if h == nil { return nil @@ -208,7 +222,7 @@ func newQEventLoopLocker(h *C.QEventLoopLocker) *QEventLoopLocker { return &QEventLoopLocker{h: h} } -func newQEventLoopLocker_U(h unsafe.Pointer) *QEventLoopLocker { +func UnsafeNewQEventLoopLocker(h unsafe.Pointer) *QEventLoopLocker { return newQEventLoopLocker((*C.QEventLoopLocker)(h)) } diff --git a/qt/gen_qeventloop.h b/qt/gen_qeventloop.h index f820ed81..bd1d0d6c 100644 --- a/qt/gen_qeventloop.h +++ b/qt/gen_qeventloop.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qeventtransition.cpp b/qt/gen_qeventtransition.cpp index b0229d9e..28a5cb60 100644 --- a/qt/gen_qeventtransition.cpp +++ b/qt/gen_qeventtransition.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qeventtransition.h" +#include #include "gen_qeventtransition.h" #include "_cgo_export.h" diff --git a/qt/gen_qeventtransition.go b/qt/gen_qeventtransition.go index 27283c8e..45b326f3 100644 --- a/qt/gen_qeventtransition.go +++ b/qt/gen_qeventtransition.go @@ -25,14 +25,21 @@ func (this *QEventTransition) cPointer() *C.QEventTransition { return this.h } +func (this *QEventTransition) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQEventTransition(h *C.QEventTransition) *QEventTransition { if h == nil { return nil } - return &QEventTransition{h: h, QAbstractTransition: newQAbstractTransition_U(unsafe.Pointer(h))} + return &QEventTransition{h: h, QAbstractTransition: UnsafeNewQAbstractTransition(unsafe.Pointer(h))} } -func newQEventTransition_U(h unsafe.Pointer) *QEventTransition { +func UnsafeNewQEventTransition(h unsafe.Pointer) *QEventTransition { return newQEventTransition((*C.QEventTransition)(h)) } @@ -61,7 +68,7 @@ func NewQEventTransition4(object *QObject, typeVal QEvent__Type, sourceState *QS } func (this *QEventTransition) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QEventTransition_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QEventTransition_MetaObject(this.h))) } func (this *QEventTransition) Metacast(param1 string) unsafe.Pointer { @@ -89,7 +96,7 @@ func QEventTransition_TrUtf8(s string) string { } func (this *QEventTransition) EventSource() *QObject { - return newQObject_U(unsafe.Pointer(C.QEventTransition_EventSource(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QEventTransition_EventSource(this.h))) } func (this *QEventTransition) SetEventSource(object *QObject) { diff --git a/qt/gen_qeventtransition.h b/qt/gen_qeventtransition.h index 11c383d5..7799a040 100644 --- a/qt/gen_qeventtransition.h +++ b/qt/gen_qeventtransition.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qexception.cpp b/qt/gen_qexception.cpp index 1ec4e824..ed2abc26 100644 --- a/qt/gen_qexception.cpp +++ b/qt/gen_qexception.cpp @@ -1,6 +1,6 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__ExceptionHolder #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__ExceptionStore -#include "qexception.h" +#include #include "gen_qexception.h" #include "_cgo_export.h" diff --git a/qt/gen_qexception.go b/qt/gen_qexception.go index 1bb0200a..d72e0f21 100644 --- a/qt/gen_qexception.go +++ b/qt/gen_qexception.go @@ -24,6 +24,13 @@ func (this *QtPrivate__ExceptionHolder) cPointer() *C.QtPrivate__ExceptionHolder return this.h } +func (this *QtPrivate__ExceptionHolder) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__ExceptionHolder(h *C.QtPrivate__ExceptionHolder) *QtPrivate__ExceptionHolder { if h == nil { return nil @@ -31,7 +38,7 @@ func newQtPrivate__ExceptionHolder(h *C.QtPrivate__ExceptionHolder) *QtPrivate__ return &QtPrivate__ExceptionHolder{h: h} } -func newQtPrivate__ExceptionHolder_U(h unsafe.Pointer) *QtPrivate__ExceptionHolder { +func UnsafeNewQtPrivate__ExceptionHolder(h unsafe.Pointer) *QtPrivate__ExceptionHolder { return newQtPrivate__ExceptionHolder((*C.QtPrivate__ExceptionHolder)(h)) } @@ -76,6 +83,13 @@ func (this *QtPrivate__ExceptionStore) cPointer() *C.QtPrivate__ExceptionStore { return this.h } +func (this *QtPrivate__ExceptionStore) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__ExceptionStore(h *C.QtPrivate__ExceptionStore) *QtPrivate__ExceptionStore { if h == nil { return nil @@ -83,7 +97,7 @@ func newQtPrivate__ExceptionStore(h *C.QtPrivate__ExceptionStore) *QtPrivate__Ex return &QtPrivate__ExceptionStore{h: h} } -func newQtPrivate__ExceptionStore_U(h unsafe.Pointer) *QtPrivate__ExceptionStore { +func UnsafeNewQtPrivate__ExceptionStore(h unsafe.Pointer) *QtPrivate__ExceptionStore { return newQtPrivate__ExceptionStore((*C.QtPrivate__ExceptionStore)(h)) } diff --git a/qt/gen_qexception.h b/qt/gen_qexception.h index 7cfa47e2..77f24278 100644 --- a/qt/gen_qexception.h +++ b/qt/gen_qexception.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfactoryinterface.cpp b/qt/gen_qfactoryinterface.cpp index 285776b4..2cfaea2c 100644 --- a/qt/gen_qfactoryinterface.cpp +++ b/qt/gen_qfactoryinterface.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qfactoryinterface.h" +#include #include "gen_qfactoryinterface.h" #include "_cgo_export.h" diff --git a/qt/gen_qfactoryinterface.go b/qt/gen_qfactoryinterface.go index 4ecafe95..892db2c2 100644 --- a/qt/gen_qfactoryinterface.go +++ b/qt/gen_qfactoryinterface.go @@ -24,6 +24,13 @@ func (this *QFactoryInterface) cPointer() *C.QFactoryInterface { return this.h } +func (this *QFactoryInterface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFactoryInterface(h *C.QFactoryInterface) *QFactoryInterface { if h == nil { return nil @@ -31,7 +38,7 @@ func newQFactoryInterface(h *C.QFactoryInterface) *QFactoryInterface { return &QFactoryInterface{h: h} } -func newQFactoryInterface_U(h unsafe.Pointer) *QFactoryInterface { +func UnsafeNewQFactoryInterface(h unsafe.Pointer) *QFactoryInterface { return newQFactoryInterface((*C.QFactoryInterface)(h)) } diff --git a/qt/gen_qfactoryinterface.h b/qt/gen_qfactoryinterface.h index 260ca608..ae93f479 100644 --- a/qt/gen_qfactoryinterface.h +++ b/qt/gen_qfactoryinterface.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfile.cpp b/qt/gen_qfile.cpp index 79cff3a2..42970899 100644 --- a/qt/gen_qfile.cpp +++ b/qt/gen_qfile.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qfile.h" +#include #include "gen_qfile.h" #include "_cgo_export.h" diff --git a/qt/gen_qfile.go b/qt/gen_qfile.go index c9620f55..b68e55a9 100644 --- a/qt/gen_qfile.go +++ b/qt/gen_qfile.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QFile) cPointer() *C.QFile { return this.h } +func (this *QFile) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFile(h *C.QFile) *QFile { if h == nil { return nil } - return &QFile{h: h, QFileDevice: newQFileDevice_U(unsafe.Pointer(h))} + return &QFile{h: h, QFileDevice: UnsafeNewQFileDevice(unsafe.Pointer(h))} } -func newQFile_U(h unsafe.Pointer) *QFile { +func UnsafeNewQFile(h unsafe.Pointer) *QFile { return newQFile((*C.QFile)(h)) } @@ -44,7 +52,7 @@ func NewQFile() *QFile { // NewQFile2 constructs a new QFile object. func NewQFile2(name string) *QFile { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QFile_new2((*C.struct_miqt_string)(name_ms)) return newQFile(ret) @@ -58,14 +66,14 @@ func NewQFile3(parent *QObject) *QFile { // NewQFile4 constructs a new QFile object. func NewQFile4(name string, parent *QObject) *QFile { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QFile_new4((*C.struct_miqt_string)(name_ms), parent.cPointer()) return newQFile(ret) } func (this *QFile) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFile_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFile_MetaObject(this.h))) } func (this *QFile) Metacast(param1 string) unsafe.Pointer { @@ -100,13 +108,13 @@ func (this *QFile) FileName() string { } func (this *QFile) SetFileName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QFile_SetFileName(this.h, (*C.struct_miqt_string)(name_ms)) } func QFile_EncodeName(fileName string) *QByteArray { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QFile_EncodeName((*C.struct_miqt_string)(fileName_ms)) _goptr := newQByteArray(_ret) @@ -135,7 +143,7 @@ func (this *QFile) Exists() bool { } func QFile_ExistsWithFileName(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QFile_ExistsWithFileName((*C.struct_miqt_string)(fileName_ms))) } @@ -148,7 +156,7 @@ func (this *QFile) ReadLink() string { } func QFile_ReadLinkWithFileName(fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QFile_ReadLinkWithFileName((*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -164,7 +172,7 @@ func (this *QFile) SymLinkTarget() string { } func QFile_SymLinkTargetWithFileName(fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QFile_SymLinkTargetWithFileName((*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -177,7 +185,7 @@ func (this *QFile) Remove() bool { } func QFile_RemoveWithFileName(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QFile_RemoveWithFileName((*C.struct_miqt_string)(fileName_ms))) } @@ -187,49 +195,49 @@ func (this *QFile) MoveToTrash() bool { } func QFile_MoveToTrashWithFileName(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QFile_MoveToTrashWithFileName((*C.struct_miqt_string)(fileName_ms))) } func (this *QFile) Rename(newName string) bool { - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QFile_Rename(this.h, (*C.struct_miqt_string)(newName_ms))) } func QFile_Rename2(oldName string, newName string) bool { - oldName_ms := miqt_strdupg(oldName) + oldName_ms := libmiqt.Strdupg(oldName) defer C.free(oldName_ms) - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QFile_Rename2((*C.struct_miqt_string)(oldName_ms), (*C.struct_miqt_string)(newName_ms))) } func (this *QFile) Link(newName string) bool { - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QFile_Link(this.h, (*C.struct_miqt_string)(newName_ms))) } func QFile_Link2(oldname string, newName string) bool { - oldname_ms := miqt_strdupg(oldname) + oldname_ms := libmiqt.Strdupg(oldname) defer C.free(oldname_ms) - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QFile_Link2((*C.struct_miqt_string)(oldname_ms), (*C.struct_miqt_string)(newName_ms))) } func (this *QFile) Copy(newName string) bool { - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QFile_Copy(this.h, (*C.struct_miqt_string)(newName_ms))) } func QFile_Copy2(fileName string, newName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QFile_Copy2((*C.struct_miqt_string)(fileName_ms), (*C.struct_miqt_string)(newName_ms))) } @@ -251,7 +259,7 @@ func (this *QFile) Resize(sz int64) bool { } func QFile_Resize2(filename string, sz int64) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) return (bool)(C.QFile_Resize2((*C.struct_miqt_string)(filename_ms), (C.longlong)(sz))) } @@ -261,7 +269,7 @@ func (this *QFile) Permissions() QFileDevice__Permission { } func QFile_PermissionsWithFilename(filename string) QFileDevice__Permission { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) return (QFileDevice__Permission)(C.QFile_PermissionsWithFilename((*C.struct_miqt_string)(filename_ms))) } @@ -271,7 +279,7 @@ func (this *QFile) SetPermissions(permissionSpec QFileDevice__Permission) bool { } func QFile_SetPermissions2(filename string, permissionSpec QFileDevice__Permission) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) return (bool)(C.QFile_SetPermissions2((*C.struct_miqt_string)(filename_ms), (C.int)(permissionSpec))) } diff --git a/qt/gen_qfile.h b/qt/gen_qfile.h index 662c8b1a..8f473749 100644 --- a/qt/gen_qfile.h +++ b/qt/gen_qfile.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfiledevice.cpp b/qt/gen_qfiledevice.cpp index a83eaa03..553abdee 100644 --- a/qt/gen_qfiledevice.cpp +++ b/qt/gen_qfiledevice.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qfiledevice.h" +#include #include "gen_qfiledevice.h" #include "_cgo_export.h" diff --git a/qt/gen_qfiledevice.go b/qt/gen_qfiledevice.go index 4ba70951..34225d94 100644 --- a/qt/gen_qfiledevice.go +++ b/qt/gen_qfiledevice.go @@ -85,19 +85,26 @@ func (this *QFileDevice) cPointer() *C.QFileDevice { return this.h } +func (this *QFileDevice) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileDevice(h *C.QFileDevice) *QFileDevice { if h == nil { return nil } - return &QFileDevice{h: h, QIODevice: newQIODevice_U(unsafe.Pointer(h))} + return &QFileDevice{h: h, QIODevice: UnsafeNewQIODevice(unsafe.Pointer(h))} } -func newQFileDevice_U(h unsafe.Pointer) *QFileDevice { +func UnsafeNewQFileDevice(h unsafe.Pointer) *QFileDevice { return newQFileDevice((*C.QFileDevice)(h)) } func (this *QFileDevice) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFileDevice_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFileDevice_MetaObject(this.h))) } func (this *QFileDevice) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qfiledevice.h b/qt/gen_qfiledevice.h index b5bda5d7..0d102e5e 100644 --- a/qt/gen_qfiledevice.h +++ b/qt/gen_qfiledevice.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfiledialog.cpp b/qt/gen_qfiledialog.cpp index 0405eb10..1e7f493b 100644 --- a/qt/gen_qfiledialog.cpp +++ b/qt/gen_qfiledialog.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qfiledialog.h" +#include #include "gen_qfiledialog.h" #include "_cgo_export.h" @@ -140,7 +140,7 @@ void QFileDialog_SetNameFilter(QFileDialog* self, struct miqt_string* filter) { } void QFileDialog_SetNameFilters(QFileDialog* self, struct miqt_array* /* of struct miqt_string* */ filters) { - QList filters_QList; + QStringList filters_QList; filters_QList.reserve(filters->len); struct miqt_string** filters_arr = static_cast(filters->data); for(size_t i = 0; i < filters->len; ++i) { @@ -186,7 +186,7 @@ struct miqt_string* QFileDialog_SelectedNameFilter(const QFileDialog* self) { } void QFileDialog_SetMimeTypeFilters(QFileDialog* self, struct miqt_array* /* of struct miqt_string* */ filters) { - QList filters_QList; + QStringList filters_QList; filters_QList.reserve(filters->len); struct miqt_string** filters_arr = static_cast(filters->data); for(size_t i = 0; i < filters->len; ++i) { @@ -321,7 +321,7 @@ struct miqt_string* QFileDialog_DefaultSuffix(const QFileDialog* self) { } void QFileDialog_SetHistory(QFileDialog* self, struct miqt_array* /* of struct miqt_string* */ paths) { - QList paths_QList; + QStringList paths_QList; paths_QList.reserve(paths->len); struct miqt_string** paths_arr = static_cast(paths->data); for(size_t i = 0; i < paths->len; ++i) { @@ -376,7 +376,7 @@ struct miqt_string* QFileDialog_LabelText(const QFileDialog* self, int label) { } void QFileDialog_SetSupportedSchemes(QFileDialog* self, struct miqt_array* /* of struct miqt_string* */ schemes) { - QList schemes_QList; + QStringList schemes_QList; schemes_QList.reserve(schemes->len); struct miqt_string** schemes_arr = static_cast(schemes->data); for(size_t i = 0; i < schemes->len; ++i) { @@ -447,7 +447,7 @@ void QFileDialog_connect_FileSelected(QFileDialog* self, intptr_t slot) { } void QFileDialog_FilesSelected(QFileDialog* self, struct miqt_array* /* of struct miqt_string* */ files) { - QList files_QList; + QStringList files_QList; files_QList.reserve(files->len); struct miqt_string** files_arr = static_cast(files->data); for(size_t i = 0; i < files->len; ++i) { @@ -846,7 +846,7 @@ QUrl* QFileDialog_GetExistingDirectoryUrl4(QWidget* parent, struct miqt_string* QUrl* QFileDialog_GetExistingDirectoryUrl5(QWidget* parent, struct miqt_string* caption, QUrl* dir, int options, struct miqt_array* /* of struct miqt_string* */ supportedSchemes) { QString caption_QString = QString::fromUtf8(&caption->data, caption->len); - QList supportedSchemes_QList; + QStringList supportedSchemes_QList; supportedSchemes_QList.reserve(supportedSchemes->len); struct miqt_string** supportedSchemes_arr = static_cast(supportedSchemes->data); for(size_t i = 0; i < supportedSchemes->len; ++i) { diff --git a/qt/gen_qfiledialog.go b/qt/gen_qfiledialog.go index 61dacc3b..e91d4ea6 100644 --- a/qt/gen_qfiledialog.go +++ b/qt/gen_qfiledialog.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -73,14 +74,21 @@ func (this *QFileDialog) cPointer() *C.QFileDialog { return this.h } +func (this *QFileDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileDialog(h *C.QFileDialog) *QFileDialog { if h == nil { return nil } - return &QFileDialog{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QFileDialog{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQFileDialog_U(h unsafe.Pointer) *QFileDialog { +func UnsafeNewQFileDialog(h unsafe.Pointer) *QFileDialog { return newQFileDialog((*C.QFileDialog)(h)) } @@ -104,7 +112,7 @@ func NewQFileDialog3(parent *QWidget) *QFileDialog { // NewQFileDialog4 constructs a new QFileDialog object. func NewQFileDialog4(parent *QWidget, caption string) *QFileDialog { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) ret := C.QFileDialog_new4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) return newQFileDialog(ret) @@ -112,9 +120,9 @@ func NewQFileDialog4(parent *QWidget, caption string) *QFileDialog { // NewQFileDialog5 constructs a new QFileDialog object. func NewQFileDialog5(parent *QWidget, caption string, directory string) *QFileDialog { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) ret := C.QFileDialog_new5(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(directory_ms)) return newQFileDialog(ret) @@ -122,18 +130,18 @@ func NewQFileDialog5(parent *QWidget, caption string, directory string) *QFileDi // NewQFileDialog6 constructs a new QFileDialog object. func NewQFileDialog6(parent *QWidget, caption string, directory string, filter string) *QFileDialog { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) ret := C.QFileDialog_new6(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(directory_ms), (*C.struct_miqt_string)(filter_ms)) return newQFileDialog(ret) } func (this *QFileDialog) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFileDialog_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFileDialog_MetaObject(this.h))) } func (this *QFileDialog) Metacast(param1 string) unsafe.Pointer { @@ -161,7 +169,7 @@ func QFileDialog_TrUtf8(s string) string { } func (this *QFileDialog) SetDirectory(directory string) { - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) C.QFileDialog_SetDirectory(this.h, (*C.struct_miqt_string)(directory_ms)) } @@ -189,7 +197,7 @@ func (this *QFileDialog) DirectoryUrl() *QUrl { } func (this *QFileDialog) SelectFile(filename string) { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) C.QFileDialog_SelectFile(this.h, (*C.struct_miqt_string)(filename_ms)) } @@ -235,7 +243,7 @@ func (this *QFileDialog) IsNameFilterDetailsVisible() bool { } func (this *QFileDialog) SetNameFilter(filter string) { - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) C.QFileDialog_SetNameFilter(this.h, (*C.struct_miqt_string)(filter_ms)) } @@ -245,7 +253,7 @@ func (this *QFileDialog) SetNameFilters(filters []string) { filters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(filters)))) defer C.free(unsafe.Pointer(filters_CArray)) for i := range filters { - filters_i_ms := miqt_strdupg(filters[i]) + filters_i_ms := libmiqt.Strdupg(filters[i]) defer C.free(filters_i_ms) filters_CArray[i] = (*C.struct_miqt_string)(filters_i_ms) } @@ -269,7 +277,7 @@ func (this *QFileDialog) NameFilters() []string { } func (this *QFileDialog) SelectNameFilter(filter string) { - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) C.QFileDialog_SelectNameFilter(this.h, (*C.struct_miqt_string)(filter_ms)) } @@ -293,7 +301,7 @@ func (this *QFileDialog) SetMimeTypeFilters(filters []string) { filters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(filters)))) defer C.free(unsafe.Pointer(filters_CArray)) for i := range filters { - filters_i_ms := miqt_strdupg(filters[i]) + filters_i_ms := libmiqt.Strdupg(filters[i]) defer C.free(filters_i_ms) filters_CArray[i] = (*C.struct_miqt_string)(filters_i_ms) } @@ -317,7 +325,7 @@ func (this *QFileDialog) MimeTypeFilters() []string { } func (this *QFileDialog) SelectMimeTypeFilter(filter string) { - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) C.QFileDialog_SelectMimeTypeFilter(this.h, (*C.struct_miqt_string)(filter_ms)) } @@ -416,7 +424,7 @@ func (this *QFileDialog) ConfirmOverwrite() bool { } func (this *QFileDialog) SetDefaultSuffix(suffix string) { - suffix_ms := miqt_strdupg(suffix) + suffix_ms := libmiqt.Strdupg(suffix) defer C.free(suffix_ms) C.QFileDialog_SetDefaultSuffix(this.h, (*C.struct_miqt_string)(suffix_ms)) } @@ -433,7 +441,7 @@ func (this *QFileDialog) SetHistory(paths []string) { paths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(paths)))) defer C.free(unsafe.Pointer(paths_CArray)) for i := range paths { - paths_i_ms := miqt_strdupg(paths[i]) + paths_i_ms := libmiqt.Strdupg(paths[i]) defer C.free(paths_i_ms) paths_CArray[i] = (*C.struct_miqt_string)(paths_i_ms) } @@ -461,7 +469,7 @@ func (this *QFileDialog) SetItemDelegate(delegate *QAbstractItemDelegate) { } func (this *QFileDialog) ItemDelegate() *QAbstractItemDelegate { - return newQAbstractItemDelegate_U(unsafe.Pointer(C.QFileDialog_ItemDelegate(this.h))) + return UnsafeNewQAbstractItemDelegate(unsafe.Pointer(C.QFileDialog_ItemDelegate(this.h))) } func (this *QFileDialog) SetIconProvider(provider *QFileIconProvider) { @@ -469,11 +477,11 @@ func (this *QFileDialog) SetIconProvider(provider *QFileIconProvider) { } func (this *QFileDialog) IconProvider() *QFileIconProvider { - return newQFileIconProvider_U(unsafe.Pointer(C.QFileDialog_IconProvider(this.h))) + return UnsafeNewQFileIconProvider(unsafe.Pointer(C.QFileDialog_IconProvider(this.h))) } func (this *QFileDialog) SetLabelText(label QFileDialog__DialogLabel, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QFileDialog_SetLabelText(this.h, (C.int)(label), (*C.struct_miqt_string)(text_ms)) } @@ -490,7 +498,7 @@ func (this *QFileDialog) SetSupportedSchemes(schemes []string) { schemes_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(schemes)))) defer C.free(unsafe.Pointer(schemes_CArray)) for i := range schemes { - schemes_i_ms := miqt_strdupg(schemes[i]) + schemes_i_ms := libmiqt.Strdupg(schemes[i]) defer C.free(schemes_i_ms) schemes_CArray[i] = (*C.struct_miqt_string)(schemes_i_ms) } @@ -518,7 +526,7 @@ func (this *QFileDialog) SetProxyModel(model *QAbstractProxyModel) { } func (this *QFileDialog) ProxyModel() *QAbstractProxyModel { - return newQAbstractProxyModel_U(unsafe.Pointer(C.QFileDialog_ProxyModel(this.h))) + return UnsafeNewQAbstractProxyModel(unsafe.Pointer(C.QFileDialog_ProxyModel(this.h))) } func (this *QFileDialog) SetOption(option QFileDialog__Option) { @@ -542,7 +550,7 @@ func (this *QFileDialog) SetVisible(visible bool) { } func (this *QFileDialog) FileSelected(file string) { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) C.QFileDialog_FileSelected(this.h, (*C.struct_miqt_string)(file_ms)) } @@ -571,7 +579,7 @@ func (this *QFileDialog) FilesSelected(files []string) { files_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(files)))) defer C.free(unsafe.Pointer(files_CArray)) for i := range files { - files_i_ms := miqt_strdupg(files[i]) + files_i_ms := libmiqt.Strdupg(files[i]) defer C.free(files_i_ms) files_CArray[i] = (*C.struct_miqt_string)(files_i_ms) } @@ -607,7 +615,7 @@ func miqt_exec_callback_QFileDialog_FilesSelected(cb C.intptr_t, files *C.struct } func (this *QFileDialog) CurrentChanged(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QFileDialog_CurrentChanged(this.h, (*C.struct_miqt_string)(path_ms)) } @@ -632,7 +640,7 @@ func miqt_exec_callback_QFileDialog_CurrentChanged(cb C.intptr_t, path *C.struct } func (this *QFileDialog) DirectoryEntered(directory string) { - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) C.QFileDialog_DirectoryEntered(this.h, (*C.struct_miqt_string)(directory_ms)) } @@ -671,7 +679,7 @@ func miqt_exec_callback_QFileDialog_UrlSelected(cb C.intptr_t, url *C.QUrl) { } // Convert all CABI parameters to Go parameters - slotval1 := newQUrl_U(unsafe.Pointer(url)) + slotval1 := UnsafeNewQUrl(unsafe.Pointer(url)) gofunc(slotval1) } @@ -729,7 +737,7 @@ func miqt_exec_callback_QFileDialog_CurrentUrlChanged(cb C.intptr_t, url *C.QUrl } // Convert all CABI parameters to Go parameters - slotval1 := newQUrl_U(unsafe.Pointer(url)) + slotval1 := UnsafeNewQUrl(unsafe.Pointer(url)) gofunc(slotval1) } @@ -749,13 +757,13 @@ func miqt_exec_callback_QFileDialog_DirectoryUrlEntered(cb C.intptr_t, directory } // Convert all CABI parameters to Go parameters - slotval1 := newQUrl_U(unsafe.Pointer(directory)) + slotval1 := UnsafeNewQUrl(unsafe.Pointer(directory)) gofunc(slotval1) } func (this *QFileDialog) FilterSelected(filter string) { - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) C.QFileDialog_FilterSelected(this.h, (*C.struct_miqt_string)(filter_ms)) } @@ -909,7 +917,7 @@ func QFileDialog_GetOpenFileName1(parent *QWidget) string { } func QFileDialog_GetOpenFileName2(parent *QWidget, caption string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetOpenFileName2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -918,9 +926,9 @@ func QFileDialog_GetOpenFileName2(parent *QWidget, caption string) string { } func QFileDialog_GetOpenFileName3(parent *QWidget, caption string, dir string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetOpenFileName3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -929,11 +937,11 @@ func QFileDialog_GetOpenFileName3(parent *QWidget, caption string, dir string) s } func QFileDialog_GetOpenFileName4(parent *QWidget, caption string, dir string, filter string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetOpenFileName4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms), (*C.struct_miqt_string)(filter_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -949,7 +957,7 @@ func QFileDialog_GetOpenFileUrl1(parent *QWidget) *QUrl { } func QFileDialog_GetOpenFileUrl2(parent *QWidget, caption string) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) _ret := C.QFileDialog_GetOpenFileUrl2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _goptr := newQUrl(_ret) @@ -958,7 +966,7 @@ func QFileDialog_GetOpenFileUrl2(parent *QWidget, caption string) *QUrl { } func QFileDialog_GetOpenFileUrl3(parent *QWidget, caption string, dir *QUrl) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) _ret := C.QFileDialog_GetOpenFileUrl3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer()) _goptr := newQUrl(_ret) @@ -967,9 +975,9 @@ func QFileDialog_GetOpenFileUrl3(parent *QWidget, caption string, dir *QUrl) *QU } func QFileDialog_GetOpenFileUrl4(parent *QWidget, caption string, dir *QUrl, filter string) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) _ret := C.QFileDialog_GetOpenFileUrl4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer(), (*C.struct_miqt_string)(filter_ms)) _goptr := newQUrl(_ret) @@ -985,7 +993,7 @@ func QFileDialog_GetSaveFileName1(parent *QWidget) string { } func QFileDialog_GetSaveFileName2(parent *QWidget, caption string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetSaveFileName2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -994,9 +1002,9 @@ func QFileDialog_GetSaveFileName2(parent *QWidget, caption string) string { } func QFileDialog_GetSaveFileName3(parent *QWidget, caption string, dir string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetSaveFileName3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1005,11 +1013,11 @@ func QFileDialog_GetSaveFileName3(parent *QWidget, caption string, dir string) s } func QFileDialog_GetSaveFileName4(parent *QWidget, caption string, dir string, filter string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetSaveFileName4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms), (*C.struct_miqt_string)(filter_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1025,7 +1033,7 @@ func QFileDialog_GetSaveFileUrl1(parent *QWidget) *QUrl { } func QFileDialog_GetSaveFileUrl2(parent *QWidget, caption string) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) _ret := C.QFileDialog_GetSaveFileUrl2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _goptr := newQUrl(_ret) @@ -1034,7 +1042,7 @@ func QFileDialog_GetSaveFileUrl2(parent *QWidget, caption string) *QUrl { } func QFileDialog_GetSaveFileUrl3(parent *QWidget, caption string, dir *QUrl) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) _ret := C.QFileDialog_GetSaveFileUrl3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer()) _goptr := newQUrl(_ret) @@ -1043,9 +1051,9 @@ func QFileDialog_GetSaveFileUrl3(parent *QWidget, caption string, dir *QUrl) *QU } func QFileDialog_GetSaveFileUrl4(parent *QWidget, caption string, dir *QUrl, filter string) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) _ret := C.QFileDialog_GetSaveFileUrl4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer(), (*C.struct_miqt_string)(filter_ms)) _goptr := newQUrl(_ret) @@ -1061,7 +1069,7 @@ func QFileDialog_GetExistingDirectory1(parent *QWidget) string { } func QFileDialog_GetExistingDirectory2(parent *QWidget, caption string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetExistingDirectory2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1070,9 +1078,9 @@ func QFileDialog_GetExistingDirectory2(parent *QWidget, caption string) string { } func QFileDialog_GetExistingDirectory3(parent *QWidget, caption string, dir string) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetExistingDirectory3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1081,9 +1089,9 @@ func QFileDialog_GetExistingDirectory3(parent *QWidget, caption string, dir stri } func QFileDialog_GetExistingDirectory4(parent *QWidget, caption string, dir string, options QFileDialog__Option) string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) var _ms *C.struct_miqt_string = C.QFileDialog_GetExistingDirectory4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms), (C.int)(options)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1099,7 +1107,7 @@ func QFileDialog_GetExistingDirectoryUrl1(parent *QWidget) *QUrl { } func QFileDialog_GetExistingDirectoryUrl2(parent *QWidget, caption string) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) _ret := C.QFileDialog_GetExistingDirectoryUrl2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _goptr := newQUrl(_ret) @@ -1108,7 +1116,7 @@ func QFileDialog_GetExistingDirectoryUrl2(parent *QWidget, caption string) *QUrl } func QFileDialog_GetExistingDirectoryUrl3(parent *QWidget, caption string, dir *QUrl) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) _ret := C.QFileDialog_GetExistingDirectoryUrl3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer()) _goptr := newQUrl(_ret) @@ -1117,7 +1125,7 @@ func QFileDialog_GetExistingDirectoryUrl3(parent *QWidget, caption string, dir * } func QFileDialog_GetExistingDirectoryUrl4(parent *QWidget, caption string, dir *QUrl, options QFileDialog__Option) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) _ret := C.QFileDialog_GetExistingDirectoryUrl4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer(), (C.int)(options)) _goptr := newQUrl(_ret) @@ -1126,13 +1134,13 @@ func QFileDialog_GetExistingDirectoryUrl4(parent *QWidget, caption string, dir * } func QFileDialog_GetExistingDirectoryUrl5(parent *QWidget, caption string, dir *QUrl, options QFileDialog__Option, supportedSchemes []string) *QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) // For the C ABI, malloc a C array of raw pointers supportedSchemes_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(supportedSchemes)))) defer C.free(unsafe.Pointer(supportedSchemes_CArray)) for i := range supportedSchemes { - supportedSchemes_i_ms := miqt_strdupg(supportedSchemes[i]) + supportedSchemes_i_ms := libmiqt.Strdupg(supportedSchemes[i]) defer C.free(supportedSchemes_i_ms) supportedSchemes_CArray[i] = (*C.struct_miqt_string)(supportedSchemes_i_ms) } @@ -1159,7 +1167,7 @@ func QFileDialog_GetOpenFileNames1(parent *QWidget) []string { } func QFileDialog_GetOpenFileNames2(parent *QWidget, caption string) []string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) var _ma *C.struct_miqt_array = C.QFileDialog_GetOpenFileNames2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _ret := make([]string, int(_ma.len)) @@ -1175,9 +1183,9 @@ func QFileDialog_GetOpenFileNames2(parent *QWidget, caption string) []string { } func QFileDialog_GetOpenFileNames3(parent *QWidget, caption string, dir string) []string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) var _ma *C.struct_miqt_array = C.QFileDialog_GetOpenFileNames3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms)) _ret := make([]string, int(_ma.len)) @@ -1193,11 +1201,11 @@ func QFileDialog_GetOpenFileNames3(parent *QWidget, caption string, dir string) } func QFileDialog_GetOpenFileNames4(parent *QWidget, caption string, dir string, filter string) []string { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) var _ma *C.struct_miqt_array = C.QFileDialog_GetOpenFileNames4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), (*C.struct_miqt_string)(dir_ms), (*C.struct_miqt_string)(filter_ms)) _ret := make([]string, int(_ma.len)) @@ -1227,7 +1235,7 @@ func QFileDialog_GetOpenFileUrls1(parent *QWidget) []QUrl { } func QFileDialog_GetOpenFileUrls2(parent *QWidget, caption string) []QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) var _ma *C.struct_miqt_array = C.QFileDialog_GetOpenFileUrls2(parent.cPointer(), (*C.struct_miqt_string)(caption_ms)) _ret := make([]QUrl, int(_ma.len)) @@ -1243,7 +1251,7 @@ func QFileDialog_GetOpenFileUrls2(parent *QWidget, caption string) []QUrl { } func QFileDialog_GetOpenFileUrls3(parent *QWidget, caption string, dir *QUrl) []QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) var _ma *C.struct_miqt_array = C.QFileDialog_GetOpenFileUrls3(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer()) _ret := make([]QUrl, int(_ma.len)) @@ -1259,9 +1267,9 @@ func QFileDialog_GetOpenFileUrls3(parent *QWidget, caption string, dir *QUrl) [] } func QFileDialog_GetOpenFileUrls4(parent *QWidget, caption string, dir *QUrl, filter string) []QUrl { - caption_ms := miqt_strdupg(caption) + caption_ms := libmiqt.Strdupg(caption) defer C.free(caption_ms) - filter_ms := miqt_strdupg(filter) + filter_ms := libmiqt.Strdupg(filter) defer C.free(filter_ms) var _ma *C.struct_miqt_array = C.QFileDialog_GetOpenFileUrls4(parent.cPointer(), (*C.struct_miqt_string)(caption_ms), dir.cPointer(), (*C.struct_miqt_string)(filter_ms)) _ret := make([]QUrl, int(_ma.len)) @@ -1277,7 +1285,7 @@ func QFileDialog_GetOpenFileUrls4(parent *QWidget, caption string, dir *QUrl, fi } func QFileDialog_SaveFileContent2(fileContent *QByteArray, fileNameHint string) { - fileNameHint_ms := miqt_strdupg(fileNameHint) + fileNameHint_ms := libmiqt.Strdupg(fileNameHint) defer C.free(fileNameHint_ms) C.QFileDialog_SaveFileContent2(fileContent.cPointer(), (*C.struct_miqt_string)(fileNameHint_ms)) } diff --git a/qt/gen_qfiledialog.h b/qt/gen_qfiledialog.h index 610801cf..25f021e0 100644 --- a/qt/gen_qfiledialog.h +++ b/qt/gen_qfiledialog.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfileiconprovider.cpp b/qt/gen_qfileiconprovider.cpp index 40d18f49..11a39ab8 100644 --- a/qt/gen_qfileiconprovider.cpp +++ b/qt/gen_qfileiconprovider.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qfileiconprovider.h" +#include #include "gen_qfileiconprovider.h" #include "_cgo_export.h" diff --git a/qt/gen_qfileiconprovider.go b/qt/gen_qfileiconprovider.go index 94bf0849..bda88382 100644 --- a/qt/gen_qfileiconprovider.go +++ b/qt/gen_qfileiconprovider.go @@ -42,6 +42,13 @@ func (this *QFileIconProvider) cPointer() *C.QFileIconProvider { return this.h } +func (this *QFileIconProvider) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileIconProvider(h *C.QFileIconProvider) *QFileIconProvider { if h == nil { return nil @@ -49,7 +56,7 @@ func newQFileIconProvider(h *C.QFileIconProvider) *QFileIconProvider { return &QFileIconProvider{h: h} } -func newQFileIconProvider_U(h unsafe.Pointer) *QFileIconProvider { +func UnsafeNewQFileIconProvider(h unsafe.Pointer) *QFileIconProvider { return newQFileIconProvider((*C.QFileIconProvider)(h)) } diff --git a/qt/gen_qfileiconprovider.h b/qt/gen_qfileiconprovider.h index 3a36486e..e504c176 100644 --- a/qt/gen_qfileiconprovider.h +++ b/qt/gen_qfileiconprovider.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfileinfo.cpp b/qt/gen_qfileinfo.cpp index 6fc91bc0..43f2c657 100644 --- a/qt/gen_qfileinfo.cpp +++ b/qt/gen_qfileinfo.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qfileinfo.h" +#include #include "gen_qfileinfo.h" #include "_cgo_export.h" diff --git a/qt/gen_qfileinfo.go b/qt/gen_qfileinfo.go index cdb2ec45..1c3e700f 100644 --- a/qt/gen_qfileinfo.go +++ b/qt/gen_qfileinfo.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QFileInfo) cPointer() *C.QFileInfo { return this.h } +func (this *QFileInfo) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileInfo(h *C.QFileInfo) *QFileInfo { if h == nil { return nil @@ -31,7 +39,7 @@ func newQFileInfo(h *C.QFileInfo) *QFileInfo { return &QFileInfo{h: h} } -func newQFileInfo_U(h unsafe.Pointer) *QFileInfo { +func UnsafeNewQFileInfo(h unsafe.Pointer) *QFileInfo { return newQFileInfo((*C.QFileInfo)(h)) } @@ -43,7 +51,7 @@ func NewQFileInfo() *QFileInfo { // NewQFileInfo2 constructs a new QFileInfo object. func NewQFileInfo2(file string) *QFileInfo { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) ret := C.QFileInfo_new2((*C.struct_miqt_string)(file_ms)) return newQFileInfo(ret) @@ -57,7 +65,7 @@ func NewQFileInfo3(file *QFile) *QFileInfo { // NewQFileInfo4 constructs a new QFileInfo object. func NewQFileInfo4(dir *QDir, file string) *QFileInfo { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) ret := C.QFileInfo_new4(dir.cPointer(), (*C.struct_miqt_string)(file_ms)) return newQFileInfo(ret) @@ -86,7 +94,7 @@ func (this *QFileInfo) OperatorNotEqual(fileinfo *QFileInfo) bool { } func (this *QFileInfo) SetFile(file string) { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) C.QFileInfo_SetFile(this.h, (*C.struct_miqt_string)(file_ms)) } @@ -96,7 +104,7 @@ func (this *QFileInfo) SetFileWithFile(file *QFile) { } func (this *QFileInfo) SetFile2(dir *QDir, file string) { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) C.QFileInfo_SetFile2(this.h, dir.cPointer(), (*C.struct_miqt_string)(file_ms)) } @@ -106,7 +114,7 @@ func (this *QFileInfo) Exists() bool { } func QFileInfo_ExistsWithFile(file string) bool { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) return (bool)(C.QFileInfo_ExistsWithFile((*C.struct_miqt_string)(file_ms))) } diff --git a/qt/gen_qfileinfo.h b/qt/gen_qfileinfo.h index 2408dc6a..85f30d4c 100644 --- a/qt/gen_qfileinfo.h +++ b/qt/gen_qfileinfo.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfileselector.cpp b/qt/gen_qfileselector.cpp index e8eea0d8..521b1d56 100644 --- a/qt/gen_qfileselector.cpp +++ b/qt/gen_qfileselector.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qfileselector.h" +#include #include "gen_qfileselector.h" #include "_cgo_export.h" @@ -69,7 +69,7 @@ struct miqt_array* QFileSelector_ExtraSelectors(const QFileSelector* self) { } void QFileSelector_SetExtraSelectors(QFileSelector* self, struct miqt_array* /* of struct miqt_string* */ list) { - QList list_QList; + QStringList list_QList; list_QList.reserve(list->len); struct miqt_string** list_arr = static_cast(list->data); for(size_t i = 0; i < list->len; ++i) { diff --git a/qt/gen_qfileselector.go b/qt/gen_qfileselector.go index 18f1b2a6..734fd795 100644 --- a/qt/gen_qfileselector.go +++ b/qt/gen_qfileselector.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QFileSelector) cPointer() *C.QFileSelector { return this.h } +func (this *QFileSelector) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileSelector(h *C.QFileSelector) *QFileSelector { if h == nil { return nil } - return &QFileSelector{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QFileSelector{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQFileSelector_U(h unsafe.Pointer) *QFileSelector { +func UnsafeNewQFileSelector(h unsafe.Pointer) *QFileSelector { return newQFileSelector((*C.QFileSelector)(h)) } @@ -49,7 +57,7 @@ func NewQFileSelector2(parent *QObject) *QFileSelector { } func (this *QFileSelector) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFileSelector_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFileSelector_MetaObject(this.h))) } func (this *QFileSelector) Metacast(param1 string) unsafe.Pointer { @@ -77,7 +85,7 @@ func QFileSelector_TrUtf8(s string) string { } func (this *QFileSelector) Select(filePath string) string { - filePath_ms := miqt_strdupg(filePath) + filePath_ms := libmiqt.Strdupg(filePath) defer C.free(filePath_ms) var _ms *C.struct_miqt_string = C.QFileSelector_Select(this.h, (*C.struct_miqt_string)(filePath_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -111,7 +119,7 @@ func (this *QFileSelector) SetExtraSelectors(list []string) { list_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(list)))) defer C.free(unsafe.Pointer(list_CArray)) for i := range list { - list_i_ms := miqt_strdupg(list[i]) + list_i_ms := libmiqt.Strdupg(list[i]) defer C.free(list_i_ms) list_CArray[i] = (*C.struct_miqt_string)(list_i_ms) } diff --git a/qt/gen_qfileselector.h b/qt/gen_qfileselector.h index bc83e36f..be3dfa70 100644 --- a/qt/gen_qfileselector.h +++ b/qt/gen_qfileselector.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfilesystemmodel.cpp b/qt/gen_qfilesystemmodel.cpp index d5d652a0..69c5a1a7 100644 --- a/qt/gen_qfilesystemmodel.cpp +++ b/qt/gen_qfilesystemmodel.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qfilesystemmodel.h" +#include #include "gen_qfilesystemmodel.h" #include "_cgo_export.h" @@ -181,7 +181,7 @@ struct miqt_array* QFileSystemModel_MimeTypes(const QFileSystemModel* self) { } QMimeData* QFileSystemModel_MimeData(const QFileSystemModel* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { @@ -257,7 +257,7 @@ bool QFileSystemModel_NameFilterDisables(const QFileSystemModel* self) { } void QFileSystemModel_SetNameFilters(QFileSystemModel* self, struct miqt_array* /* of struct miqt_string* */ filters) { - QList filters_QList; + QStringList filters_QList; filters_QList.reserve(filters->len); struct miqt_string** filters_arr = static_cast(filters->data); for(size_t i = 0; i < filters->len; ++i) { diff --git a/qt/gen_qfilesystemmodel.go b/qt/gen_qfilesystemmodel.go index 8b68b4d4..c1b31ea4 100644 --- a/qt/gen_qfilesystemmodel.go +++ b/qt/gen_qfilesystemmodel.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -43,14 +44,21 @@ func (this *QFileSystemModel) cPointer() *C.QFileSystemModel { return this.h } +func (this *QFileSystemModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileSystemModel(h *C.QFileSystemModel) *QFileSystemModel { if h == nil { return nil } - return &QFileSystemModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))} + return &QFileSystemModel{h: h, QAbstractItemModel: UnsafeNewQAbstractItemModel(unsafe.Pointer(h))} } -func newQFileSystemModel_U(h unsafe.Pointer) *QFileSystemModel { +func UnsafeNewQFileSystemModel(h unsafe.Pointer) *QFileSystemModel { return newQFileSystemModel((*C.QFileSystemModel)(h)) } @@ -67,7 +75,7 @@ func NewQFileSystemModel2(parent *QObject) *QFileSystemModel { } func (this *QFileSystemModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFileSystemModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFileSystemModel_MetaObject(this.h))) } func (this *QFileSystemModel) Metacast(param1 string) unsafe.Pointer { @@ -95,7 +103,7 @@ func QFileSystemModel_TrUtf8(s string) string { } func (this *QFileSystemModel) RootPathChanged(newPath string) { - newPath_ms := miqt_strdupg(newPath) + newPath_ms := libmiqt.Strdupg(newPath) defer C.free(newPath_ms) C.QFileSystemModel_RootPathChanged(this.h, (*C.struct_miqt_string)(newPath_ms)) } @@ -120,11 +128,11 @@ func miqt_exec_callback_QFileSystemModel_RootPathChanged(cb C.intptr_t, newPath } func (this *QFileSystemModel) FileRenamed(path string, oldName string, newName string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) - oldName_ms := miqt_strdupg(oldName) + oldName_ms := libmiqt.Strdupg(oldName) defer C.free(oldName_ms) - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) C.QFileSystemModel_FileRenamed(this.h, (*C.struct_miqt_string)(path_ms), (*C.struct_miqt_string)(oldName_ms), (*C.struct_miqt_string)(newName_ms)) } @@ -157,7 +165,7 @@ func miqt_exec_callback_QFileSystemModel_FileRenamed(cb C.intptr_t, path *C.stru } func (this *QFileSystemModel) DirectoryLoaded(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QFileSystemModel_DirectoryLoaded(this.h, (*C.struct_miqt_string)(path_ms)) } @@ -189,7 +197,7 @@ func (this *QFileSystemModel) Index(row int, column int) *QModelIndex { } func (this *QFileSystemModel) IndexWithPath(path string) *QModelIndex { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) _ret := C.QFileSystemModel_IndexWithPath(this.h, (*C.struct_miqt_string)(path_ms)) _goptr := newQModelIndex(_ret) @@ -287,7 +295,7 @@ func (this *QFileSystemModel) MimeData(indexes []QModelIndex) *QMimeData { } indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)} defer runtime.KeepAlive(unsafe.Pointer(indexes_ma)) - return newQMimeData_U(unsafe.Pointer(C.QFileSystemModel_MimeData(this.h, indexes_ma))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QFileSystemModel_MimeData(this.h, indexes_ma))) } func (this *QFileSystemModel) DropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool { @@ -299,7 +307,7 @@ func (this *QFileSystemModel) SupportedDropActions() DropAction { } func (this *QFileSystemModel) SetRootPath(path string) *QModelIndex { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) _ret := C.QFileSystemModel_SetRootPath(this.h, (*C.struct_miqt_string)(path_ms)) _goptr := newQModelIndex(_ret) @@ -326,7 +334,7 @@ func (this *QFileSystemModel) SetIconProvider(provider *QFileIconProvider) { } func (this *QFileSystemModel) IconProvider() *QFileIconProvider { - return newQFileIconProvider_U(unsafe.Pointer(C.QFileSystemModel_IconProvider(this.h))) + return UnsafeNewQFileIconProvider(unsafe.Pointer(C.QFileSystemModel_IconProvider(this.h))) } func (this *QFileSystemModel) SetFilter(filters QDir__Filter) { @@ -366,7 +374,7 @@ func (this *QFileSystemModel) SetNameFilters(filters []string) { filters_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(filters)))) defer C.free(unsafe.Pointer(filters_CArray)) for i := range filters { - filters_i_ms := miqt_strdupg(filters[i]) + filters_i_ms := libmiqt.Strdupg(filters[i]) defer C.free(filters_i_ms) filters_CArray[i] = (*C.struct_miqt_string)(filters_i_ms) } @@ -435,7 +443,7 @@ func (this *QFileSystemModel) LastModified(index *QModelIndex) *QDateTime { } func (this *QFileSystemModel) Mkdir(parent *QModelIndex, name string) *QModelIndex { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) _ret := C.QFileSystemModel_Mkdir(this.h, parent.cPointer(), (*C.struct_miqt_string)(name_ms)) _goptr := newQModelIndex(_ret) @@ -528,7 +536,7 @@ func (this *QFileSystemModel) Index3(row int, column int, parent *QModelIndex) * } func (this *QFileSystemModel) Index2(path string, column int) *QModelIndex { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) _ret := C.QFileSystemModel_Index2(this.h, (*C.struct_miqt_string)(path_ms), (C.int)(column)) _goptr := newQModelIndex(_ret) diff --git a/qt/gen_qfilesystemmodel.h b/qt/gen_qfilesystemmodel.h index 23fe6dcb..d150f3e5 100644 --- a/qt/gen_qfilesystemmodel.h +++ b/qt/gen_qfilesystemmodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfilesystemwatcher.cpp b/qt/gen_qfilesystemwatcher.cpp index c50716fc..bf9871c4 100644 --- a/qt/gen_qfilesystemwatcher.cpp +++ b/qt/gen_qfilesystemwatcher.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qfilesystemwatcher.h" +#include #include "gen_qfilesystemwatcher.h" #include "_cgo_export.h" @@ -14,7 +14,7 @@ QFileSystemWatcher* QFileSystemWatcher_new() { } QFileSystemWatcher* QFileSystemWatcher_new2(struct miqt_array* /* of struct miqt_string* */ paths) { - QList paths_QList; + QStringList paths_QList; paths_QList.reserve(paths->len); struct miqt_string** paths_arr = static_cast(paths->data); for(size_t i = 0; i < paths->len; ++i) { @@ -29,7 +29,7 @@ QFileSystemWatcher* QFileSystemWatcher_new3(QObject* parent) { } QFileSystemWatcher* QFileSystemWatcher_new4(struct miqt_array* /* of struct miqt_string* */ paths, QObject* parent) { - QList paths_QList; + QStringList paths_QList; paths_QList.reserve(paths->len); struct miqt_string** paths_arr = static_cast(paths->data); for(size_t i = 0; i < paths->len; ++i) { @@ -67,7 +67,7 @@ bool QFileSystemWatcher_AddPath(QFileSystemWatcher* self, struct miqt_string* fi } struct miqt_array* QFileSystemWatcher_AddPaths(QFileSystemWatcher* self, struct miqt_array* /* of struct miqt_string* */ files) { - QList files_QList; + QStringList files_QList; files_QList.reserve(files->len); struct miqt_string** files_arr = static_cast(files->data); for(size_t i = 0; i < files->len; ++i) { @@ -95,7 +95,7 @@ bool QFileSystemWatcher_RemovePath(QFileSystemWatcher* self, struct miqt_string* } struct miqt_array* QFileSystemWatcher_RemovePaths(QFileSystemWatcher* self, struct miqt_array* /* of struct miqt_string* */ files) { - QList files_QList; + QStringList files_QList; files_QList.reserve(files->len); struct miqt_string** files_arr = static_cast(files->data); for(size_t i = 0; i < files->len; ++i) { diff --git a/qt/gen_qfilesystemwatcher.go b/qt/gen_qfilesystemwatcher.go index 3d013d55..7d74c9f3 100644 --- a/qt/gen_qfilesystemwatcher.go +++ b/qt/gen_qfilesystemwatcher.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QFileSystemWatcher) cPointer() *C.QFileSystemWatcher { return this.h } +func (this *QFileSystemWatcher) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFileSystemWatcher(h *C.QFileSystemWatcher) *QFileSystemWatcher { if h == nil { return nil } - return &QFileSystemWatcher{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QFileSystemWatcher{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQFileSystemWatcher_U(h unsafe.Pointer) *QFileSystemWatcher { +func UnsafeNewQFileSystemWatcher(h unsafe.Pointer) *QFileSystemWatcher { return newQFileSystemWatcher((*C.QFileSystemWatcher)(h)) } @@ -48,7 +56,7 @@ func NewQFileSystemWatcher2(paths []string) *QFileSystemWatcher { paths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(paths)))) defer C.free(unsafe.Pointer(paths_CArray)) for i := range paths { - paths_i_ms := miqt_strdupg(paths[i]) + paths_i_ms := libmiqt.Strdupg(paths[i]) defer C.free(paths_i_ms) paths_CArray[i] = (*C.struct_miqt_string)(paths_i_ms) } @@ -70,7 +78,7 @@ func NewQFileSystemWatcher4(paths []string, parent *QObject) *QFileSystemWatcher paths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(paths)))) defer C.free(unsafe.Pointer(paths_CArray)) for i := range paths { - paths_i_ms := miqt_strdupg(paths[i]) + paths_i_ms := libmiqt.Strdupg(paths[i]) defer C.free(paths_i_ms) paths_CArray[i] = (*C.struct_miqt_string)(paths_i_ms) } @@ -81,7 +89,7 @@ func NewQFileSystemWatcher4(paths []string, parent *QObject) *QFileSystemWatcher } func (this *QFileSystemWatcher) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFileSystemWatcher_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFileSystemWatcher_MetaObject(this.h))) } func (this *QFileSystemWatcher) Metacast(param1 string) unsafe.Pointer { @@ -109,7 +117,7 @@ func QFileSystemWatcher_TrUtf8(s string) string { } func (this *QFileSystemWatcher) AddPath(file string) bool { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) return (bool)(C.QFileSystemWatcher_AddPath(this.h, (*C.struct_miqt_string)(file_ms))) } @@ -119,7 +127,7 @@ func (this *QFileSystemWatcher) AddPaths(files []string) []string { files_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(files)))) defer C.free(unsafe.Pointer(files_CArray)) for i := range files { - files_i_ms := miqt_strdupg(files[i]) + files_i_ms := libmiqt.Strdupg(files[i]) defer C.free(files_i_ms) files_CArray[i] = (*C.struct_miqt_string)(files_i_ms) } @@ -139,7 +147,7 @@ func (this *QFileSystemWatcher) AddPaths(files []string) []string { } func (this *QFileSystemWatcher) RemovePath(file string) bool { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) return (bool)(C.QFileSystemWatcher_RemovePath(this.h, (*C.struct_miqt_string)(file_ms))) } @@ -149,7 +157,7 @@ func (this *QFileSystemWatcher) RemovePaths(files []string) []string { files_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(files)))) defer C.free(unsafe.Pointer(files_CArray)) for i := range files { - files_i_ms := miqt_strdupg(files[i]) + files_i_ms := libmiqt.Strdupg(files[i]) defer C.free(files_i_ms) files_CArray[i] = (*C.struct_miqt_string)(files_i_ms) } diff --git a/qt/gen_qfilesystemwatcher.h b/qt/gen_qfilesystemwatcher.h index 4dee94c0..782c8694 100644 --- a/qt/gen_qfilesystemwatcher.h +++ b/qt/gen_qfilesystemwatcher.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfinalstate.cpp b/qt/gen_qfinalstate.cpp index 7d25b124..dc77c3cb 100644 --- a/qt/gen_qfinalstate.cpp +++ b/qt/gen_qfinalstate.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qfinalstate.h" +#include #include "gen_qfinalstate.h" #include "_cgo_export.h" diff --git a/qt/gen_qfinalstate.go b/qt/gen_qfinalstate.go index a45bf87b..d84ba934 100644 --- a/qt/gen_qfinalstate.go +++ b/qt/gen_qfinalstate.go @@ -25,14 +25,21 @@ func (this *QFinalState) cPointer() *C.QFinalState { return this.h } +func (this *QFinalState) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFinalState(h *C.QFinalState) *QFinalState { if h == nil { return nil } - return &QFinalState{h: h, QAbstractState: newQAbstractState_U(unsafe.Pointer(h))} + return &QFinalState{h: h, QAbstractState: UnsafeNewQAbstractState(unsafe.Pointer(h))} } -func newQFinalState_U(h unsafe.Pointer) *QFinalState { +func UnsafeNewQFinalState(h unsafe.Pointer) *QFinalState { return newQFinalState((*C.QFinalState)(h)) } @@ -49,7 +56,7 @@ func NewQFinalState2(parent *QState) *QFinalState { } func (this *QFinalState) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFinalState_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFinalState_MetaObject(this.h))) } func (this *QFinalState) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qfinalstate.h b/qt/gen_qfinalstate.h index 308428e9..0f68036a 100644 --- a/qt/gen_qfinalstate.h +++ b/qt/gen_qfinalstate.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfloat16.cpp b/qt/gen_qfloat16.cpp index c7277aa2..f27d6cc6 100644 --- a/qt/gen_qfloat16.cpp +++ b/qt/gen_qfloat16.cpp @@ -1,4 +1,4 @@ -#include "qfloat16.h" +#include #include "gen_qfloat16.h" #include "_cgo_export.h" diff --git a/qt/gen_qfloat16.go b/qt/gen_qfloat16.go index d8f84230..73315953 100644 --- a/qt/gen_qfloat16.go +++ b/qt/gen_qfloat16.go @@ -24,6 +24,13 @@ func (this *qfloat16) cPointer() *C.qfloat16 { return this.h } +func (this *qfloat16) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newqfloat16(h *C.qfloat16) *qfloat16 { if h == nil { return nil @@ -31,7 +38,7 @@ func newqfloat16(h *C.qfloat16) *qfloat16 { return &qfloat16{h: h} } -func newqfloat16_U(h unsafe.Pointer) *qfloat16 { +func UnsafeNewqfloat16(h unsafe.Pointer) *qfloat16 { return newqfloat16((*C.qfloat16)(h)) } diff --git a/qt/gen_qfloat16.h b/qt/gen_qfloat16.h index 8c58a93b..e432a8ee 100644 --- a/qt/gen_qfloat16.h +++ b/qt/gen_qfloat16.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfocusframe.cpp b/qt/gen_qfocusframe.cpp index 863f4ded..1f0af4fd 100644 --- a/qt/gen_qfocusframe.cpp +++ b/qt/gen_qfocusframe.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qfocusframe.h" +#include #include "gen_qfocusframe.h" #include "_cgo_export.h" diff --git a/qt/gen_qfocusframe.go b/qt/gen_qfocusframe.go index be8b0ffc..4760b8f2 100644 --- a/qt/gen_qfocusframe.go +++ b/qt/gen_qfocusframe.go @@ -25,14 +25,21 @@ func (this *QFocusFrame) cPointer() *C.QFocusFrame { return this.h } +func (this *QFocusFrame) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFocusFrame(h *C.QFocusFrame) *QFocusFrame { if h == nil { return nil } - return &QFocusFrame{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QFocusFrame{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQFocusFrame_U(h unsafe.Pointer) *QFocusFrame { +func UnsafeNewQFocusFrame(h unsafe.Pointer) *QFocusFrame { return newQFocusFrame((*C.QFocusFrame)(h)) } @@ -49,7 +56,7 @@ func NewQFocusFrame2(parent *QWidget) *QFocusFrame { } func (this *QFocusFrame) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFocusFrame_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFocusFrame_MetaObject(this.h))) } func (this *QFocusFrame) Metacast(param1 string) unsafe.Pointer { @@ -81,7 +88,7 @@ func (this *QFocusFrame) SetWidget(widget *QWidget) { } func (this *QFocusFrame) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QFocusFrame_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QFocusFrame_Widget(this.h))) } func QFocusFrame_Tr2(s string, c string) string { diff --git a/qt/gen_qfocusframe.h b/qt/gen_qfocusframe.h index d4b5ecad..426bb97f 100644 --- a/qt/gen_qfocusframe.h +++ b/qt/gen_qfocusframe.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfont.cpp b/qt/gen_qfont.cpp index 2d07b588..462f98b2 100644 --- a/qt/gen_qfont.cpp +++ b/qt/gen_qfont.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qfont.h" +#include #include "gen_qfont.h" #include "_cgo_export.h" @@ -77,7 +77,7 @@ struct miqt_array* QFont_Families(const QFont* self) { } void QFont_SetFamilies(QFont* self, struct miqt_array* /* of struct miqt_string* */ families) { - QList families_QList; + QStringList families_QList; families_QList.reserve(families->len); struct miqt_string** families_arr = static_cast(families->data); for(size_t i = 0; i < families->len; ++i) { @@ -376,7 +376,7 @@ void QFont_InsertSubstitution(struct miqt_string* param1, struct miqt_string* pa void QFont_InsertSubstitutions(struct miqt_string* param1, struct miqt_array* /* of struct miqt_string* */ param2) { QString param1_QString = QString::fromUtf8(¶m1->data, param1->len); - QList param2_QList; + QStringList param2_QList; param2_QList.reserve(param2->len); struct miqt_string** param2_arr = static_cast(param2->data); for(size_t i = 0; i < param2->len; ++i) { diff --git a/qt/gen_qfont.go b/qt/gen_qfont.go index f0b7c25e..973d9c7d 100644 --- a/qt/gen_qfont.go +++ b/qt/gen_qfont.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -149,6 +150,13 @@ func (this *QFont) cPointer() *C.QFont { return this.h } +func (this *QFont) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFont(h *C.QFont) *QFont { if h == nil { return nil @@ -156,7 +164,7 @@ func newQFont(h *C.QFont) *QFont { return &QFont{h: h} } -func newQFont_U(h unsafe.Pointer) *QFont { +func UnsafeNewQFont(h unsafe.Pointer) *QFont { return newQFont((*C.QFont)(h)) } @@ -168,7 +176,7 @@ func NewQFont() *QFont { // NewQFont2 constructs a new QFont object. func NewQFont2(family string) *QFont { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) ret := C.QFont_new2((*C.struct_miqt_string)(family_ms)) return newQFont(ret) @@ -194,7 +202,7 @@ func NewQFont5(font *QFont) *QFont { // NewQFont6 constructs a new QFont object. func NewQFont6(family string, pointSize int) *QFont { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) ret := C.QFont_new6((*C.struct_miqt_string)(family_ms), (C.int)(pointSize)) return newQFont(ret) @@ -202,7 +210,7 @@ func NewQFont6(family string, pointSize int) *QFont { // NewQFont7 constructs a new QFont object. func NewQFont7(family string, pointSize int, weight int) *QFont { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) ret := C.QFont_new7((*C.struct_miqt_string)(family_ms), (C.int)(pointSize), (C.int)(weight)) return newQFont(ret) @@ -210,7 +218,7 @@ func NewQFont7(family string, pointSize int, weight int) *QFont { // NewQFont8 constructs a new QFont object. func NewQFont8(family string, pointSize int, weight int, italic bool) *QFont { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) ret := C.QFont_new8((*C.struct_miqt_string)(family_ms), (C.int)(pointSize), (C.int)(weight), (C.bool)(italic)) return newQFont(ret) @@ -228,7 +236,7 @@ func (this *QFont) Family() string { } func (this *QFont) SetFamily(family string) { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) C.QFont_SetFamily(this.h, (*C.struct_miqt_string)(family_ms)) } @@ -252,7 +260,7 @@ func (this *QFont) SetFamilies(families []string) { families_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(families)))) defer C.free(unsafe.Pointer(families_CArray)) for i := range families { - families_i_ms := miqt_strdupg(families[i]) + families_i_ms := libmiqt.Strdupg(families[i]) defer C.free(families_i_ms) families_CArray[i] = (*C.struct_miqt_string)(families_i_ms) } @@ -269,7 +277,7 @@ func (this *QFont) StyleName() string { } func (this *QFont) SetStyleName(styleName string) { - styleName_ms := miqt_strdupg(styleName) + styleName_ms := libmiqt.Strdupg(styleName) defer C.free(styleName_ms) C.QFont_SetStyleName(this.h, (*C.struct_miqt_string)(styleName_ms)) } @@ -463,7 +471,7 @@ func (this *QFont) IsCopyOf(param1 *QFont) bool { } func (this *QFont) SetRawName(rawName string) { - rawName_ms := miqt_strdupg(rawName) + rawName_ms := libmiqt.Strdupg(rawName) defer C.free(rawName_ms) C.QFont_SetRawName(this.h, (*C.struct_miqt_string)(rawName_ms)) } @@ -490,13 +498,13 @@ func (this *QFont) ToString() string { } func (this *QFont) FromString(param1 string) bool { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (bool)(C.QFont_FromString(this.h, (*C.struct_miqt_string)(param1_ms))) } func QFont_Substitute(param1 string) string { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) var _ms *C.struct_miqt_string = C.QFont_Substitute((*C.struct_miqt_string)(param1_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -505,7 +513,7 @@ func QFont_Substitute(param1 string) string { } func QFont_Substitutes(param1 string) []string { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) var _ma *C.struct_miqt_array = C.QFont_Substitutes((*C.struct_miqt_string)(param1_ms)) _ret := make([]string, int(_ma.len)) @@ -535,21 +543,21 @@ func QFont_Substitutions() []string { } func QFont_InsertSubstitution(param1 string, param2 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) - param2_ms := miqt_strdupg(param2) + param2_ms := libmiqt.Strdupg(param2) defer C.free(param2_ms) C.QFont_InsertSubstitution((*C.struct_miqt_string)(param1_ms), (*C.struct_miqt_string)(param2_ms)) } func QFont_InsertSubstitutions(param1 string, param2 []string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) // For the C ABI, malloc a C array of raw pointers param2_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(param2)))) defer C.free(unsafe.Pointer(param2_CArray)) for i := range param2 { - param2_i_ms := miqt_strdupg(param2[i]) + param2_i_ms := libmiqt.Strdupg(param2[i]) defer C.free(param2_i_ms) param2_CArray[i] = (*C.struct_miqt_string)(param2_i_ms) } @@ -559,7 +567,7 @@ func QFont_InsertSubstitutions(param1 string, param2 []string) { } func QFont_RemoveSubstitutions(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QFont_RemoveSubstitutions((*C.struct_miqt_string)(param1_ms)) } diff --git a/qt/gen_qfont.h b/qt/gen_qfont.h index 4b458055..8dffc9be 100644 --- a/qt/gen_qfont.h +++ b/qt/gen_qfont.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfontcombobox.cpp b/qt/gen_qfontcombobox.cpp index 29f70d27..bc8c9a33 100644 --- a/qt/gen_qfontcombobox.cpp +++ b/qt/gen_qfontcombobox.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qfontcombobox.h" +#include #include "gen_qfontcombobox.h" #include "_cgo_export.h" diff --git a/qt/gen_qfontcombobox.go b/qt/gen_qfontcombobox.go index 3234325a..2f6790bc 100644 --- a/qt/gen_qfontcombobox.go +++ b/qt/gen_qfontcombobox.go @@ -36,14 +36,21 @@ func (this *QFontComboBox) cPointer() *C.QFontComboBox { return this.h } +func (this *QFontComboBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFontComboBox(h *C.QFontComboBox) *QFontComboBox { if h == nil { return nil } - return &QFontComboBox{h: h, QComboBox: newQComboBox_U(unsafe.Pointer(h))} + return &QFontComboBox{h: h, QComboBox: UnsafeNewQComboBox(unsafe.Pointer(h))} } -func newQFontComboBox_U(h unsafe.Pointer) *QFontComboBox { +func UnsafeNewQFontComboBox(h unsafe.Pointer) *QFontComboBox { return newQFontComboBox((*C.QFontComboBox)(h)) } @@ -60,7 +67,7 @@ func NewQFontComboBox2(parent *QWidget) *QFontComboBox { } func (this *QFontComboBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFontComboBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFontComboBox_MetaObject(this.h))) } func (this *QFontComboBox) Metacast(param1 string) unsafe.Pointer { @@ -136,7 +143,7 @@ func miqt_exec_callback_QFontComboBox_CurrentFontChanged(cb C.intptr_t, f *C.QFo } // Convert all CABI parameters to Go parameters - slotval1 := newQFont_U(unsafe.Pointer(f)) + slotval1 := UnsafeNewQFont(unsafe.Pointer(f)) gofunc(slotval1) } diff --git a/qt/gen_qfontcombobox.h b/qt/gen_qfontcombobox.h index b8f2b081..1d3691e6 100644 --- a/qt/gen_qfontcombobox.h +++ b/qt/gen_qfontcombobox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfontdatabase.cpp b/qt/gen_qfontdatabase.cpp index 84a863b6..21ae583e 100644 --- a/qt/gen_qfontdatabase.cpp +++ b/qt/gen_qfontdatabase.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qfontdatabase.h" +#include #include "gen_qfontdatabase.h" #include "_cgo_export.h" diff --git a/qt/gen_qfontdatabase.go b/qt/gen_qfontdatabase.go index 921d2a12..d786600b 100644 --- a/qt/gen_qfontdatabase.go +++ b/qt/gen_qfontdatabase.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -74,6 +75,13 @@ func (this *QFontDatabase) cPointer() *C.QFontDatabase { return this.h } +func (this *QFontDatabase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFontDatabase(h *C.QFontDatabase) *QFontDatabase { if h == nil { return nil @@ -81,7 +89,7 @@ func newQFontDatabase(h *C.QFontDatabase) *QFontDatabase { return &QFontDatabase{h: h} } -func newQFontDatabase_U(h unsafe.Pointer) *QFontDatabase { +func UnsafeNewQFontDatabase(h unsafe.Pointer) *QFontDatabase { return newQFontDatabase((*C.QFontDatabase)(h)) } @@ -114,7 +122,7 @@ func (this *QFontDatabase) WritingSystems() []QFontDatabase__WritingSystem { } func (this *QFontDatabase) WritingSystemsWithFamily(family string) []QFontDatabase__WritingSystem { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) var _ma *C.struct_miqt_array = C.QFontDatabase_WritingSystemsWithFamily(this.h, (*C.struct_miqt_string)(family_ms)) _ret := make([]QFontDatabase__WritingSystem, int(_ma.len)) @@ -141,7 +149,7 @@ func (this *QFontDatabase) Families() []string { } func (this *QFontDatabase) Styles(family string) []string { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) var _ma *C.struct_miqt_array = C.QFontDatabase_Styles(this.h, (*C.struct_miqt_string)(family_ms)) _ret := make([]string, int(_ma.len)) @@ -157,7 +165,7 @@ func (this *QFontDatabase) Styles(family string) []string { } func (this *QFontDatabase) PointSizes(family string) []int { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) var _ma *C.struct_miqt_array = C.QFontDatabase_PointSizes(this.h, (*C.struct_miqt_string)(family_ms)) _ret := make([]int, int(_ma.len)) @@ -170,9 +178,9 @@ func (this *QFontDatabase) PointSizes(family string) []int { } func (this *QFontDatabase) SmoothSizes(family string, style string) []int { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) var _ma *C.struct_miqt_array = C.QFontDatabase_SmoothSizes(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms)) _ret := make([]int, int(_ma.len)) @@ -199,9 +207,9 @@ func (this *QFontDatabase) StyleStringWithFontInfo(fontInfo *QFontInfo) string { } func (this *QFontDatabase) Font(family string, style string, pointSize int) *QFont { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) _ret := C.QFontDatabase_Font(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms), (C.int)(pointSize)) _goptr := newQFont(_ret) @@ -210,61 +218,61 @@ func (this *QFontDatabase) Font(family string, style string, pointSize int) *QFo } func (this *QFontDatabase) IsBitmapScalable(family string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) return (bool)(C.QFontDatabase_IsBitmapScalable(this.h, (*C.struct_miqt_string)(family_ms))) } func (this *QFontDatabase) IsSmoothlyScalable(family string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) return (bool)(C.QFontDatabase_IsSmoothlyScalable(this.h, (*C.struct_miqt_string)(family_ms))) } func (this *QFontDatabase) IsScalable(family string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) return (bool)(C.QFontDatabase_IsScalable(this.h, (*C.struct_miqt_string)(family_ms))) } func (this *QFontDatabase) IsFixedPitch(family string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) return (bool)(C.QFontDatabase_IsFixedPitch(this.h, (*C.struct_miqt_string)(family_ms))) } func (this *QFontDatabase) Italic(family string, style string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) return (bool)(C.QFontDatabase_Italic(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms))) } func (this *QFontDatabase) Bold(family string, style string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) return (bool)(C.QFontDatabase_Bold(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms))) } func (this *QFontDatabase) Weight(family string, style string) int { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) return (int)(C.QFontDatabase_Weight(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms))) } func (this *QFontDatabase) HasFamily(family string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) return (bool)(C.QFontDatabase_HasFamily(this.h, (*C.struct_miqt_string)(family_ms))) } func (this *QFontDatabase) IsPrivateFamily(family string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) return (bool)(C.QFontDatabase_IsPrivateFamily(this.h, (*C.struct_miqt_string)(family_ms))) } @@ -284,7 +292,7 @@ func QFontDatabase_WritingSystemSample(writingSystem QFontDatabase__WritingSyste } func QFontDatabase_AddApplicationFont(fileName string) int { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (int)(C.QFontDatabase_AddApplicationFont((*C.struct_miqt_string)(fileName_ms))) } @@ -341,9 +349,9 @@ func (this *QFontDatabase) Families1(writingSystem QFontDatabase__WritingSystem) } func (this *QFontDatabase) PointSizes2(family string, style string) []int { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) var _ma *C.struct_miqt_array = C.QFontDatabase_PointSizes2(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms)) _ret := make([]int, int(_ma.len)) @@ -356,33 +364,33 @@ func (this *QFontDatabase) PointSizes2(family string, style string) []int { } func (this *QFontDatabase) IsBitmapScalable2(family string, style string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) return (bool)(C.QFontDatabase_IsBitmapScalable2(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms))) } func (this *QFontDatabase) IsSmoothlyScalable2(family string, style string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) return (bool)(C.QFontDatabase_IsSmoothlyScalable2(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms))) } func (this *QFontDatabase) IsScalable2(family string, style string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) return (bool)(C.QFontDatabase_IsScalable2(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms))) } func (this *QFontDatabase) IsFixedPitch2(family string, style string) bool { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) - style_ms := miqt_strdupg(style) + style_ms := libmiqt.Strdupg(style) defer C.free(style_ms) return (bool)(C.QFontDatabase_IsFixedPitch2(this.h, (*C.struct_miqt_string)(family_ms), (*C.struct_miqt_string)(style_ms))) } diff --git a/qt/gen_qfontdatabase.h b/qt/gen_qfontdatabase.h index b2dbdec7..8a355496 100644 --- a/qt/gen_qfontdatabase.h +++ b/qt/gen_qfontdatabase.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfontdialog.cpp b/qt/gen_qfontdialog.cpp index 9e18667a..25c82155 100644 --- a/qt/gen_qfontdialog.cpp +++ b/qt/gen_qfontdialog.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qfontdialog.h" +#include #include "gen_qfontdialog.h" #include "_cgo_export.h" diff --git a/qt/gen_qfontdialog.go b/qt/gen_qfontdialog.go index 0ec107b9..8402cc8c 100644 --- a/qt/gen_qfontdialog.go +++ b/qt/gen_qfontdialog.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -37,14 +38,21 @@ func (this *QFontDialog) cPointer() *C.QFontDialog { return this.h } +func (this *QFontDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFontDialog(h *C.QFontDialog) *QFontDialog { if h == nil { return nil } - return &QFontDialog{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QFontDialog{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQFontDialog_U(h unsafe.Pointer) *QFontDialog { +func UnsafeNewQFontDialog(h unsafe.Pointer) *QFontDialog { return newQFontDialog((*C.QFontDialog)(h)) } @@ -73,7 +81,7 @@ func NewQFontDialog4(initial *QFont, parent *QWidget) *QFontDialog { } func (this *QFontDialog) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFontDialog_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFontDialog_MetaObject(this.h))) } func (this *QFontDialog) Metacast(param1 string) unsafe.Pointer { @@ -167,7 +175,7 @@ func miqt_exec_callback_QFontDialog_CurrentFontChanged(cb C.intptr_t, font *C.QF } // Convert all CABI parameters to Go parameters - slotval1 := newQFont_U(unsafe.Pointer(font)) + slotval1 := UnsafeNewQFont(unsafe.Pointer(font)) gofunc(slotval1) } @@ -187,7 +195,7 @@ func miqt_exec_callback_QFontDialog_FontSelected(cb C.intptr_t, font *C.QFont) { } // Convert all CABI parameters to Go parameters - slotval1 := newQFont_U(unsafe.Pointer(font)) + slotval1 := UnsafeNewQFont(unsafe.Pointer(font)) gofunc(slotval1) } @@ -255,7 +263,7 @@ func QFontDialog_GetFont3(ok *bool, initial *QFont, parent *QWidget) *QFont { } func QFontDialog_GetFont4(ok *bool, initial *QFont, parent *QWidget, title string) *QFont { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) _ret := C.QFontDialog_GetFont4((*C.bool)(unsafe.Pointer(ok)), initial.cPointer(), parent.cPointer(), (*C.struct_miqt_string)(title_ms)) _goptr := newQFont(_ret) @@ -264,7 +272,7 @@ func QFontDialog_GetFont4(ok *bool, initial *QFont, parent *QWidget, title strin } func QFontDialog_GetFont5(ok *bool, initial *QFont, parent *QWidget, title string, options QFontDialog__FontDialogOption) *QFont { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) _ret := C.QFontDialog_GetFont5((*C.bool)(unsafe.Pointer(ok)), initial.cPointer(), parent.cPointer(), (*C.struct_miqt_string)(title_ms), (C.int)(options)) _goptr := newQFont(_ret) diff --git a/qt/gen_qfontdialog.h b/qt/gen_qfontdialog.h index 306fb0d7..7727c66e 100644 --- a/qt/gen_qfontdialog.h +++ b/qt/gen_qfontdialog.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfontinfo.cpp b/qt/gen_qfontinfo.cpp index ff89622a..be9c1f8e 100644 --- a/qt/gen_qfontinfo.cpp +++ b/qt/gen_qfontinfo.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qfontinfo.h" +#include #include "gen_qfontinfo.h" #include "_cgo_export.h" diff --git a/qt/gen_qfontinfo.go b/qt/gen_qfontinfo.go index 6fb4cf04..cad433d9 100644 --- a/qt/gen_qfontinfo.go +++ b/qt/gen_qfontinfo.go @@ -24,6 +24,13 @@ func (this *QFontInfo) cPointer() *C.QFontInfo { return this.h } +func (this *QFontInfo) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFontInfo(h *C.QFontInfo) *QFontInfo { if h == nil { return nil @@ -31,7 +38,7 @@ func newQFontInfo(h *C.QFontInfo) *QFontInfo { return &QFontInfo{h: h} } -func newQFontInfo_U(h unsafe.Pointer) *QFontInfo { +func UnsafeNewQFontInfo(h unsafe.Pointer) *QFontInfo { return newQFontInfo((*C.QFontInfo)(h)) } diff --git a/qt/gen_qfontinfo.h b/qt/gen_qfontinfo.h index 8b287e7e..9a03c156 100644 --- a/qt/gen_qfontinfo.h +++ b/qt/gen_qfontinfo.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfontmetrics.cpp b/qt/gen_qfontmetrics.cpp index 64aaf417..936076a1 100644 --- a/qt/gen_qfontmetrics.cpp +++ b/qt/gen_qfontmetrics.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qfontmetrics.h" +#include #include "gen_qfontmetrics.h" #include "_cgo_export.h" diff --git a/qt/gen_qfontmetrics.go b/qt/gen_qfontmetrics.go index 6bfbed08..b2e303b5 100644 --- a/qt/gen_qfontmetrics.go +++ b/qt/gen_qfontmetrics.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QFontMetrics) cPointer() *C.QFontMetrics { return this.h } +func (this *QFontMetrics) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFontMetrics(h *C.QFontMetrics) *QFontMetrics { if h == nil { return nil @@ -31,7 +39,7 @@ func newQFontMetrics(h *C.QFontMetrics) *QFontMetrics { return &QFontMetrics{h: h} } -func newQFontMetrics_U(h unsafe.Pointer) *QFontMetrics { +func UnsafeNewQFontMetrics(h unsafe.Pointer) *QFontMetrics { return newQFontMetrics((*C.QFontMetrics)(h)) } @@ -122,13 +130,13 @@ func (this *QFontMetrics) RightBearing(param1 QChar) int { } func (this *QFontMetrics) Width(param1 string) int { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (int)(C.QFontMetrics_Width(this.h, (*C.struct_miqt_string)(param1_ms))) } func (this *QFontMetrics) Width2(param1 string, lenVal int, flags int) int { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (int)(C.QFontMetrics_Width2(this.h, (*C.struct_miqt_string)(param1_ms), (C.int)(lenVal), (C.int)(flags))) } @@ -138,7 +146,7 @@ func (this *QFontMetrics) WidthWithQChar(param1 QChar) int { } func (this *QFontMetrics) HorizontalAdvance(param1 string) int { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (int)(C.QFontMetrics_HorizontalAdvance(this.h, (*C.struct_miqt_string)(param1_ms))) } @@ -148,7 +156,7 @@ func (this *QFontMetrics) HorizontalAdvanceWithQChar(param1 QChar) int { } func (this *QFontMetrics) CharWidth(str string, pos int) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QFontMetrics_CharWidth(this.h, (*C.struct_miqt_string)(str_ms), (C.int)(pos))) } @@ -161,7 +169,7 @@ func (this *QFontMetrics) BoundingRect(param1 QChar) *QRect { } func (this *QFontMetrics) BoundingRectWithText(text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_BoundingRectWithText(this.h, (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -170,7 +178,7 @@ func (this *QFontMetrics) BoundingRectWithText(text string) *QRect { } func (this *QFontMetrics) BoundingRect2(r *QRect, flags int, text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_BoundingRect2(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -179,7 +187,7 @@ func (this *QFontMetrics) BoundingRect2(r *QRect, flags int, text string) *QRect } func (this *QFontMetrics) BoundingRect3(x int, y int, w int, h int, flags int, text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_BoundingRect3(this.h, (C.int)(x), (C.int)(y), (C.int)(w), (C.int)(h), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -188,7 +196,7 @@ func (this *QFontMetrics) BoundingRect3(x int, y int, w int, h int, flags int, t } func (this *QFontMetrics) Size(flags int, str string) *QSize { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QFontMetrics_Size(this.h, (C.int)(flags), (*C.struct_miqt_string)(str_ms)) _goptr := newQSize(_ret) @@ -197,7 +205,7 @@ func (this *QFontMetrics) Size(flags int, str string) *QSize { } func (this *QFontMetrics) TightBoundingRect(text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_TightBoundingRect(this.h, (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -206,7 +214,7 @@ func (this *QFontMetrics) TightBoundingRect(text string) *QRect { } func (this *QFontMetrics) ElidedText(text string, mode TextElideMode, width int) string { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QFontMetrics_ElidedText(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(mode), (C.int)(width)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -243,19 +251,19 @@ func (this *QFontMetrics) OperatorNotEqual(other *QFontMetrics) bool { } func (this *QFontMetrics) Width22(param1 string, lenVal int) int { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (int)(C.QFontMetrics_Width22(this.h, (*C.struct_miqt_string)(param1_ms), (C.int)(lenVal))) } func (this *QFontMetrics) HorizontalAdvance2(param1 string, lenVal int) int { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (int)(C.QFontMetrics_HorizontalAdvance2(this.h, (*C.struct_miqt_string)(param1_ms), (C.int)(lenVal))) } func (this *QFontMetrics) BoundingRect4(r *QRect, flags int, text string, tabstops int) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_BoundingRect4(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms), (C.int)(tabstops)) _goptr := newQRect(_ret) @@ -264,7 +272,7 @@ func (this *QFontMetrics) BoundingRect4(r *QRect, flags int, text string, tabsto } func (this *QFontMetrics) BoundingRect5(r *QRect, flags int, text string, tabstops int, tabarray *int) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_BoundingRect5(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms), (C.int)(tabstops), (*C.int)(unsafe.Pointer(tabarray))) _goptr := newQRect(_ret) @@ -273,7 +281,7 @@ func (this *QFontMetrics) BoundingRect5(r *QRect, flags int, text string, tabsto } func (this *QFontMetrics) BoundingRect7(x int, y int, w int, h int, flags int, text string, tabstops int) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_BoundingRect7(this.h, (C.int)(x), (C.int)(y), (C.int)(w), (C.int)(h), (C.int)(flags), (*C.struct_miqt_string)(text_ms), (C.int)(tabstops)) _goptr := newQRect(_ret) @@ -282,7 +290,7 @@ func (this *QFontMetrics) BoundingRect7(x int, y int, w int, h int, flags int, t } func (this *QFontMetrics) BoundingRect8(x int, y int, w int, h int, flags int, text string, tabstops int, tabarray *int) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetrics_BoundingRect8(this.h, (C.int)(x), (C.int)(y), (C.int)(w), (C.int)(h), (C.int)(flags), (*C.struct_miqt_string)(text_ms), (C.int)(tabstops), (*C.int)(unsafe.Pointer(tabarray))) _goptr := newQRect(_ret) @@ -291,7 +299,7 @@ func (this *QFontMetrics) BoundingRect8(x int, y int, w int, h int, flags int, t } func (this *QFontMetrics) Size3(flags int, str string, tabstops int) *QSize { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QFontMetrics_Size3(this.h, (C.int)(flags), (*C.struct_miqt_string)(str_ms), (C.int)(tabstops)) _goptr := newQSize(_ret) @@ -300,7 +308,7 @@ func (this *QFontMetrics) Size3(flags int, str string, tabstops int) *QSize { } func (this *QFontMetrics) Size4(flags int, str string, tabstops int, tabarray *int) *QSize { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QFontMetrics_Size4(this.h, (C.int)(flags), (*C.struct_miqt_string)(str_ms), (C.int)(tabstops), (*C.int)(unsafe.Pointer(tabarray))) _goptr := newQSize(_ret) @@ -309,7 +317,7 @@ func (this *QFontMetrics) Size4(flags int, str string, tabstops int, tabarray *i } func (this *QFontMetrics) ElidedText4(text string, mode TextElideMode, width int, flags int) string { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QFontMetrics_ElidedText4(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(mode), (C.int)(width), (C.int)(flags)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -342,6 +350,13 @@ func (this *QFontMetricsF) cPointer() *C.QFontMetricsF { return this.h } +func (this *QFontMetricsF) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFontMetricsF(h *C.QFontMetricsF) *QFontMetricsF { if h == nil { return nil @@ -349,7 +364,7 @@ func newQFontMetricsF(h *C.QFontMetricsF) *QFontMetricsF { return &QFontMetricsF{h: h} } -func newQFontMetricsF_U(h unsafe.Pointer) *QFontMetricsF { +func UnsafeNewQFontMetricsF(h unsafe.Pointer) *QFontMetricsF { return newQFontMetricsF((*C.QFontMetricsF)(h)) } @@ -450,7 +465,7 @@ func (this *QFontMetricsF) RightBearing(param1 QChar) float64 { } func (this *QFontMetricsF) Width(stringVal string) float64 { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) return (float64)(C.QFontMetricsF_Width(this.h, (*C.struct_miqt_string)(stringVal_ms))) } @@ -460,7 +475,7 @@ func (this *QFontMetricsF) WidthWithQChar(param1 QChar) float64 { } func (this *QFontMetricsF) HorizontalAdvance(stringVal string) float64 { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) return (float64)(C.QFontMetricsF_HorizontalAdvance(this.h, (*C.struct_miqt_string)(stringVal_ms))) } @@ -470,7 +485,7 @@ func (this *QFontMetricsF) HorizontalAdvanceWithQChar(param1 QChar) float64 { } func (this *QFontMetricsF) BoundingRect(stringVal string) *QRectF { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QFontMetricsF_BoundingRect(this.h, (*C.struct_miqt_string)(stringVal_ms)) _goptr := newQRectF(_ret) @@ -486,7 +501,7 @@ func (this *QFontMetricsF) BoundingRectWithQChar(param1 QChar) *QRectF { } func (this *QFontMetricsF) BoundingRect2(r *QRectF, flags int, stringVal string) *QRectF { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QFontMetricsF_BoundingRect2(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(stringVal_ms)) _goptr := newQRectF(_ret) @@ -495,7 +510,7 @@ func (this *QFontMetricsF) BoundingRect2(r *QRectF, flags int, stringVal string) } func (this *QFontMetricsF) Size(flags int, str string) *QSizeF { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QFontMetricsF_Size(this.h, (C.int)(flags), (*C.struct_miqt_string)(str_ms)) _goptr := newQSizeF(_ret) @@ -504,7 +519,7 @@ func (this *QFontMetricsF) Size(flags int, str string) *QSizeF { } func (this *QFontMetricsF) TightBoundingRect(text string) *QRectF { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QFontMetricsF_TightBoundingRect(this.h, (*C.struct_miqt_string)(text_ms)) _goptr := newQRectF(_ret) @@ -513,7 +528,7 @@ func (this *QFontMetricsF) TightBoundingRect(text string) *QRectF { } func (this *QFontMetricsF) ElidedText(text string, mode TextElideMode, width float64) string { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QFontMetricsF_ElidedText(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(mode), (C.double)(width)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -550,13 +565,13 @@ func (this *QFontMetricsF) OperatorNotEqual(other *QFontMetricsF) bool { } func (this *QFontMetricsF) HorizontalAdvance2(stringVal string, length int) float64 { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) return (float64)(C.QFontMetricsF_HorizontalAdvance2(this.h, (*C.struct_miqt_string)(stringVal_ms), (C.int)(length))) } func (this *QFontMetricsF) BoundingRect4(r *QRectF, flags int, stringVal string, tabstops int) *QRectF { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QFontMetricsF_BoundingRect4(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(stringVal_ms), (C.int)(tabstops)) _goptr := newQRectF(_ret) @@ -565,7 +580,7 @@ func (this *QFontMetricsF) BoundingRect4(r *QRectF, flags int, stringVal string, } func (this *QFontMetricsF) BoundingRect5(r *QRectF, flags int, stringVal string, tabstops int, tabarray *int) *QRectF { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QFontMetricsF_BoundingRect5(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(stringVal_ms), (C.int)(tabstops), (*C.int)(unsafe.Pointer(tabarray))) _goptr := newQRectF(_ret) @@ -574,7 +589,7 @@ func (this *QFontMetricsF) BoundingRect5(r *QRectF, flags int, stringVal string, } func (this *QFontMetricsF) Size3(flags int, str string, tabstops int) *QSizeF { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QFontMetricsF_Size3(this.h, (C.int)(flags), (*C.struct_miqt_string)(str_ms), (C.int)(tabstops)) _goptr := newQSizeF(_ret) @@ -583,7 +598,7 @@ func (this *QFontMetricsF) Size3(flags int, str string, tabstops int) *QSizeF { } func (this *QFontMetricsF) Size4(flags int, str string, tabstops int, tabarray *int) *QSizeF { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QFontMetricsF_Size4(this.h, (C.int)(flags), (*C.struct_miqt_string)(str_ms), (C.int)(tabstops), (*C.int)(unsafe.Pointer(tabarray))) _goptr := newQSizeF(_ret) @@ -592,7 +607,7 @@ func (this *QFontMetricsF) Size4(flags int, str string, tabstops int, tabarray * } func (this *QFontMetricsF) ElidedText4(text string, mode TextElideMode, width float64, flags int) string { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QFontMetricsF_ElidedText4(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(mode), (C.double)(width), (C.int)(flags)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qfontmetrics.h b/qt/gen_qfontmetrics.h index 7b199736..c2efb151 100644 --- a/qt/gen_qfontmetrics.h +++ b/qt/gen_qfontmetrics.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qformlayout.cpp b/qt/gen_qformlayout.cpp index 762b620e..4d78bed8 100644 --- a/qt/gen_qformlayout.cpp +++ b/qt/gen_qformlayout.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qformlayout.h" +#include #include "gen_qformlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qformlayout.go b/qt/gen_qformlayout.go index 989bf29f..376dbbb5 100644 --- a/qt/gen_qformlayout.go +++ b/qt/gen_qformlayout.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -49,14 +50,21 @@ func (this *QFormLayout) cPointer() *C.QFormLayout { return this.h } +func (this *QFormLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFormLayout(h *C.QFormLayout) *QFormLayout { if h == nil { return nil } - return &QFormLayout{h: h, QLayout: newQLayout_U(unsafe.Pointer(h))} + return &QFormLayout{h: h, QLayout: UnsafeNewQLayout(unsafe.Pointer(h))} } -func newQFormLayout_U(h unsafe.Pointer) *QFormLayout { +func UnsafeNewQFormLayout(h unsafe.Pointer) *QFormLayout { return newQFormLayout((*C.QFormLayout)(h)) } @@ -73,7 +81,7 @@ func NewQFormLayout2(parent *QWidget) *QFormLayout { } func (this *QFormLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFormLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFormLayout_MetaObject(this.h))) } func (this *QFormLayout) Metacast(param1 string) unsafe.Pointer { @@ -165,13 +173,13 @@ func (this *QFormLayout) AddRow2(label *QWidget, field *QLayout) { } func (this *QFormLayout) AddRow3(labelText string, field *QWidget) { - labelText_ms := miqt_strdupg(labelText) + labelText_ms := libmiqt.Strdupg(labelText) defer C.free(labelText_ms) C.QFormLayout_AddRow3(this.h, (*C.struct_miqt_string)(labelText_ms), field.cPointer()) } func (this *QFormLayout) AddRow4(labelText string, field *QLayout) { - labelText_ms := miqt_strdupg(labelText) + labelText_ms := libmiqt.Strdupg(labelText) defer C.free(labelText_ms) C.QFormLayout_AddRow4(this.h, (*C.struct_miqt_string)(labelText_ms), field.cPointer()) } @@ -193,13 +201,13 @@ func (this *QFormLayout) InsertRow2(row int, label *QWidget, field *QLayout) { } func (this *QFormLayout) InsertRow3(row int, labelText string, field *QWidget) { - labelText_ms := miqt_strdupg(labelText) + labelText_ms := libmiqt.Strdupg(labelText) defer C.free(labelText_ms) C.QFormLayout_InsertRow3(this.h, (C.int)(row), (*C.struct_miqt_string)(labelText_ms), field.cPointer()) } func (this *QFormLayout) InsertRow4(row int, labelText string, field *QLayout) { - labelText_ms := miqt_strdupg(labelText) + labelText_ms := libmiqt.Strdupg(labelText) defer C.free(labelText_ms) C.QFormLayout_InsertRow4(this.h, (C.int)(row), (*C.struct_miqt_string)(labelText_ms), field.cPointer()) } @@ -258,15 +266,15 @@ func (this *QFormLayout) SetLayout(row int, role QFormLayout__ItemRole, layout * } func (this *QFormLayout) ItemAt(row int, role QFormLayout__ItemRole) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QFormLayout_ItemAt(this.h, (C.int)(row), (C.int)(role)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QFormLayout_ItemAt(this.h, (C.int)(row), (C.int)(role)))) } func (this *QFormLayout) LabelForField(field *QWidget) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QFormLayout_LabelForField(this.h, field.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QFormLayout_LabelForField(this.h, field.cPointer()))) } func (this *QFormLayout) LabelForFieldWithField(field *QLayout) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QFormLayout_LabelForFieldWithField(this.h, field.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QFormLayout_LabelForFieldWithField(this.h, field.cPointer()))) } func (this *QFormLayout) AddItem(item *QLayoutItem) { @@ -274,11 +282,11 @@ func (this *QFormLayout) AddItem(item *QLayoutItem) { } func (this *QFormLayout) ItemAtWithIndex(index int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QFormLayout_ItemAtWithIndex(this.h, (C.int)(index)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QFormLayout_ItemAtWithIndex(this.h, (C.int)(index)))) } func (this *QFormLayout) TakeAt(index int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QFormLayout_TakeAt(this.h, (C.int)(index)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QFormLayout_TakeAt(this.h, (C.int)(index)))) } func (this *QFormLayout) SetGeometry(rect *QRect) { @@ -392,6 +400,13 @@ func (this *QFormLayout__TakeRowResult) cPointer() *C.QFormLayout__TakeRowResult return this.h } +func (this *QFormLayout__TakeRowResult) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFormLayout__TakeRowResult(h *C.QFormLayout__TakeRowResult) *QFormLayout__TakeRowResult { if h == nil { return nil @@ -399,7 +414,7 @@ func newQFormLayout__TakeRowResult(h *C.QFormLayout__TakeRowResult) *QFormLayout return &QFormLayout__TakeRowResult{h: h} } -func newQFormLayout__TakeRowResult_U(h unsafe.Pointer) *QFormLayout__TakeRowResult { +func UnsafeNewQFormLayout__TakeRowResult(h unsafe.Pointer) *QFormLayout__TakeRowResult { return newQFormLayout__TakeRowResult((*C.QFormLayout__TakeRowResult)(h)) } diff --git a/qt/gen_qformlayout.h b/qt/gen_qformlayout.h index c9285f53..0f6c9257 100644 --- a/qt/gen_qformlayout.h +++ b/qt/gen_qformlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qframe.cpp b/qt/gen_qframe.cpp index 1f4ab045..79f6b6c0 100644 --- a/qt/gen_qframe.cpp +++ b/qt/gen_qframe.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qframe.h" +#include #include "gen_qframe.h" #include "_cgo_export.h" diff --git a/qt/gen_qframe.go b/qt/gen_qframe.go index 6b4e7445..c4d3c73c 100644 --- a/qt/gen_qframe.go +++ b/qt/gen_qframe.go @@ -52,14 +52,21 @@ func (this *QFrame) cPointer() *C.QFrame { return this.h } +func (this *QFrame) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFrame(h *C.QFrame) *QFrame { if h == nil { return nil } - return &QFrame{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QFrame{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQFrame_U(h unsafe.Pointer) *QFrame { +func UnsafeNewQFrame(h unsafe.Pointer) *QFrame { return newQFrame((*C.QFrame)(h)) } @@ -82,7 +89,7 @@ func NewQFrame3(parent *QWidget, f WindowType) *QFrame { } func (this *QFrame) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFrame_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFrame_MetaObject(this.h))) } func (this *QFrame) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qframe.h b/qt/gen_qframe.h index 17d099ac..c08867fb 100644 --- a/qt/gen_qframe.h +++ b/qt/gen_qframe.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfutureinterface.cpp b/qt/gen_qfutureinterface.cpp index f3883b8c..d68d0245 100644 --- a/qt/gen_qfutureinterface.cpp +++ b/qt/gen_qfutureinterface.cpp @@ -7,7 +7,7 @@ #include #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__ExceptionStore #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__ResultStoreBase -#include "qfutureinterface.h" +#include #include "gen_qfutureinterface.h" #include "_cgo_export.h" diff --git a/qt/gen_qfutureinterface.go b/qt/gen_qfutureinterface.go index b91f57bc..f806876c 100644 --- a/qt/gen_qfutureinterface.go +++ b/qt/gen_qfutureinterface.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -36,6 +37,13 @@ func (this *QFutureInterfaceBase) cPointer() *C.QFutureInterfaceBase { return this.h } +func (this *QFutureInterfaceBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFutureInterfaceBase(h *C.QFutureInterfaceBase) *QFutureInterfaceBase { if h == nil { return nil @@ -43,7 +51,7 @@ func newQFutureInterfaceBase(h *C.QFutureInterfaceBase) *QFutureInterfaceBase { return &QFutureInterfaceBase{h: h} } -func newQFutureInterfaceBase_U(h unsafe.Pointer) *QFutureInterfaceBase { +func UnsafeNewQFutureInterfaceBase(h unsafe.Pointer) *QFutureInterfaceBase { return newQFutureInterfaceBase((*C.QFutureInterfaceBase)(h)) } @@ -118,7 +126,7 @@ func (this *QFutureInterfaceBase) ProgressValue() int { } func (this *QFutureInterfaceBase) SetProgressValueAndText(progressValue int, progressText string) { - progressText_ms := miqt_strdupg(progressText) + progressText_ms := libmiqt.Strdupg(progressText) defer C.free(progressText_ms) C.QFutureInterfaceBase_SetProgressValueAndText(this.h, (C.int)(progressValue), (*C.struct_miqt_string)(progressText_ms)) } @@ -207,23 +215,23 @@ func (this *QFutureInterfaceBase) WaitForResume() { } func (this *QFutureInterfaceBase) Mutex() *QMutex { - return newQMutex_U(unsafe.Pointer(C.QFutureInterfaceBase_Mutex(this.h))) + return UnsafeNewQMutex(unsafe.Pointer(C.QFutureInterfaceBase_Mutex(this.h))) } func (this *QFutureInterfaceBase) MutexWithInt(param1 int) *QMutex { - return newQMutex_U(unsafe.Pointer(C.QFutureInterfaceBase_MutexWithInt(this.h, (C.int)(param1)))) + return UnsafeNewQMutex(unsafe.Pointer(C.QFutureInterfaceBase_MutexWithInt(this.h, (C.int)(param1)))) } func (this *QFutureInterfaceBase) ExceptionStore() *QtPrivate__ExceptionStore { - return newQtPrivate__ExceptionStore_U(unsafe.Pointer(C.QFutureInterfaceBase_ExceptionStore(this.h))) + return UnsafeNewQtPrivate__ExceptionStore(unsafe.Pointer(C.QFutureInterfaceBase_ExceptionStore(this.h))) } func (this *QFutureInterfaceBase) ResultStoreBase() *QtPrivate__ResultStoreBase { - return newQtPrivate__ResultStoreBase_U(unsafe.Pointer(C.QFutureInterfaceBase_ResultStoreBase(this.h))) + return UnsafeNewQtPrivate__ResultStoreBase(unsafe.Pointer(C.QFutureInterfaceBase_ResultStoreBase(this.h))) } func (this *QFutureInterfaceBase) ResultStoreBase2() *QtPrivate__ResultStoreBase { - return newQtPrivate__ResultStoreBase_U(unsafe.Pointer(C.QFutureInterfaceBase_ResultStoreBase2(this.h))) + return UnsafeNewQtPrivate__ResultStoreBase(unsafe.Pointer(C.QFutureInterfaceBase_ResultStoreBase2(this.h))) } func (this *QFutureInterfaceBase) OperatorEqual(other *QFutureInterfaceBase) bool { diff --git a/qt/gen_qfutureinterface.h b/qt/gen_qfutureinterface.h index d86f661a..3a11f4bb 100644 --- a/qt/gen_qfutureinterface.h +++ b/qt/gen_qfutureinterface.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qfuturewatcher.cpp b/qt/gen_qfuturewatcher.cpp index 66873df8..098696b3 100644 --- a/qt/gen_qfuturewatcher.cpp +++ b/qt/gen_qfuturewatcher.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qfuturewatcher.h" +#include #include "gen_qfuturewatcher.h" #include "_cgo_export.h" diff --git a/qt/gen_qfuturewatcher.go b/qt/gen_qfuturewatcher.go index 3440464d..63a59f77 100644 --- a/qt/gen_qfuturewatcher.go +++ b/qt/gen_qfuturewatcher.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,19 +27,26 @@ func (this *QFutureWatcherBase) cPointer() *C.QFutureWatcherBase { return this.h } +func (this *QFutureWatcherBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQFutureWatcherBase(h *C.QFutureWatcherBase) *QFutureWatcherBase { if h == nil { return nil } - return &QFutureWatcherBase{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QFutureWatcherBase{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQFutureWatcherBase_U(h unsafe.Pointer) *QFutureWatcherBase { +func UnsafeNewQFutureWatcherBase(h unsafe.Pointer) *QFutureWatcherBase { return newQFutureWatcherBase((*C.QFutureWatcherBase)(h)) } func (this *QFutureWatcherBase) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QFutureWatcherBase_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QFutureWatcherBase_MetaObject(this.h))) } func (this *QFutureWatcherBase) Metacast(param1 string) unsafe.Pointer { @@ -286,7 +294,7 @@ func miqt_exec_callback_QFutureWatcherBase_ProgressValueChanged(cb C.intptr_t, p } func (this *QFutureWatcherBase) ProgressTextChanged(progressText string) { - progressText_ms := miqt_strdupg(progressText) + progressText_ms := libmiqt.Strdupg(progressText) defer C.free(progressText_ms) C.QFutureWatcherBase_ProgressTextChanged(this.h, (*C.struct_miqt_string)(progressText_ms)) } diff --git a/qt/gen_qfuturewatcher.h b/qt/gen_qfuturewatcher.h index fba9491f..598bcf28 100644 --- a/qt/gen_qfuturewatcher.h +++ b/qt/gen_qfuturewatcher.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgenericmatrix.cpp b/qt/gen_qgenericmatrix.cpp index be222375..4fa0e165 100644 --- a/qt/gen_qgenericmatrix.cpp +++ b/qt/gen_qgenericmatrix.cpp @@ -1,4 +1,4 @@ -#include "qgenericmatrix.h" +#include #include "gen_qgenericmatrix.h" #include "_cgo_export.h" diff --git a/qt/gen_qgenericmatrix.h b/qt/gen_qgenericmatrix.h index 24a3515e..40b3e645 100644 --- a/qt/gen_qgenericmatrix.h +++ b/qt/gen_qgenericmatrix.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgenericplugin.cpp b/qt/gen_qgenericplugin.cpp index 262c0bfe..5c8d105e 100644 --- a/qt/gen_qgenericplugin.cpp +++ b/qt/gen_qgenericplugin.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qgenericplugin.h" +#include #include "gen_qgenericplugin.h" #include "_cgo_export.h" diff --git a/qt/gen_qgenericplugin.go b/qt/gen_qgenericplugin.go index 9bab421f..1f95934d 100644 --- a/qt/gen_qgenericplugin.go +++ b/qt/gen_qgenericplugin.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,19 +26,26 @@ func (this *QGenericPlugin) cPointer() *C.QGenericPlugin { return this.h } +func (this *QGenericPlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGenericPlugin(h *C.QGenericPlugin) *QGenericPlugin { if h == nil { return nil } - return &QGenericPlugin{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QGenericPlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQGenericPlugin_U(h unsafe.Pointer) *QGenericPlugin { +func UnsafeNewQGenericPlugin(h unsafe.Pointer) *QGenericPlugin { return newQGenericPlugin((*C.QGenericPlugin)(h)) } func (this *QGenericPlugin) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGenericPlugin_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGenericPlugin_MetaObject(this.h))) } func (this *QGenericPlugin) Metacast(param1 string) unsafe.Pointer { @@ -65,11 +73,11 @@ func QGenericPlugin_TrUtf8(s string) string { } func (this *QGenericPlugin) Create(name string, spec string) *QObject { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - spec_ms := miqt_strdupg(spec) + spec_ms := libmiqt.Strdupg(spec) defer C.free(spec_ms) - return newQObject_U(unsafe.Pointer(C.QGenericPlugin_Create(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(spec_ms)))) + return UnsafeNewQObject(unsafe.Pointer(C.QGenericPlugin_Create(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(spec_ms)))) } func QGenericPlugin_Tr2(s string, c string) string { diff --git a/qt/gen_qgenericplugin.h b/qt/gen_qgenericplugin.h index 437ae25e..ee071b46 100644 --- a/qt/gen_qgenericplugin.h +++ b/qt/gen_qgenericplugin.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgenericpluginfactory.cpp b/qt/gen_qgenericpluginfactory.cpp index 189afa90..43aa0e44 100644 --- a/qt/gen_qgenericpluginfactory.cpp +++ b/qt/gen_qgenericpluginfactory.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qgenericpluginfactory.h" +#include #include "gen_qgenericpluginfactory.h" #include "_cgo_export.h" diff --git a/qt/gen_qgenericpluginfactory.go b/qt/gen_qgenericpluginfactory.go index f5478451..159fa59a 100644 --- a/qt/gen_qgenericpluginfactory.go +++ b/qt/gen_qgenericpluginfactory.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QGenericPluginFactory) cPointer() *C.QGenericPluginFactory { return this.h } +func (this *QGenericPluginFactory) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGenericPluginFactory(h *C.QGenericPluginFactory) *QGenericPluginFactory { if h == nil { return nil @@ -31,7 +39,7 @@ func newQGenericPluginFactory(h *C.QGenericPluginFactory) *QGenericPluginFactory return &QGenericPluginFactory{h: h} } -func newQGenericPluginFactory_U(h unsafe.Pointer) *QGenericPluginFactory { +func UnsafeNewQGenericPluginFactory(h unsafe.Pointer) *QGenericPluginFactory { return newQGenericPluginFactory((*C.QGenericPluginFactory)(h)) } @@ -50,11 +58,11 @@ func QGenericPluginFactory_Keys() []string { } func QGenericPluginFactory_Create(param1 string, param2 string) *QObject { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) - param2_ms := miqt_strdupg(param2) + param2_ms := libmiqt.Strdupg(param2) defer C.free(param2_ms) - return newQObject_U(unsafe.Pointer(C.QGenericPluginFactory_Create((*C.struct_miqt_string)(param1_ms), (*C.struct_miqt_string)(param2_ms)))) + return UnsafeNewQObject(unsafe.Pointer(C.QGenericPluginFactory_Create((*C.struct_miqt_string)(param1_ms), (*C.struct_miqt_string)(param2_ms)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qgenericpluginfactory.h b/qt/gen_qgenericpluginfactory.h index 45f87f11..a1785c99 100644 --- a/qt/gen_qgenericpluginfactory.h +++ b/qt/gen_qgenericpluginfactory.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgesture.cpp b/qt/gen_qgesture.cpp index 68e6e44b..ec8fcd9a 100644 --- a/qt/gen_qgesture.cpp +++ b/qt/gen_qgesture.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qgesture.h" +#include #include "gen_qgesture.h" #include "_cgo_export.h" @@ -593,7 +593,7 @@ void QTapAndHoldGesture_Delete(QTapAndHoldGesture* self) { } QGestureEvent* QGestureEvent_new(struct miqt_array* /* of QGesture* */ gestures) { - QList gestures_QList; + QList gestures_QList; gestures_QList.reserve(gestures->len); QGesture** gestures_arr = static_cast(gestures->data); for(size_t i = 0; i < gestures->len; ++i) { diff --git a/qt/gen_qgesture.go b/qt/gen_qgesture.go index 6036eccb..26fee489 100644 --- a/qt/gen_qgesture.go +++ b/qt/gen_qgesture.go @@ -50,14 +50,21 @@ func (this *QGesture) cPointer() *C.QGesture { return this.h } +func (this *QGesture) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGesture(h *C.QGesture) *QGesture { if h == nil { return nil } - return &QGesture{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QGesture{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQGesture_U(h unsafe.Pointer) *QGesture { +func UnsafeNewQGesture(h unsafe.Pointer) *QGesture { return newQGesture((*C.QGesture)(h)) } @@ -74,7 +81,7 @@ func NewQGesture2(parent *QObject) *QGesture { } func (this *QGesture) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGesture_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGesture_MetaObject(this.h))) } func (this *QGesture) Metacast(param1 string) unsafe.Pointer { @@ -206,14 +213,21 @@ func (this *QPanGesture) cPointer() *C.QPanGesture { return this.h } +func (this *QPanGesture) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPanGesture(h *C.QPanGesture) *QPanGesture { if h == nil { return nil } - return &QPanGesture{h: h, QGesture: newQGesture_U(unsafe.Pointer(h))} + return &QPanGesture{h: h, QGesture: UnsafeNewQGesture(unsafe.Pointer(h))} } -func newQPanGesture_U(h unsafe.Pointer) *QPanGesture { +func UnsafeNewQPanGesture(h unsafe.Pointer) *QPanGesture { return newQPanGesture((*C.QPanGesture)(h)) } @@ -230,7 +244,7 @@ func NewQPanGesture2(parent *QObject) *QPanGesture { } func (this *QPanGesture) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPanGesture_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPanGesture_MetaObject(this.h))) } func (this *QPanGesture) Metacast(param1 string) unsafe.Pointer { @@ -364,14 +378,21 @@ func (this *QPinchGesture) cPointer() *C.QPinchGesture { return this.h } +func (this *QPinchGesture) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPinchGesture(h *C.QPinchGesture) *QPinchGesture { if h == nil { return nil } - return &QPinchGesture{h: h, QGesture: newQGesture_U(unsafe.Pointer(h))} + return &QPinchGesture{h: h, QGesture: UnsafeNewQGesture(unsafe.Pointer(h))} } -func newQPinchGesture_U(h unsafe.Pointer) *QPinchGesture { +func UnsafeNewQPinchGesture(h unsafe.Pointer) *QPinchGesture { return newQPinchGesture((*C.QPinchGesture)(h)) } @@ -388,7 +409,7 @@ func NewQPinchGesture2(parent *QObject) *QPinchGesture { } func (this *QPinchGesture) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPinchGesture_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPinchGesture_MetaObject(this.h))) } func (this *QPinchGesture) Metacast(param1 string) unsafe.Pointer { @@ -582,14 +603,21 @@ func (this *QSwipeGesture) cPointer() *C.QSwipeGesture { return this.h } +func (this *QSwipeGesture) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSwipeGesture(h *C.QSwipeGesture) *QSwipeGesture { if h == nil { return nil } - return &QSwipeGesture{h: h, QGesture: newQGesture_U(unsafe.Pointer(h))} + return &QSwipeGesture{h: h, QGesture: UnsafeNewQGesture(unsafe.Pointer(h))} } -func newQSwipeGesture_U(h unsafe.Pointer) *QSwipeGesture { +func UnsafeNewQSwipeGesture(h unsafe.Pointer) *QSwipeGesture { return newQSwipeGesture((*C.QSwipeGesture)(h)) } @@ -606,7 +634,7 @@ func NewQSwipeGesture2(parent *QObject) *QSwipeGesture { } func (this *QSwipeGesture) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSwipeGesture_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSwipeGesture_MetaObject(this.h))) } func (this *QSwipeGesture) Metacast(param1 string) unsafe.Pointer { @@ -719,14 +747,21 @@ func (this *QTapGesture) cPointer() *C.QTapGesture { return this.h } +func (this *QTapGesture) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTapGesture(h *C.QTapGesture) *QTapGesture { if h == nil { return nil } - return &QTapGesture{h: h, QGesture: newQGesture_U(unsafe.Pointer(h))} + return &QTapGesture{h: h, QGesture: UnsafeNewQGesture(unsafe.Pointer(h))} } -func newQTapGesture_U(h unsafe.Pointer) *QTapGesture { +func UnsafeNewQTapGesture(h unsafe.Pointer) *QTapGesture { return newQTapGesture((*C.QTapGesture)(h)) } @@ -743,7 +778,7 @@ func NewQTapGesture2(parent *QObject) *QTapGesture { } func (this *QTapGesture) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTapGesture_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTapGesture_MetaObject(this.h))) } func (this *QTapGesture) Metacast(param1 string) unsafe.Pointer { @@ -851,14 +886,21 @@ func (this *QTapAndHoldGesture) cPointer() *C.QTapAndHoldGesture { return this.h } +func (this *QTapAndHoldGesture) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTapAndHoldGesture(h *C.QTapAndHoldGesture) *QTapAndHoldGesture { if h == nil { return nil } - return &QTapAndHoldGesture{h: h, QGesture: newQGesture_U(unsafe.Pointer(h))} + return &QTapAndHoldGesture{h: h, QGesture: UnsafeNewQGesture(unsafe.Pointer(h))} } -func newQTapAndHoldGesture_U(h unsafe.Pointer) *QTapAndHoldGesture { +func UnsafeNewQTapAndHoldGesture(h unsafe.Pointer) *QTapAndHoldGesture { return newQTapAndHoldGesture((*C.QTapAndHoldGesture)(h)) } @@ -875,7 +917,7 @@ func NewQTapAndHoldGesture2(parent *QObject) *QTapAndHoldGesture { } func (this *QTapAndHoldGesture) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTapAndHoldGesture_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTapAndHoldGesture_MetaObject(this.h))) } func (this *QTapAndHoldGesture) Metacast(param1 string) unsafe.Pointer { @@ -991,14 +1033,21 @@ func (this *QGestureEvent) cPointer() *C.QGestureEvent { return this.h } +func (this *QGestureEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGestureEvent(h *C.QGestureEvent) *QGestureEvent { if h == nil { return nil } - return &QGestureEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QGestureEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQGestureEvent_U(h unsafe.Pointer) *QGestureEvent { +func UnsafeNewQGestureEvent(h unsafe.Pointer) *QGestureEvent { return newQGestureEvent((*C.QGestureEvent)(h)) } @@ -1027,14 +1076,14 @@ func (this *QGestureEvent) Gestures() []*QGesture { _ret := make([]*QGesture, int(_ma.len)) _outCast := (*[0xffff]*C.QGesture)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGesture_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGesture(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QGestureEvent) Gesture(typeVal GestureType) *QGesture { - return newQGesture_U(unsafe.Pointer(C.QGestureEvent_Gesture(this.h, (C.int)(typeVal)))) + return UnsafeNewQGesture(unsafe.Pointer(C.QGestureEvent_Gesture(this.h, (C.int)(typeVal)))) } func (this *QGestureEvent) ActiveGestures() []*QGesture { @@ -1042,7 +1091,7 @@ func (this *QGestureEvent) ActiveGestures() []*QGesture { _ret := make([]*QGesture, int(_ma.len)) _outCast := (*[0xffff]*C.QGesture)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGesture_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGesture(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -1053,7 +1102,7 @@ func (this *QGestureEvent) CanceledGestures() []*QGesture { _ret := make([]*QGesture, int(_ma.len)) _outCast := (*[0xffff]*C.QGesture)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGesture_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGesture(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -1096,7 +1145,7 @@ func (this *QGestureEvent) SetWidget(widget *QWidget) { } func (this *QGestureEvent) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QGestureEvent_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QGestureEvent_Widget(this.h))) } func (this *QGestureEvent) MapToGraphicsScene(gesturePoint *QPointF) *QPointF { diff --git a/qt/gen_qgesture.h b/qt/gen_qgesture.h index 32ffa548..b7f8cf43 100644 --- a/qt/gen_qgesture.h +++ b/qt/gen_qgesture.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgesturerecognizer.cpp b/qt/gen_qgesturerecognizer.cpp index 16defb18..09b14c52 100644 --- a/qt/gen_qgesturerecognizer.cpp +++ b/qt/gen_qgesturerecognizer.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qgesturerecognizer.h" +#include #include "gen_qgesturerecognizer.h" #include "_cgo_export.h" diff --git a/qt/gen_qgesturerecognizer.go b/qt/gen_qgesturerecognizer.go index ba695507..eab661e9 100644 --- a/qt/gen_qgesturerecognizer.go +++ b/qt/gen_qgesturerecognizer.go @@ -37,6 +37,13 @@ func (this *QGestureRecognizer) cPointer() *C.QGestureRecognizer { return this.h } +func (this *QGestureRecognizer) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGestureRecognizer(h *C.QGestureRecognizer) *QGestureRecognizer { if h == nil { return nil @@ -44,12 +51,12 @@ func newQGestureRecognizer(h *C.QGestureRecognizer) *QGestureRecognizer { return &QGestureRecognizer{h: h} } -func newQGestureRecognizer_U(h unsafe.Pointer) *QGestureRecognizer { +func UnsafeNewQGestureRecognizer(h unsafe.Pointer) *QGestureRecognizer { return newQGestureRecognizer((*C.QGestureRecognizer)(h)) } func (this *QGestureRecognizer) Create(target *QObject) *QGesture { - return newQGesture_U(unsafe.Pointer(C.QGestureRecognizer_Create(this.h, target.cPointer()))) + return UnsafeNewQGesture(unsafe.Pointer(C.QGestureRecognizer_Create(this.h, target.cPointer()))) } func (this *QGestureRecognizer) Recognize(state *QGesture, watched *QObject, event *QEvent) QGestureRecognizer__ResultFlag { diff --git a/qt/gen_qgesturerecognizer.h b/qt/gen_qgesturerecognizer.h index 1787714e..fc676e1b 100644 --- a/qt/gen_qgesturerecognizer.h +++ b/qt/gen_qgesturerecognizer.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qglobal.cpp b/qt/gen_qglobal.cpp index 79fe027d..26b35110 100644 --- a/qt/gen_qglobal.cpp +++ b/qt/gen_qglobal.cpp @@ -1,4 +1,4 @@ -#include "qglobal.h" +#include #include "gen_qglobal.h" #include "_cgo_export.h" diff --git a/qt/gen_qglobal.h b/qt/gen_qglobal.h index 6aa93829..8f118017 100644 --- a/qt/gen_qglobal.h +++ b/qt/gen_qglobal.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qglyphrun.cpp b/qt/gen_qglyphrun.cpp index a651f3bc..6a8480c5 100644 --- a/qt/gen_qglyphrun.cpp +++ b/qt/gen_qglyphrun.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qglyphrun.h" +#include #include "gen_qglyphrun.h" #include "_cgo_export.h" @@ -49,7 +49,7 @@ struct miqt_array* QGlyphRun_GlyphIndexes(const QGlyphRun* self) { } void QGlyphRun_SetGlyphIndexes(QGlyphRun* self, struct miqt_array* /* of unsigned int */ glyphIndexes) { - QVector glyphIndexes_QList; + QVector glyphIndexes_QList; glyphIndexes_QList.reserve(glyphIndexes->len); unsigned int* glyphIndexes_arr = static_cast(glyphIndexes->data); for(size_t i = 0; i < glyphIndexes->len; ++i) { diff --git a/qt/gen_qglyphrun.go b/qt/gen_qglyphrun.go index f1c9b926..e0f709be 100644 --- a/qt/gen_qglyphrun.go +++ b/qt/gen_qglyphrun.go @@ -34,6 +34,13 @@ func (this *QGlyphRun) cPointer() *C.QGlyphRun { return this.h } +func (this *QGlyphRun) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGlyphRun(h *C.QGlyphRun) *QGlyphRun { if h == nil { return nil @@ -41,7 +48,7 @@ func newQGlyphRun(h *C.QGlyphRun) *QGlyphRun { return &QGlyphRun{h: h} } -func newQGlyphRun_U(h unsafe.Pointer) *QGlyphRun { +func UnsafeNewQGlyphRun(h unsafe.Pointer) *QGlyphRun { return newQGlyphRun((*C.QGlyphRun)(h)) } diff --git a/qt/gen_qglyphrun.h b/qt/gen_qglyphrun.h index 70ff6d69..49ae89b7 100644 --- a/qt/gen_qglyphrun.h +++ b/qt/gen_qglyphrun.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicsanchorlayout.cpp b/qt/gen_qgraphicsanchorlayout.cpp index bc7d1c4f..3dc4705b 100644 --- a/qt/gen_qgraphicsanchorlayout.cpp +++ b/qt/gen_qgraphicsanchorlayout.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qgraphicsanchorlayout.h" +#include #include "gen_qgraphicsanchorlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicsanchorlayout.go b/qt/gen_qgraphicsanchorlayout.go index 3c8fa239..1741459c 100644 --- a/qt/gen_qgraphicsanchorlayout.go +++ b/qt/gen_qgraphicsanchorlayout.go @@ -25,19 +25,26 @@ func (this *QGraphicsAnchor) cPointer() *C.QGraphicsAnchor { return this.h } +func (this *QGraphicsAnchor) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsAnchor(h *C.QGraphicsAnchor) *QGraphicsAnchor { if h == nil { return nil } - return &QGraphicsAnchor{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QGraphicsAnchor{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQGraphicsAnchor_U(h unsafe.Pointer) *QGraphicsAnchor { +func UnsafeNewQGraphicsAnchor(h unsafe.Pointer) *QGraphicsAnchor { return newQGraphicsAnchor((*C.QGraphicsAnchor)(h)) } func (this *QGraphicsAnchor) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsAnchor_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsAnchor_MetaObject(this.h))) } func (this *QGraphicsAnchor) Metacast(param1 string) unsafe.Pointer { @@ -154,14 +161,21 @@ func (this *QGraphicsAnchorLayout) cPointer() *C.QGraphicsAnchorLayout { return this.h } +func (this *QGraphicsAnchorLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsAnchorLayout(h *C.QGraphicsAnchorLayout) *QGraphicsAnchorLayout { if h == nil { return nil } - return &QGraphicsAnchorLayout{h: h, QGraphicsLayout: newQGraphicsLayout_U(unsafe.Pointer(h))} + return &QGraphicsAnchorLayout{h: h, QGraphicsLayout: UnsafeNewQGraphicsLayout(unsafe.Pointer(h))} } -func newQGraphicsAnchorLayout_U(h unsafe.Pointer) *QGraphicsAnchorLayout { +func UnsafeNewQGraphicsAnchorLayout(h unsafe.Pointer) *QGraphicsAnchorLayout { return newQGraphicsAnchorLayout((*C.QGraphicsAnchorLayout)(h)) } @@ -178,11 +192,11 @@ func NewQGraphicsAnchorLayout2(parent *QGraphicsLayoutItem) *QGraphicsAnchorLayo } func (this *QGraphicsAnchorLayout) AddAnchor(firstItem *QGraphicsLayoutItem, firstEdge AnchorPoint, secondItem *QGraphicsLayoutItem, secondEdge AnchorPoint) *QGraphicsAnchor { - return newQGraphicsAnchor_U(unsafe.Pointer(C.QGraphicsAnchorLayout_AddAnchor(this.h, firstItem.cPointer(), (C.int)(firstEdge), secondItem.cPointer(), (C.int)(secondEdge)))) + return UnsafeNewQGraphicsAnchor(unsafe.Pointer(C.QGraphicsAnchorLayout_AddAnchor(this.h, firstItem.cPointer(), (C.int)(firstEdge), secondItem.cPointer(), (C.int)(secondEdge)))) } func (this *QGraphicsAnchorLayout) Anchor(firstItem *QGraphicsLayoutItem, firstEdge AnchorPoint, secondItem *QGraphicsLayoutItem, secondEdge AnchorPoint) *QGraphicsAnchor { - return newQGraphicsAnchor_U(unsafe.Pointer(C.QGraphicsAnchorLayout_Anchor(this.h, firstItem.cPointer(), (C.int)(firstEdge), secondItem.cPointer(), (C.int)(secondEdge)))) + return UnsafeNewQGraphicsAnchor(unsafe.Pointer(C.QGraphicsAnchorLayout_Anchor(this.h, firstItem.cPointer(), (C.int)(firstEdge), secondItem.cPointer(), (C.int)(secondEdge)))) } func (this *QGraphicsAnchorLayout) AddCornerAnchors(firstItem *QGraphicsLayoutItem, firstCorner Corner, secondItem *QGraphicsLayoutItem, secondCorner Corner) { @@ -226,7 +240,7 @@ func (this *QGraphicsAnchorLayout) Count() int { } func (this *QGraphicsAnchorLayout) ItemAt(index int) *QGraphicsLayoutItem { - return newQGraphicsLayoutItem_U(unsafe.Pointer(C.QGraphicsAnchorLayout_ItemAt(this.h, (C.int)(index)))) + return UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(C.QGraphicsAnchorLayout_ItemAt(this.h, (C.int)(index)))) } func (this *QGraphicsAnchorLayout) Invalidate() { diff --git a/qt/gen_qgraphicsanchorlayout.h b/qt/gen_qgraphicsanchorlayout.h index 289e05a2..2d6fc3fc 100644 --- a/qt/gen_qgraphicsanchorlayout.h +++ b/qt/gen_qgraphicsanchorlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicseffect.cpp b/qt/gen_qgraphicseffect.cpp index 49de63de..87492e1e 100644 --- a/qt/gen_qgraphicseffect.cpp +++ b/qt/gen_qgraphicseffect.cpp @@ -12,7 +12,7 @@ #include #include #include -#include "qgraphicseffect.h" +#include #include "gen_qgraphicseffect.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicseffect.go b/qt/gen_qgraphicseffect.go index 1f6ede78..f388db1e 100644 --- a/qt/gen_qgraphicseffect.go +++ b/qt/gen_qgraphicseffect.go @@ -51,19 +51,26 @@ func (this *QGraphicsEffect) cPointer() *C.QGraphicsEffect { return this.h } +func (this *QGraphicsEffect) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsEffect(h *C.QGraphicsEffect) *QGraphicsEffect { if h == nil { return nil } - return &QGraphicsEffect{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QGraphicsEffect{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQGraphicsEffect_U(h unsafe.Pointer) *QGraphicsEffect { +func UnsafeNewQGraphicsEffect(h unsafe.Pointer) *QGraphicsEffect { return newQGraphicsEffect((*C.QGraphicsEffect)(h)) } func (this *QGraphicsEffect) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsEffect_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsEffect_MetaObject(this.h))) } func (this *QGraphicsEffect) Metacast(param1 string) unsafe.Pointer { @@ -206,14 +213,21 @@ func (this *QGraphicsColorizeEffect) cPointer() *C.QGraphicsColorizeEffect { return this.h } +func (this *QGraphicsColorizeEffect) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsColorizeEffect(h *C.QGraphicsColorizeEffect) *QGraphicsColorizeEffect { if h == nil { return nil } - return &QGraphicsColorizeEffect{h: h, QGraphicsEffect: newQGraphicsEffect_U(unsafe.Pointer(h))} + return &QGraphicsColorizeEffect{h: h, QGraphicsEffect: UnsafeNewQGraphicsEffect(unsafe.Pointer(h))} } -func newQGraphicsColorizeEffect_U(h unsafe.Pointer) *QGraphicsColorizeEffect { +func UnsafeNewQGraphicsColorizeEffect(h unsafe.Pointer) *QGraphicsColorizeEffect { return newQGraphicsColorizeEffect((*C.QGraphicsColorizeEffect)(h)) } @@ -230,7 +244,7 @@ func NewQGraphicsColorizeEffect2(parent *QObject) *QGraphicsColorizeEffect { } func (this *QGraphicsColorizeEffect) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsColorizeEffect_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsColorizeEffect_MetaObject(this.h))) } func (this *QGraphicsColorizeEffect) Metacast(param1 string) unsafe.Pointer { @@ -291,7 +305,7 @@ func miqt_exec_callback_QGraphicsColorizeEffect_ColorChanged(cb C.intptr_t, colo } // Convert all CABI parameters to Go parameters - slotval1 := newQColor_U(unsafe.Pointer(color)) + slotval1 := UnsafeNewQColor(unsafe.Pointer(color)) gofunc(slotval1) } @@ -386,14 +400,21 @@ func (this *QGraphicsBlurEffect) cPointer() *C.QGraphicsBlurEffect { return this.h } +func (this *QGraphicsBlurEffect) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsBlurEffect(h *C.QGraphicsBlurEffect) *QGraphicsBlurEffect { if h == nil { return nil } - return &QGraphicsBlurEffect{h: h, QGraphicsEffect: newQGraphicsEffect_U(unsafe.Pointer(h))} + return &QGraphicsBlurEffect{h: h, QGraphicsEffect: UnsafeNewQGraphicsEffect(unsafe.Pointer(h))} } -func newQGraphicsBlurEffect_U(h unsafe.Pointer) *QGraphicsBlurEffect { +func UnsafeNewQGraphicsBlurEffect(h unsafe.Pointer) *QGraphicsBlurEffect { return newQGraphicsBlurEffect((*C.QGraphicsBlurEffect)(h)) } @@ -410,7 +431,7 @@ func NewQGraphicsBlurEffect2(parent *QObject) *QGraphicsBlurEffect { } func (this *QGraphicsBlurEffect) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsBlurEffect_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsBlurEffect_MetaObject(this.h))) } func (this *QGraphicsBlurEffect) Metacast(param1 string) unsafe.Pointer { @@ -570,14 +591,21 @@ func (this *QGraphicsDropShadowEffect) cPointer() *C.QGraphicsDropShadowEffect { return this.h } +func (this *QGraphicsDropShadowEffect) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsDropShadowEffect(h *C.QGraphicsDropShadowEffect) *QGraphicsDropShadowEffect { if h == nil { return nil } - return &QGraphicsDropShadowEffect{h: h, QGraphicsEffect: newQGraphicsEffect_U(unsafe.Pointer(h))} + return &QGraphicsDropShadowEffect{h: h, QGraphicsEffect: UnsafeNewQGraphicsEffect(unsafe.Pointer(h))} } -func newQGraphicsDropShadowEffect_U(h unsafe.Pointer) *QGraphicsDropShadowEffect { +func UnsafeNewQGraphicsDropShadowEffect(h unsafe.Pointer) *QGraphicsDropShadowEffect { return newQGraphicsDropShadowEffect((*C.QGraphicsDropShadowEffect)(h)) } @@ -594,7 +622,7 @@ func NewQGraphicsDropShadowEffect2(parent *QObject) *QGraphicsDropShadowEffect { } func (this *QGraphicsDropShadowEffect) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsDropShadowEffect_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsDropShadowEffect_MetaObject(this.h))) } func (this *QGraphicsDropShadowEffect) Metacast(param1 string) unsafe.Pointer { @@ -697,7 +725,7 @@ func miqt_exec_callback_QGraphicsDropShadowEffect_OffsetChanged(cb C.intptr_t, o } // Convert all CABI parameters to Go parameters - slotval1 := newQPointF_U(unsafe.Pointer(offset)) + slotval1 := UnsafeNewQPointF(unsafe.Pointer(offset)) gofunc(slotval1) } @@ -737,7 +765,7 @@ func miqt_exec_callback_QGraphicsDropShadowEffect_ColorChanged(cb C.intptr_t, co } // Convert all CABI parameters to Go parameters - slotval1 := newQColor_U(unsafe.Pointer(color)) + slotval1 := UnsafeNewQColor(unsafe.Pointer(color)) gofunc(slotval1) } @@ -812,14 +840,21 @@ func (this *QGraphicsOpacityEffect) cPointer() *C.QGraphicsOpacityEffect { return this.h } +func (this *QGraphicsOpacityEffect) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsOpacityEffect(h *C.QGraphicsOpacityEffect) *QGraphicsOpacityEffect { if h == nil { return nil } - return &QGraphicsOpacityEffect{h: h, QGraphicsEffect: newQGraphicsEffect_U(unsafe.Pointer(h))} + return &QGraphicsOpacityEffect{h: h, QGraphicsEffect: UnsafeNewQGraphicsEffect(unsafe.Pointer(h))} } -func newQGraphicsOpacityEffect_U(h unsafe.Pointer) *QGraphicsOpacityEffect { +func UnsafeNewQGraphicsOpacityEffect(h unsafe.Pointer) *QGraphicsOpacityEffect { return newQGraphicsOpacityEffect((*C.QGraphicsOpacityEffect)(h)) } @@ -836,7 +871,7 @@ func NewQGraphicsOpacityEffect2(parent *QObject) *QGraphicsOpacityEffect { } func (this *QGraphicsOpacityEffect) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsOpacityEffect_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsOpacityEffect_MetaObject(this.h))) } func (this *QGraphicsOpacityEffect) Metacast(param1 string) unsafe.Pointer { @@ -917,7 +952,7 @@ func miqt_exec_callback_QGraphicsOpacityEffect_OpacityMaskChanged(cb C.intptr_t, } // Convert all CABI parameters to Go parameters - slotval1 := newQBrush_U(unsafe.Pointer(mask)) + slotval1 := UnsafeNewQBrush(unsafe.Pointer(mask)) gofunc(slotval1) } diff --git a/qt/gen_qgraphicseffect.h b/qt/gen_qgraphicseffect.h index 2e4aa0b4..9d7c02cd 100644 --- a/qt/gen_qgraphicseffect.h +++ b/qt/gen_qgraphicseffect.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicsgridlayout.cpp b/qt/gen_qgraphicsgridlayout.cpp index 4bf94ca5..794c88f4 100644 --- a/qt/gen_qgraphicsgridlayout.cpp +++ b/qt/gen_qgraphicsgridlayout.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qgraphicsgridlayout.h" +#include #include "gen_qgraphicsgridlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicsgridlayout.go b/qt/gen_qgraphicsgridlayout.go index da1f2607..8c32b85a 100644 --- a/qt/gen_qgraphicsgridlayout.go +++ b/qt/gen_qgraphicsgridlayout.go @@ -25,14 +25,21 @@ func (this *QGraphicsGridLayout) cPointer() *C.QGraphicsGridLayout { return this.h } +func (this *QGraphicsGridLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsGridLayout(h *C.QGraphicsGridLayout) *QGraphicsGridLayout { if h == nil { return nil } - return &QGraphicsGridLayout{h: h, QGraphicsLayout: newQGraphicsLayout_U(unsafe.Pointer(h))} + return &QGraphicsGridLayout{h: h, QGraphicsLayout: UnsafeNewQGraphicsLayout(unsafe.Pointer(h))} } -func newQGraphicsGridLayout_U(h unsafe.Pointer) *QGraphicsGridLayout { +func UnsafeNewQGraphicsGridLayout(h unsafe.Pointer) *QGraphicsGridLayout { return newQGraphicsGridLayout((*C.QGraphicsGridLayout)(h)) } @@ -197,7 +204,7 @@ func (this *QGraphicsGridLayout) ColumnCount() int { } func (this *QGraphicsGridLayout) ItemAt(row int, column int) *QGraphicsLayoutItem { - return newQGraphicsLayoutItem_U(unsafe.Pointer(C.QGraphicsGridLayout_ItemAt(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(C.QGraphicsGridLayout_ItemAt(this.h, (C.int)(row), (C.int)(column)))) } func (this *QGraphicsGridLayout) Count() int { @@ -205,7 +212,7 @@ func (this *QGraphicsGridLayout) Count() int { } func (this *QGraphicsGridLayout) ItemAtWithIndex(index int) *QGraphicsLayoutItem { - return newQGraphicsLayoutItem_U(unsafe.Pointer(C.QGraphicsGridLayout_ItemAtWithIndex(this.h, (C.int)(index)))) + return UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(C.QGraphicsGridLayout_ItemAtWithIndex(this.h, (C.int)(index)))) } func (this *QGraphicsGridLayout) RemoveAt(index int) { diff --git a/qt/gen_qgraphicsgridlayout.h b/qt/gen_qgraphicsgridlayout.h index 0007dbc7..18474a42 100644 --- a/qt/gen_qgraphicsgridlayout.h +++ b/qt/gen_qgraphicsgridlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicsitem.cpp b/qt/gen_qgraphicsitem.cpp index 653f42ed..f6c71eb4 100644 --- a/qt/gen_qgraphicsitem.cpp +++ b/qt/gen_qgraphicsitem.cpp @@ -39,7 +39,7 @@ #include #include #include -#include "qgraphicsitem.h" +#include #include "gen_qgraphicsitem.h" #include "_cgo_export.h" @@ -460,7 +460,7 @@ struct miqt_array* QGraphicsItem_Transformations(const QGraphicsItem* self) { } void QGraphicsItem_SetTransformations(QGraphicsItem* self, struct miqt_array* /* of QGraphicsTransform* */ transformations) { - QList transformations_QList; + QList transformations_QList; transformations_QList.reserve(transformations->len); QGraphicsTransform** transformations_arr = static_cast(transformations->data); for(size_t i = 0; i < transformations->len; ++i) { diff --git a/qt/gen_qgraphicsitem.go b/qt/gen_qgraphicsitem.go index fa95360c..2b99a6b8 100644 --- a/qt/gen_qgraphicsitem.go +++ b/qt/gen_qgraphicsitem.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -174,6 +175,13 @@ func (this *QGraphicsItem) cPointer() *C.QGraphicsItem { return this.h } +func (this *QGraphicsItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsItem(h *C.QGraphicsItem) *QGraphicsItem { if h == nil { return nil @@ -181,40 +189,40 @@ func newQGraphicsItem(h *C.QGraphicsItem) *QGraphicsItem { return &QGraphicsItem{h: h} } -func newQGraphicsItem_U(h unsafe.Pointer) *QGraphicsItem { +func UnsafeNewQGraphicsItem(h unsafe.Pointer) *QGraphicsItem { return newQGraphicsItem((*C.QGraphicsItem)(h)) } func (this *QGraphicsItem) Scene() *QGraphicsScene { - return newQGraphicsScene_U(unsafe.Pointer(C.QGraphicsItem_Scene(this.h))) + return UnsafeNewQGraphicsScene(unsafe.Pointer(C.QGraphicsItem_Scene(this.h))) } func (this *QGraphicsItem) ParentItem() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItem_ParentItem(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItem_ParentItem(this.h))) } func (this *QGraphicsItem) TopLevelItem() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItem_TopLevelItem(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItem_TopLevelItem(this.h))) } func (this *QGraphicsItem) ParentObject() *QGraphicsObject { - return newQGraphicsObject_U(unsafe.Pointer(C.QGraphicsItem_ParentObject(this.h))) + return UnsafeNewQGraphicsObject(unsafe.Pointer(C.QGraphicsItem_ParentObject(this.h))) } func (this *QGraphicsItem) ParentWidget() *QGraphicsWidget { - return newQGraphicsWidget_U(unsafe.Pointer(C.QGraphicsItem_ParentWidget(this.h))) + return UnsafeNewQGraphicsWidget(unsafe.Pointer(C.QGraphicsItem_ParentWidget(this.h))) } func (this *QGraphicsItem) TopLevelWidget() *QGraphicsWidget { - return newQGraphicsWidget_U(unsafe.Pointer(C.QGraphicsItem_TopLevelWidget(this.h))) + return UnsafeNewQGraphicsWidget(unsafe.Pointer(C.QGraphicsItem_TopLevelWidget(this.h))) } func (this *QGraphicsItem) Window() *QGraphicsWidget { - return newQGraphicsWidget_U(unsafe.Pointer(C.QGraphicsItem_Window(this.h))) + return UnsafeNewQGraphicsWidget(unsafe.Pointer(C.QGraphicsItem_Window(this.h))) } func (this *QGraphicsItem) Panel() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItem_Panel(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItem_Panel(this.h))) } func (this *QGraphicsItem) SetParentItem(parent *QGraphicsItem) { @@ -226,7 +234,7 @@ func (this *QGraphicsItem) ChildItems() []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -245,15 +253,15 @@ func (this *QGraphicsItem) IsPanel() bool { } func (this *QGraphicsItem) ToGraphicsObject() *QGraphicsObject { - return newQGraphicsObject_U(unsafe.Pointer(C.QGraphicsItem_ToGraphicsObject(this.h))) + return UnsafeNewQGraphicsObject(unsafe.Pointer(C.QGraphicsItem_ToGraphicsObject(this.h))) } func (this *QGraphicsItem) ToGraphicsObject2() *QGraphicsObject { - return newQGraphicsObject_U(unsafe.Pointer(C.QGraphicsItem_ToGraphicsObject2(this.h))) + return UnsafeNewQGraphicsObject(unsafe.Pointer(C.QGraphicsItem_ToGraphicsObject2(this.h))) } func (this *QGraphicsItem) Group() *QGraphicsItemGroup { - return newQGraphicsItemGroup_U(unsafe.Pointer(C.QGraphicsItem_Group(this.h))) + return UnsafeNewQGraphicsItemGroup(unsafe.Pointer(C.QGraphicsItem_Group(this.h))) } func (this *QGraphicsItem) SetGroup(group *QGraphicsItemGroup) { @@ -300,7 +308,7 @@ func (this *QGraphicsItem) ToolTip() string { } func (this *QGraphicsItem) SetToolTip(toolTip string) { - toolTip_ms := miqt_strdupg(toolTip) + toolTip_ms := libmiqt.Strdupg(toolTip) defer C.free(toolTip_ms) C.QGraphicsItem_SetToolTip(this.h, (*C.struct_miqt_string)(toolTip_ms)) } @@ -381,7 +389,7 @@ func (this *QGraphicsItem) SetOpacity(opacity float64) { } func (this *QGraphicsItem) GraphicsEffect() *QGraphicsEffect { - return newQGraphicsEffect_U(unsafe.Pointer(C.QGraphicsItem_GraphicsEffect(this.h))) + return UnsafeNewQGraphicsEffect(unsafe.Pointer(C.QGraphicsItem_GraphicsEffect(this.h))) } func (this *QGraphicsItem) SetGraphicsEffect(effect *QGraphicsEffect) { @@ -449,7 +457,7 @@ func (this *QGraphicsItem) ClearFocus() { } func (this *QGraphicsItem) FocusProxy() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItem_FocusProxy(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItem_FocusProxy(this.h))) } func (this *QGraphicsItem) SetFocusProxy(item *QGraphicsItem) { @@ -457,11 +465,11 @@ func (this *QGraphicsItem) SetFocusProxy(item *QGraphicsItem) { } func (this *QGraphicsItem) FocusItem() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItem_FocusItem(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItem_FocusItem(this.h))) } func (this *QGraphicsItem) FocusScopeItem() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItem_FocusScopeItem(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItem_FocusScopeItem(this.h))) } func (this *QGraphicsItem) GrabMouse() { @@ -609,7 +617,7 @@ func (this *QGraphicsItem) Transformations() []*QGraphicsTransform { _ret := make([]*QGraphicsTransform, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsTransform)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsTransform_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsTransform(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -714,7 +722,7 @@ func (this *QGraphicsItem) CollidingItems() []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -985,7 +993,7 @@ func (this *QGraphicsItem) IsAncestorOf(child *QGraphicsItem) bool { } func (this *QGraphicsItem) CommonAncestorItem(other *QGraphicsItem) *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItem_CommonAncestorItem(this.h, other.cPointer()))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItem_CommonAncestorItem(this.h, other.cPointer()))) } func (this *QGraphicsItem) IsUnderMouse() bool { @@ -1083,7 +1091,7 @@ func (this *QGraphicsItem) CollidingItems1(mode ItemSelectionMode) []*QGraphicsI _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -1132,19 +1140,26 @@ func (this *QGraphicsObject) cPointer() *C.QGraphicsObject { return this.h } +func (this *QGraphicsObject) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsObject(h *C.QGraphicsObject) *QGraphicsObject { if h == nil { return nil } - return &QGraphicsObject{h: h, QObject: newQObject_U(unsafe.Pointer(h)), QGraphicsItem: newQGraphicsItem_U(unsafe.Pointer(h))} + return &QGraphicsObject{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h)), QGraphicsItem: UnsafeNewQGraphicsItem(unsafe.Pointer(h))} } -func newQGraphicsObject_U(h unsafe.Pointer) *QGraphicsObject { +func UnsafeNewQGraphicsObject(h unsafe.Pointer) *QGraphicsObject { return newQGraphicsObject((*C.QGraphicsObject)(h)) } func (this *QGraphicsObject) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsObject_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsObject_MetaObject(this.h))) } func (this *QGraphicsObject) Metacast(param1 string) unsafe.Pointer { @@ -1457,14 +1472,21 @@ func (this *QAbstractGraphicsShapeItem) cPointer() *C.QAbstractGraphicsShapeItem return this.h } +func (this *QAbstractGraphicsShapeItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractGraphicsShapeItem(h *C.QAbstractGraphicsShapeItem) *QAbstractGraphicsShapeItem { if h == nil { return nil } - return &QAbstractGraphicsShapeItem{h: h, QGraphicsItem: newQGraphicsItem_U(unsafe.Pointer(h))} + return &QAbstractGraphicsShapeItem{h: h, QGraphicsItem: UnsafeNewQGraphicsItem(unsafe.Pointer(h))} } -func newQAbstractGraphicsShapeItem_U(h unsafe.Pointer) *QAbstractGraphicsShapeItem { +func UnsafeNewQAbstractGraphicsShapeItem(h unsafe.Pointer) *QAbstractGraphicsShapeItem { return newQAbstractGraphicsShapeItem((*C.QAbstractGraphicsShapeItem)(h)) } @@ -1527,14 +1549,21 @@ func (this *QGraphicsPathItem) cPointer() *C.QGraphicsPathItem { return this.h } +func (this *QGraphicsPathItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsPathItem(h *C.QGraphicsPathItem) *QGraphicsPathItem { if h == nil { return nil } - return &QGraphicsPathItem{h: h, QAbstractGraphicsShapeItem: newQAbstractGraphicsShapeItem_U(unsafe.Pointer(h))} + return &QGraphicsPathItem{h: h, QAbstractGraphicsShapeItem: UnsafeNewQAbstractGraphicsShapeItem(unsafe.Pointer(h))} } -func newQGraphicsPathItem_U(h unsafe.Pointer) *QGraphicsPathItem { +func UnsafeNewQGraphicsPathItem(h unsafe.Pointer) *QGraphicsPathItem { return newQGraphicsPathItem((*C.QGraphicsPathItem)(h)) } @@ -1640,14 +1669,21 @@ func (this *QGraphicsRectItem) cPointer() *C.QGraphicsRectItem { return this.h } +func (this *QGraphicsRectItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsRectItem(h *C.QGraphicsRectItem) *QGraphicsRectItem { if h == nil { return nil } - return &QGraphicsRectItem{h: h, QAbstractGraphicsShapeItem: newQAbstractGraphicsShapeItem_U(unsafe.Pointer(h))} + return &QGraphicsRectItem{h: h, QAbstractGraphicsShapeItem: UnsafeNewQAbstractGraphicsShapeItem(unsafe.Pointer(h))} } -func newQGraphicsRectItem_U(h unsafe.Pointer) *QGraphicsRectItem { +func UnsafeNewQGraphicsRectItem(h unsafe.Pointer) *QGraphicsRectItem { return newQGraphicsRectItem((*C.QGraphicsRectItem)(h)) } @@ -1769,14 +1805,21 @@ func (this *QGraphicsEllipseItem) cPointer() *C.QGraphicsEllipseItem { return this.h } +func (this *QGraphicsEllipseItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsEllipseItem(h *C.QGraphicsEllipseItem) *QGraphicsEllipseItem { if h == nil { return nil } - return &QGraphicsEllipseItem{h: h, QAbstractGraphicsShapeItem: newQAbstractGraphicsShapeItem_U(unsafe.Pointer(h))} + return &QGraphicsEllipseItem{h: h, QAbstractGraphicsShapeItem: UnsafeNewQAbstractGraphicsShapeItem(unsafe.Pointer(h))} } -func newQGraphicsEllipseItem_U(h unsafe.Pointer) *QGraphicsEllipseItem { +func UnsafeNewQGraphicsEllipseItem(h unsafe.Pointer) *QGraphicsEllipseItem { return newQGraphicsEllipseItem((*C.QGraphicsEllipseItem)(h)) } @@ -1914,14 +1957,21 @@ func (this *QGraphicsPolygonItem) cPointer() *C.QGraphicsPolygonItem { return this.h } +func (this *QGraphicsPolygonItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsPolygonItem(h *C.QGraphicsPolygonItem) *QGraphicsPolygonItem { if h == nil { return nil } - return &QGraphicsPolygonItem{h: h, QAbstractGraphicsShapeItem: newQAbstractGraphicsShapeItem_U(unsafe.Pointer(h))} + return &QGraphicsPolygonItem{h: h, QAbstractGraphicsShapeItem: UnsafeNewQAbstractGraphicsShapeItem(unsafe.Pointer(h))} } -func newQGraphicsPolygonItem_U(h unsafe.Pointer) *QGraphicsPolygonItem { +func UnsafeNewQGraphicsPolygonItem(h unsafe.Pointer) *QGraphicsPolygonItem { return newQGraphicsPolygonItem((*C.QGraphicsPolygonItem)(h)) } @@ -2012,14 +2062,21 @@ func (this *QGraphicsLineItem) cPointer() *C.QGraphicsLineItem { return this.h } +func (this *QGraphicsLineItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsLineItem(h *C.QGraphicsLineItem) *QGraphicsLineItem { if h == nil { return nil } - return &QGraphicsLineItem{h: h, QGraphicsItem: newQGraphicsItem_U(unsafe.Pointer(h))} + return &QGraphicsLineItem{h: h, QGraphicsItem: UnsafeNewQGraphicsItem(unsafe.Pointer(h))} } -func newQGraphicsLineItem_U(h unsafe.Pointer) *QGraphicsLineItem { +func UnsafeNewQGraphicsLineItem(h unsafe.Pointer) *QGraphicsLineItem { return newQGraphicsLineItem((*C.QGraphicsLineItem)(h)) } @@ -2152,14 +2209,21 @@ func (this *QGraphicsPixmapItem) cPointer() *C.QGraphicsPixmapItem { return this.h } +func (this *QGraphicsPixmapItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsPixmapItem(h *C.QGraphicsPixmapItem) *QGraphicsPixmapItem { if h == nil { return nil } - return &QGraphicsPixmapItem{h: h, QGraphicsItem: newQGraphicsItem_U(unsafe.Pointer(h))} + return &QGraphicsPixmapItem{h: h, QGraphicsItem: UnsafeNewQGraphicsItem(unsafe.Pointer(h))} } -func newQGraphicsPixmapItem_U(h unsafe.Pointer) *QGraphicsPixmapItem { +func UnsafeNewQGraphicsPixmapItem(h unsafe.Pointer) *QGraphicsPixmapItem { return newQGraphicsPixmapItem((*C.QGraphicsPixmapItem)(h)) } @@ -2292,14 +2356,21 @@ func (this *QGraphicsTextItem) cPointer() *C.QGraphicsTextItem { return this.h } +func (this *QGraphicsTextItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsTextItem(h *C.QGraphicsTextItem) *QGraphicsTextItem { if h == nil { return nil } - return &QGraphicsTextItem{h: h, QGraphicsObject: newQGraphicsObject_U(unsafe.Pointer(h))} + return &QGraphicsTextItem{h: h, QGraphicsObject: UnsafeNewQGraphicsObject(unsafe.Pointer(h))} } -func newQGraphicsTextItem_U(h unsafe.Pointer) *QGraphicsTextItem { +func UnsafeNewQGraphicsTextItem(h unsafe.Pointer) *QGraphicsTextItem { return newQGraphicsTextItem((*C.QGraphicsTextItem)(h)) } @@ -2311,7 +2382,7 @@ func NewQGraphicsTextItem() *QGraphicsTextItem { // NewQGraphicsTextItem2 constructs a new QGraphicsTextItem object. func NewQGraphicsTextItem2(text string) *QGraphicsTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QGraphicsTextItem_new2((*C.struct_miqt_string)(text_ms)) return newQGraphicsTextItem(ret) @@ -2325,14 +2396,14 @@ func NewQGraphicsTextItem3(parent *QGraphicsItem) *QGraphicsTextItem { // NewQGraphicsTextItem4 constructs a new QGraphicsTextItem object. func NewQGraphicsTextItem4(text string, parent *QGraphicsItem) *QGraphicsTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QGraphicsTextItem_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQGraphicsTextItem(ret) } func (this *QGraphicsTextItem) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsTextItem_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsTextItem_MetaObject(this.h))) } func (this *QGraphicsTextItem) Metacast(param1 string) unsafe.Pointer { @@ -2367,7 +2438,7 @@ func (this *QGraphicsTextItem) ToHtml() string { } func (this *QGraphicsTextItem) SetHtml(html string) { - html_ms := miqt_strdupg(html) + html_ms := libmiqt.Strdupg(html) defer C.free(html_ms) C.QGraphicsTextItem_SetHtml(this.h, (*C.struct_miqt_string)(html_ms)) } @@ -2380,7 +2451,7 @@ func (this *QGraphicsTextItem) ToPlainText() string { } func (this *QGraphicsTextItem) SetPlainText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QGraphicsTextItem_SetPlainText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -2461,7 +2532,7 @@ func (this *QGraphicsTextItem) SetDocument(document *QTextDocument) { } func (this *QGraphicsTextItem) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QGraphicsTextItem_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QGraphicsTextItem_Document(this.h))) } func (this *QGraphicsTextItem) SetTextInteractionFlags(flags TextInteractionFlag) { @@ -2500,7 +2571,7 @@ func (this *QGraphicsTextItem) TextCursor() *QTextCursor { } func (this *QGraphicsTextItem) LinkActivated(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QGraphicsTextItem_LinkActivated(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -2525,7 +2596,7 @@ func miqt_exec_callback_QGraphicsTextItem_LinkActivated(cb C.intptr_t, param1 *C } func (this *QGraphicsTextItem) LinkHovered(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QGraphicsTextItem_LinkHovered(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -2619,14 +2690,21 @@ func (this *QGraphicsSimpleTextItem) cPointer() *C.QGraphicsSimpleTextItem { return this.h } +func (this *QGraphicsSimpleTextItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSimpleTextItem(h *C.QGraphicsSimpleTextItem) *QGraphicsSimpleTextItem { if h == nil { return nil } - return &QGraphicsSimpleTextItem{h: h, QAbstractGraphicsShapeItem: newQAbstractGraphicsShapeItem_U(unsafe.Pointer(h))} + return &QGraphicsSimpleTextItem{h: h, QAbstractGraphicsShapeItem: UnsafeNewQAbstractGraphicsShapeItem(unsafe.Pointer(h))} } -func newQGraphicsSimpleTextItem_U(h unsafe.Pointer) *QGraphicsSimpleTextItem { +func UnsafeNewQGraphicsSimpleTextItem(h unsafe.Pointer) *QGraphicsSimpleTextItem { return newQGraphicsSimpleTextItem((*C.QGraphicsSimpleTextItem)(h)) } @@ -2638,7 +2716,7 @@ func NewQGraphicsSimpleTextItem() *QGraphicsSimpleTextItem { // NewQGraphicsSimpleTextItem2 constructs a new QGraphicsSimpleTextItem object. func NewQGraphicsSimpleTextItem2(text string) *QGraphicsSimpleTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QGraphicsSimpleTextItem_new2((*C.struct_miqt_string)(text_ms)) return newQGraphicsSimpleTextItem(ret) @@ -2652,14 +2730,14 @@ func NewQGraphicsSimpleTextItem3(parent *QGraphicsItem) *QGraphicsSimpleTextItem // NewQGraphicsSimpleTextItem4 constructs a new QGraphicsSimpleTextItem object. func NewQGraphicsSimpleTextItem4(text string, parent *QGraphicsItem) *QGraphicsSimpleTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QGraphicsSimpleTextItem_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQGraphicsSimpleTextItem(ret) } func (this *QGraphicsSimpleTextItem) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QGraphicsSimpleTextItem_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -2745,14 +2823,21 @@ func (this *QGraphicsItemGroup) cPointer() *C.QGraphicsItemGroup { return this.h } +func (this *QGraphicsItemGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsItemGroup(h *C.QGraphicsItemGroup) *QGraphicsItemGroup { if h == nil { return nil } - return &QGraphicsItemGroup{h: h, QGraphicsItem: newQGraphicsItem_U(unsafe.Pointer(h))} + return &QGraphicsItemGroup{h: h, QGraphicsItem: UnsafeNewQGraphicsItem(unsafe.Pointer(h))} } -func newQGraphicsItemGroup_U(h unsafe.Pointer) *QGraphicsItemGroup { +func UnsafeNewQGraphicsItemGroup(h unsafe.Pointer) *QGraphicsItemGroup { return newQGraphicsItemGroup((*C.QGraphicsItemGroup)(h)) } diff --git a/qt/gen_qgraphicsitem.h b/qt/gen_qgraphicsitem.h index 355fccb0..da26caae 100644 --- a/qt/gen_qgraphicsitem.h +++ b/qt/gen_qgraphicsitem.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicsitemanimation.cpp b/qt/gen_qgraphicsitemanimation.cpp index 1bbec655..11890a81 100644 --- a/qt/gen_qgraphicsitemanimation.cpp +++ b/qt/gen_qgraphicsitemanimation.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qgraphicsitemanimation.h" +#include #include "gen_qgraphicsitemanimation.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicsitemanimation.go b/qt/gen_qgraphicsitemanimation.go index 59ab538a..db5fa11f 100644 --- a/qt/gen_qgraphicsitemanimation.go +++ b/qt/gen_qgraphicsitemanimation.go @@ -25,14 +25,21 @@ func (this *QGraphicsItemAnimation) cPointer() *C.QGraphicsItemAnimation { return this.h } +func (this *QGraphicsItemAnimation) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsItemAnimation(h *C.QGraphicsItemAnimation) *QGraphicsItemAnimation { if h == nil { return nil } - return &QGraphicsItemAnimation{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QGraphicsItemAnimation{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQGraphicsItemAnimation_U(h unsafe.Pointer) *QGraphicsItemAnimation { +func UnsafeNewQGraphicsItemAnimation(h unsafe.Pointer) *QGraphicsItemAnimation { return newQGraphicsItemAnimation((*C.QGraphicsItemAnimation)(h)) } @@ -49,7 +56,7 @@ func NewQGraphicsItemAnimation2(parent *QObject) *QGraphicsItemAnimation { } func (this *QGraphicsItemAnimation) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsItemAnimation_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsItemAnimation_MetaObject(this.h))) } func (this *QGraphicsItemAnimation) Metacast(param1 string) unsafe.Pointer { @@ -77,7 +84,7 @@ func QGraphicsItemAnimation_TrUtf8(s string) string { } func (this *QGraphicsItemAnimation) Item() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsItemAnimation_Item(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsItemAnimation_Item(this.h))) } func (this *QGraphicsItemAnimation) SetItem(item *QGraphicsItem) { @@ -85,7 +92,7 @@ func (this *QGraphicsItemAnimation) SetItem(item *QGraphicsItem) { } func (this *QGraphicsItemAnimation) TimeLine() *QTimeLine { - return newQTimeLine_U(unsafe.Pointer(C.QGraphicsItemAnimation_TimeLine(this.h))) + return UnsafeNewQTimeLine(unsafe.Pointer(C.QGraphicsItemAnimation_TimeLine(this.h))) } func (this *QGraphicsItemAnimation) SetTimeLine(timeLine *QTimeLine) { diff --git a/qt/gen_qgraphicsitemanimation.h b/qt/gen_qgraphicsitemanimation.h index 6fe58e63..7eaa8388 100644 --- a/qt/gen_qgraphicsitemanimation.h +++ b/qt/gen_qgraphicsitemanimation.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicslayout.cpp b/qt/gen_qgraphicslayout.cpp index b0ad6dc1..327943f2 100644 --- a/qt/gen_qgraphicslayout.cpp +++ b/qt/gen_qgraphicslayout.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qgraphicslayout.h" +#include #include "gen_qgraphicslayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicslayout.go b/qt/gen_qgraphicslayout.go index c19567f2..4204a42f 100644 --- a/qt/gen_qgraphicslayout.go +++ b/qt/gen_qgraphicslayout.go @@ -25,14 +25,21 @@ func (this *QGraphicsLayout) cPointer() *C.QGraphicsLayout { return this.h } +func (this *QGraphicsLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsLayout(h *C.QGraphicsLayout) *QGraphicsLayout { if h == nil { return nil } - return &QGraphicsLayout{h: h, QGraphicsLayoutItem: newQGraphicsLayoutItem_U(unsafe.Pointer(h))} + return &QGraphicsLayout{h: h, QGraphicsLayoutItem: UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(h))} } -func newQGraphicsLayout_U(h unsafe.Pointer) *QGraphicsLayout { +func UnsafeNewQGraphicsLayout(h unsafe.Pointer) *QGraphicsLayout { return newQGraphicsLayout((*C.QGraphicsLayout)(h)) } @@ -69,7 +76,7 @@ func (this *QGraphicsLayout) Count() int { } func (this *QGraphicsLayout) ItemAt(i int) *QGraphicsLayoutItem { - return newQGraphicsLayoutItem_U(unsafe.Pointer(C.QGraphicsLayout_ItemAt(this.h, (C.int)(i)))) + return UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(C.QGraphicsLayout_ItemAt(this.h, (C.int)(i)))) } func (this *QGraphicsLayout) RemoveAt(index int) { diff --git a/qt/gen_qgraphicslayout.h b/qt/gen_qgraphicslayout.h index 070b4b63..6d86cee3 100644 --- a/qt/gen_qgraphicslayout.h +++ b/qt/gen_qgraphicslayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicslayoutitem.cpp b/qt/gen_qgraphicslayoutitem.cpp index 3b4fb3af..52c98a59 100644 --- a/qt/gen_qgraphicslayoutitem.cpp +++ b/qt/gen_qgraphicslayoutitem.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qgraphicslayoutitem.h" +#include #include "gen_qgraphicslayoutitem.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicslayoutitem.go b/qt/gen_qgraphicslayoutitem.go index 3faba8fc..2f1c22e0 100644 --- a/qt/gen_qgraphicslayoutitem.go +++ b/qt/gen_qgraphicslayoutitem.go @@ -24,6 +24,13 @@ func (this *QGraphicsLayoutItem) cPointer() *C.QGraphicsLayoutItem { return this.h } +func (this *QGraphicsLayoutItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsLayoutItem(h *C.QGraphicsLayoutItem) *QGraphicsLayoutItem { if h == nil { return nil @@ -31,7 +38,7 @@ func newQGraphicsLayoutItem(h *C.QGraphicsLayoutItem) *QGraphicsLayoutItem { return &QGraphicsLayoutItem{h: h} } -func newQGraphicsLayoutItem_U(h unsafe.Pointer) *QGraphicsLayoutItem { +func UnsafeNewQGraphicsLayoutItem(h unsafe.Pointer) *QGraphicsLayoutItem { return newQGraphicsLayoutItem((*C.QGraphicsLayoutItem)(h)) } @@ -177,7 +184,7 @@ func (this *QGraphicsLayoutItem) UpdateGeometry() { } func (this *QGraphicsLayoutItem) ParentLayoutItem() *QGraphicsLayoutItem { - return newQGraphicsLayoutItem_U(unsafe.Pointer(C.QGraphicsLayoutItem_ParentLayoutItem(this.h))) + return UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(C.QGraphicsLayoutItem_ParentLayoutItem(this.h))) } func (this *QGraphicsLayoutItem) SetParentLayoutItem(parent *QGraphicsLayoutItem) { @@ -189,7 +196,7 @@ func (this *QGraphicsLayoutItem) IsLayout() bool { } func (this *QGraphicsLayoutItem) GraphicsItem() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsLayoutItem_GraphicsItem(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsLayoutItem_GraphicsItem(this.h))) } func (this *QGraphicsLayoutItem) OwnedByLayout() bool { diff --git a/qt/gen_qgraphicslayoutitem.h b/qt/gen_qgraphicslayoutitem.h index e0baabed..c989a1f2 100644 --- a/qt/gen_qgraphicslayoutitem.h +++ b/qt/gen_qgraphicslayoutitem.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicslinearlayout.cpp b/qt/gen_qgraphicslinearlayout.cpp index f9488243..a4834ebe 100644 --- a/qt/gen_qgraphicslinearlayout.cpp +++ b/qt/gen_qgraphicslinearlayout.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qgraphicslinearlayout.h" +#include #include "gen_qgraphicslinearlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicslinearlayout.go b/qt/gen_qgraphicslinearlayout.go index b66648ee..72b8d97f 100644 --- a/qt/gen_qgraphicslinearlayout.go +++ b/qt/gen_qgraphicslinearlayout.go @@ -25,14 +25,21 @@ func (this *QGraphicsLinearLayout) cPointer() *C.QGraphicsLinearLayout { return this.h } +func (this *QGraphicsLinearLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsLinearLayout(h *C.QGraphicsLinearLayout) *QGraphicsLinearLayout { if h == nil { return nil } - return &QGraphicsLinearLayout{h: h, QGraphicsLayout: newQGraphicsLayout_U(unsafe.Pointer(h))} + return &QGraphicsLinearLayout{h: h, QGraphicsLayout: UnsafeNewQGraphicsLayout(unsafe.Pointer(h))} } -func newQGraphicsLinearLayout_U(h unsafe.Pointer) *QGraphicsLinearLayout { +func UnsafeNewQGraphicsLinearLayout(h unsafe.Pointer) *QGraphicsLinearLayout { return newQGraphicsLinearLayout((*C.QGraphicsLinearLayout)(h)) } @@ -133,7 +140,7 @@ func (this *QGraphicsLinearLayout) Count() int { } func (this *QGraphicsLinearLayout) ItemAt(index int) *QGraphicsLayoutItem { - return newQGraphicsLayoutItem_U(unsafe.Pointer(C.QGraphicsLinearLayout_ItemAt(this.h, (C.int)(index)))) + return UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(C.QGraphicsLinearLayout_ItemAt(this.h, (C.int)(index)))) } func (this *QGraphicsLinearLayout) Invalidate() { diff --git a/qt/gen_qgraphicslinearlayout.h b/qt/gen_qgraphicslinearlayout.h index 2dcbf4af..fbd39457 100644 --- a/qt/gen_qgraphicslinearlayout.h +++ b/qt/gen_qgraphicslinearlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicsproxywidget.cpp b/qt/gen_qgraphicsproxywidget.cpp index cb868726..ca51f955 100644 --- a/qt/gen_qgraphicsproxywidget.cpp +++ b/qt/gen_qgraphicsproxywidget.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qgraphicsproxywidget.h" +#include #include "gen_qgraphicsproxywidget.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicsproxywidget.go b/qt/gen_qgraphicsproxywidget.go index a57f2a80..fe582724 100644 --- a/qt/gen_qgraphicsproxywidget.go +++ b/qt/gen_qgraphicsproxywidget.go @@ -31,14 +31,21 @@ func (this *QGraphicsProxyWidget) cPointer() *C.QGraphicsProxyWidget { return this.h } +func (this *QGraphicsProxyWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsProxyWidget(h *C.QGraphicsProxyWidget) *QGraphicsProxyWidget { if h == nil { return nil } - return &QGraphicsProxyWidget{h: h, QGraphicsWidget: newQGraphicsWidget_U(unsafe.Pointer(h))} + return &QGraphicsProxyWidget{h: h, QGraphicsWidget: UnsafeNewQGraphicsWidget(unsafe.Pointer(h))} } -func newQGraphicsProxyWidget_U(h unsafe.Pointer) *QGraphicsProxyWidget { +func UnsafeNewQGraphicsProxyWidget(h unsafe.Pointer) *QGraphicsProxyWidget { return newQGraphicsProxyWidget((*C.QGraphicsProxyWidget)(h)) } @@ -61,7 +68,7 @@ func NewQGraphicsProxyWidget3(parent *QGraphicsItem, wFlags WindowType) *QGraphi } func (this *QGraphicsProxyWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsProxyWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsProxyWidget_MetaObject(this.h))) } func (this *QGraphicsProxyWidget) Metacast(param1 string) unsafe.Pointer { @@ -93,7 +100,7 @@ func (this *QGraphicsProxyWidget) SetWidget(widget *QWidget) { } func (this *QGraphicsProxyWidget) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QGraphicsProxyWidget_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QGraphicsProxyWidget_Widget(this.h))) } func (this *QGraphicsProxyWidget) SubWidgetRect(widget *QWidget) *QRectF { @@ -116,7 +123,7 @@ func (this *QGraphicsProxyWidget) Type() int { } func (this *QGraphicsProxyWidget) CreateProxyForChildWidget(child *QWidget) *QGraphicsProxyWidget { - return newQGraphicsProxyWidget_U(unsafe.Pointer(C.QGraphicsProxyWidget_CreateProxyForChildWidget(this.h, child.cPointer()))) + return UnsafeNewQGraphicsProxyWidget(unsafe.Pointer(C.QGraphicsProxyWidget_CreateProxyForChildWidget(this.h, child.cPointer()))) } func QGraphicsProxyWidget_Tr2(s string, c string) string { diff --git a/qt/gen_qgraphicsproxywidget.h b/qt/gen_qgraphicsproxywidget.h index 3dedc86c..4f9f2979 100644 --- a/qt/gen_qgraphicsproxywidget.h +++ b/qt/gen_qgraphicsproxywidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicsscene.cpp b/qt/gen_qgraphicsscene.cpp index 45e8af3f..7cd32479 100644 --- a/qt/gen_qgraphicsscene.cpp +++ b/qt/gen_qgraphicsscene.cpp @@ -32,7 +32,7 @@ #include #include #include -#include "qgraphicsscene.h" +#include #include "gen_qgraphicsscene.h" #include "_cgo_export.h" @@ -253,7 +253,7 @@ void QGraphicsScene_SetSelectionArea2(QGraphicsScene* self, QPainterPath* path, } QGraphicsItemGroup* QGraphicsScene_CreateItemGroup(QGraphicsScene* self, struct miqt_array* /* of QGraphicsItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QGraphicsItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { diff --git a/qt/gen_qgraphicsscene.go b/qt/gen_qgraphicsscene.go index b7c993b5..168ccd5d 100644 --- a/qt/gen_qgraphicsscene.go +++ b/qt/gen_qgraphicsscene.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -42,14 +43,21 @@ func (this *QGraphicsScene) cPointer() *C.QGraphicsScene { return this.h } +func (this *QGraphicsScene) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsScene(h *C.QGraphicsScene) *QGraphicsScene { if h == nil { return nil } - return &QGraphicsScene{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QGraphicsScene{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQGraphicsScene_U(h unsafe.Pointer) *QGraphicsScene { +func UnsafeNewQGraphicsScene(h unsafe.Pointer) *QGraphicsScene { return newQGraphicsScene((*C.QGraphicsScene)(h)) } @@ -90,7 +98,7 @@ func NewQGraphicsScene6(x float64, y float64, width float64, height float64, par } func (this *QGraphicsScene) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsScene_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsScene_MetaObject(this.h))) } func (this *QGraphicsScene) Metacast(param1 string) unsafe.Pointer { @@ -180,7 +188,7 @@ func (this *QGraphicsScene) Items() []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -191,7 +199,7 @@ func (this *QGraphicsScene) ItemsWithPos(pos *QPointF) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -202,7 +210,7 @@ func (this *QGraphicsScene) ItemsWithRect(rect *QRectF) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -213,7 +221,7 @@ func (this *QGraphicsScene) ItemsWithPath(path *QPainterPath) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -224,14 +232,14 @@ func (this *QGraphicsScene) CollidingItems(item *QGraphicsItem) []*QGraphicsItem _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QGraphicsScene) ItemAt(pos *QPointF, deviceTransform *QTransform) *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsScene_ItemAt(this.h, pos.cPointer(), deviceTransform.cPointer()))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsScene_ItemAt(this.h, pos.cPointer(), deviceTransform.cPointer()))) } func (this *QGraphicsScene) Items2(x float64, y float64, w float64, h float64, mode ItemSelectionMode, order SortOrder) []*QGraphicsItem { @@ -239,14 +247,14 @@ func (this *QGraphicsScene) Items2(x float64, y float64, w float64, h float64, m _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QGraphicsScene) ItemAt2(x float64, y float64, deviceTransform *QTransform) *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsScene_ItemAt2(this.h, (C.double)(x), (C.double)(y), deviceTransform.cPointer()))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsScene_ItemAt2(this.h, (C.double)(x), (C.double)(y), deviceTransform.cPointer()))) } func (this *QGraphicsScene) SelectedItems() []*QGraphicsItem { @@ -254,7 +262,7 @@ func (this *QGraphicsScene) SelectedItems() []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -288,7 +296,7 @@ func (this *QGraphicsScene) CreateItemGroup(items []*QGraphicsItem) *QGraphicsIt } items_ma := &C.struct_miqt_array{len: C.size_t(len(items)), data: unsafe.Pointer(items_CArray)} defer runtime.KeepAlive(unsafe.Pointer(items_ma)) - return newQGraphicsItemGroup_U(unsafe.Pointer(C.QGraphicsScene_CreateItemGroup(this.h, items_ma))) + return UnsafeNewQGraphicsItemGroup(unsafe.Pointer(C.QGraphicsScene_CreateItemGroup(this.h, items_ma))) } func (this *QGraphicsScene) DestroyItemGroup(group *QGraphicsItemGroup) { @@ -300,51 +308,51 @@ func (this *QGraphicsScene) AddItem(item *QGraphicsItem) { } func (this *QGraphicsScene) AddEllipse(rect *QRectF) *QGraphicsEllipseItem { - return newQGraphicsEllipseItem_U(unsafe.Pointer(C.QGraphicsScene_AddEllipse(this.h, rect.cPointer()))) + return UnsafeNewQGraphicsEllipseItem(unsafe.Pointer(C.QGraphicsScene_AddEllipse(this.h, rect.cPointer()))) } func (this *QGraphicsScene) AddLine(line *QLineF) *QGraphicsLineItem { - return newQGraphicsLineItem_U(unsafe.Pointer(C.QGraphicsScene_AddLine(this.h, line.cPointer()))) + return UnsafeNewQGraphicsLineItem(unsafe.Pointer(C.QGraphicsScene_AddLine(this.h, line.cPointer()))) } func (this *QGraphicsScene) AddPath(path *QPainterPath) *QGraphicsPathItem { - return newQGraphicsPathItem_U(unsafe.Pointer(C.QGraphicsScene_AddPath(this.h, path.cPointer()))) + return UnsafeNewQGraphicsPathItem(unsafe.Pointer(C.QGraphicsScene_AddPath(this.h, path.cPointer()))) } func (this *QGraphicsScene) AddPixmap(pixmap *QPixmap) *QGraphicsPixmapItem { - return newQGraphicsPixmapItem_U(unsafe.Pointer(C.QGraphicsScene_AddPixmap(this.h, pixmap.cPointer()))) + return UnsafeNewQGraphicsPixmapItem(unsafe.Pointer(C.QGraphicsScene_AddPixmap(this.h, pixmap.cPointer()))) } func (this *QGraphicsScene) AddRect(rect *QRectF) *QGraphicsRectItem { - return newQGraphicsRectItem_U(unsafe.Pointer(C.QGraphicsScene_AddRect(this.h, rect.cPointer()))) + return UnsafeNewQGraphicsRectItem(unsafe.Pointer(C.QGraphicsScene_AddRect(this.h, rect.cPointer()))) } func (this *QGraphicsScene) AddText(text string) *QGraphicsTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQGraphicsTextItem_U(unsafe.Pointer(C.QGraphicsScene_AddText(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQGraphicsTextItem(unsafe.Pointer(C.QGraphicsScene_AddText(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QGraphicsScene) AddSimpleText(text string) *QGraphicsSimpleTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQGraphicsSimpleTextItem_U(unsafe.Pointer(C.QGraphicsScene_AddSimpleText(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQGraphicsSimpleTextItem(unsafe.Pointer(C.QGraphicsScene_AddSimpleText(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QGraphicsScene) AddWidget(widget *QWidget) *QGraphicsProxyWidget { - return newQGraphicsProxyWidget_U(unsafe.Pointer(C.QGraphicsScene_AddWidget(this.h, widget.cPointer()))) + return UnsafeNewQGraphicsProxyWidget(unsafe.Pointer(C.QGraphicsScene_AddWidget(this.h, widget.cPointer()))) } func (this *QGraphicsScene) AddEllipse2(x float64, y float64, w float64, h float64) *QGraphicsEllipseItem { - return newQGraphicsEllipseItem_U(unsafe.Pointer(C.QGraphicsScene_AddEllipse2(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h)))) + return UnsafeNewQGraphicsEllipseItem(unsafe.Pointer(C.QGraphicsScene_AddEllipse2(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h)))) } func (this *QGraphicsScene) AddLine2(x1 float64, y1 float64, x2 float64, y2 float64) *QGraphicsLineItem { - return newQGraphicsLineItem_U(unsafe.Pointer(C.QGraphicsScene_AddLine2(this.h, (C.double)(x1), (C.double)(y1), (C.double)(x2), (C.double)(y2)))) + return UnsafeNewQGraphicsLineItem(unsafe.Pointer(C.QGraphicsScene_AddLine2(this.h, (C.double)(x1), (C.double)(y1), (C.double)(x2), (C.double)(y2)))) } func (this *QGraphicsScene) AddRect2(x float64, y float64, w float64, h float64) *QGraphicsRectItem { - return newQGraphicsRectItem_U(unsafe.Pointer(C.QGraphicsScene_AddRect2(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h)))) + return UnsafeNewQGraphicsRectItem(unsafe.Pointer(C.QGraphicsScene_AddRect2(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h)))) } func (this *QGraphicsScene) RemoveItem(item *QGraphicsItem) { @@ -352,7 +360,7 @@ func (this *QGraphicsScene) RemoveItem(item *QGraphicsItem) { } func (this *QGraphicsScene) FocusItem() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsScene_FocusItem(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsScene_FocusItem(this.h))) } func (this *QGraphicsScene) SetFocusItem(item *QGraphicsItem) { @@ -380,7 +388,7 @@ func (this *QGraphicsScene) StickyFocus() bool { } func (this *QGraphicsScene) MouseGrabberItem() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsScene_MouseGrabberItem(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsScene_MouseGrabberItem(this.h))) } func (this *QGraphicsScene) BackgroundBrush() *QBrush { @@ -417,7 +425,7 @@ func (this *QGraphicsScene) Views() []*QGraphicsView { _ret := make([]*QGraphicsView, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsView)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsView_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsView(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -432,7 +440,7 @@ func (this *QGraphicsScene) Invalidate(x float64, y float64, w float64, h float6 } func (this *QGraphicsScene) Style() *QStyle { - return newQStyle_U(unsafe.Pointer(C.QGraphicsScene_Style(this.h))) + return UnsafeNewQStyle(unsafe.Pointer(C.QGraphicsScene_Style(this.h))) } func (this *QGraphicsScene) SetStyle(style *QStyle) { @@ -466,7 +474,7 @@ func (this *QGraphicsScene) IsActive() bool { } func (this *QGraphicsScene) ActivePanel() *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsScene_ActivePanel(this.h))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsScene_ActivePanel(this.h))) } func (this *QGraphicsScene) SetActivePanel(item *QGraphicsItem) { @@ -474,7 +482,7 @@ func (this *QGraphicsScene) SetActivePanel(item *QGraphicsItem) { } func (this *QGraphicsScene) ActiveWindow() *QGraphicsWidget { - return newQGraphicsWidget_U(unsafe.Pointer(C.QGraphicsScene_ActiveWindow(this.h))) + return UnsafeNewQGraphicsWidget(unsafe.Pointer(C.QGraphicsScene_ActiveWindow(this.h))) } func (this *QGraphicsScene) SetActiveWindow(widget *QGraphicsWidget) { @@ -574,7 +582,7 @@ func miqt_exec_callback_QGraphicsScene_SceneRectChanged(cb C.intptr_t, rect *C.Q } // Convert all CABI parameters to Go parameters - slotval1 := newQRectF_U(unsafe.Pointer(rect)) + slotval1 := UnsafeNewQRectF(unsafe.Pointer(rect)) gofunc(slotval1) } @@ -611,8 +619,8 @@ func miqt_exec_callback_QGraphicsScene_FocusItemChanged(cb C.intptr_t, newFocus } // Convert all CABI parameters to Go parameters - slotval1 := newQGraphicsItem_U(unsafe.Pointer(newFocus)) - slotval2 := newQGraphicsItem_U(unsafe.Pointer(oldFocus)) + slotval1 := UnsafeNewQGraphicsItem(unsafe.Pointer(newFocus)) + slotval2 := UnsafeNewQGraphicsItem(unsafe.Pointer(oldFocus)) slotval3 := (FocusReason)(reason) gofunc(slotval1, slotval2, slotval3) @@ -679,7 +687,7 @@ func (this *QGraphicsScene) Items1(order SortOrder) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -690,7 +698,7 @@ func (this *QGraphicsScene) Items22(pos *QPointF, mode ItemSelectionMode) []*QGr _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -701,7 +709,7 @@ func (this *QGraphicsScene) Items3(pos *QPointF, mode ItemSelectionMode, order S _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -712,7 +720,7 @@ func (this *QGraphicsScene) Items4(pos *QPointF, mode ItemSelectionMode, order S _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -723,7 +731,7 @@ func (this *QGraphicsScene) Items23(rect *QRectF, mode ItemSelectionMode) []*QGr _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -734,7 +742,7 @@ func (this *QGraphicsScene) Items32(rect *QRectF, mode ItemSelectionMode, order _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -745,7 +753,7 @@ func (this *QGraphicsScene) Items42(rect *QRectF, mode ItemSelectionMode, order _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -756,7 +764,7 @@ func (this *QGraphicsScene) Items25(path *QPainterPath, mode ItemSelectionMode) _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -767,7 +775,7 @@ func (this *QGraphicsScene) Items34(path *QPainterPath, mode ItemSelectionMode, _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -778,7 +786,7 @@ func (this *QGraphicsScene) Items44(path *QPainterPath, mode ItemSelectionMode, _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -789,7 +797,7 @@ func (this *QGraphicsScene) CollidingItems2(item *QGraphicsItem, mode ItemSelect _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -800,7 +808,7 @@ func (this *QGraphicsScene) Items7(x float64, y float64, w float64, h float64, m _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -823,67 +831,67 @@ func (this *QGraphicsScene) SetSelectionArea4(path *QPainterPath, selectionOpera } func (this *QGraphicsScene) AddEllipse22(rect *QRectF, pen *QPen) *QGraphicsEllipseItem { - return newQGraphicsEllipseItem_U(unsafe.Pointer(C.QGraphicsScene_AddEllipse22(this.h, rect.cPointer(), pen.cPointer()))) + return UnsafeNewQGraphicsEllipseItem(unsafe.Pointer(C.QGraphicsScene_AddEllipse22(this.h, rect.cPointer(), pen.cPointer()))) } func (this *QGraphicsScene) AddEllipse3(rect *QRectF, pen *QPen, brush *QBrush) *QGraphicsEllipseItem { - return newQGraphicsEllipseItem_U(unsafe.Pointer(C.QGraphicsScene_AddEllipse3(this.h, rect.cPointer(), pen.cPointer(), brush.cPointer()))) + return UnsafeNewQGraphicsEllipseItem(unsafe.Pointer(C.QGraphicsScene_AddEllipse3(this.h, rect.cPointer(), pen.cPointer(), brush.cPointer()))) } func (this *QGraphicsScene) AddLine22(line *QLineF, pen *QPen) *QGraphicsLineItem { - return newQGraphicsLineItem_U(unsafe.Pointer(C.QGraphicsScene_AddLine22(this.h, line.cPointer(), pen.cPointer()))) + return UnsafeNewQGraphicsLineItem(unsafe.Pointer(C.QGraphicsScene_AddLine22(this.h, line.cPointer(), pen.cPointer()))) } func (this *QGraphicsScene) AddPath2(path *QPainterPath, pen *QPen) *QGraphicsPathItem { - return newQGraphicsPathItem_U(unsafe.Pointer(C.QGraphicsScene_AddPath2(this.h, path.cPointer(), pen.cPointer()))) + return UnsafeNewQGraphicsPathItem(unsafe.Pointer(C.QGraphicsScene_AddPath2(this.h, path.cPointer(), pen.cPointer()))) } func (this *QGraphicsScene) AddPath3(path *QPainterPath, pen *QPen, brush *QBrush) *QGraphicsPathItem { - return newQGraphicsPathItem_U(unsafe.Pointer(C.QGraphicsScene_AddPath3(this.h, path.cPointer(), pen.cPointer(), brush.cPointer()))) + return UnsafeNewQGraphicsPathItem(unsafe.Pointer(C.QGraphicsScene_AddPath3(this.h, path.cPointer(), pen.cPointer(), brush.cPointer()))) } func (this *QGraphicsScene) AddRect22(rect *QRectF, pen *QPen) *QGraphicsRectItem { - return newQGraphicsRectItem_U(unsafe.Pointer(C.QGraphicsScene_AddRect22(this.h, rect.cPointer(), pen.cPointer()))) + return UnsafeNewQGraphicsRectItem(unsafe.Pointer(C.QGraphicsScene_AddRect22(this.h, rect.cPointer(), pen.cPointer()))) } func (this *QGraphicsScene) AddRect3(rect *QRectF, pen *QPen, brush *QBrush) *QGraphicsRectItem { - return newQGraphicsRectItem_U(unsafe.Pointer(C.QGraphicsScene_AddRect3(this.h, rect.cPointer(), pen.cPointer(), brush.cPointer()))) + return UnsafeNewQGraphicsRectItem(unsafe.Pointer(C.QGraphicsScene_AddRect3(this.h, rect.cPointer(), pen.cPointer(), brush.cPointer()))) } func (this *QGraphicsScene) AddText2(text string, font *QFont) *QGraphicsTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQGraphicsTextItem_U(unsafe.Pointer(C.QGraphicsScene_AddText2(this.h, (*C.struct_miqt_string)(text_ms), font.cPointer()))) + return UnsafeNewQGraphicsTextItem(unsafe.Pointer(C.QGraphicsScene_AddText2(this.h, (*C.struct_miqt_string)(text_ms), font.cPointer()))) } func (this *QGraphicsScene) AddSimpleText2(text string, font *QFont) *QGraphicsSimpleTextItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQGraphicsSimpleTextItem_U(unsafe.Pointer(C.QGraphicsScene_AddSimpleText2(this.h, (*C.struct_miqt_string)(text_ms), font.cPointer()))) + return UnsafeNewQGraphicsSimpleTextItem(unsafe.Pointer(C.QGraphicsScene_AddSimpleText2(this.h, (*C.struct_miqt_string)(text_ms), font.cPointer()))) } func (this *QGraphicsScene) AddWidget2(widget *QWidget, wFlags WindowType) *QGraphicsProxyWidget { - return newQGraphicsProxyWidget_U(unsafe.Pointer(C.QGraphicsScene_AddWidget2(this.h, widget.cPointer(), (C.int)(wFlags)))) + return UnsafeNewQGraphicsProxyWidget(unsafe.Pointer(C.QGraphicsScene_AddWidget2(this.h, widget.cPointer(), (C.int)(wFlags)))) } func (this *QGraphicsScene) AddEllipse5(x float64, y float64, w float64, h float64, pen *QPen) *QGraphicsEllipseItem { - return newQGraphicsEllipseItem_U(unsafe.Pointer(C.QGraphicsScene_AddEllipse5(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer()))) + return UnsafeNewQGraphicsEllipseItem(unsafe.Pointer(C.QGraphicsScene_AddEllipse5(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer()))) } func (this *QGraphicsScene) AddEllipse6(x float64, y float64, w float64, h float64, pen *QPen, brush *QBrush) *QGraphicsEllipseItem { - return newQGraphicsEllipseItem_U(unsafe.Pointer(C.QGraphicsScene_AddEllipse6(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer(), brush.cPointer()))) + return UnsafeNewQGraphicsEllipseItem(unsafe.Pointer(C.QGraphicsScene_AddEllipse6(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer(), brush.cPointer()))) } func (this *QGraphicsScene) AddLine5(x1 float64, y1 float64, x2 float64, y2 float64, pen *QPen) *QGraphicsLineItem { - return newQGraphicsLineItem_U(unsafe.Pointer(C.QGraphicsScene_AddLine5(this.h, (C.double)(x1), (C.double)(y1), (C.double)(x2), (C.double)(y2), pen.cPointer()))) + return UnsafeNewQGraphicsLineItem(unsafe.Pointer(C.QGraphicsScene_AddLine5(this.h, (C.double)(x1), (C.double)(y1), (C.double)(x2), (C.double)(y2), pen.cPointer()))) } func (this *QGraphicsScene) AddRect5(x float64, y float64, w float64, h float64, pen *QPen) *QGraphicsRectItem { - return newQGraphicsRectItem_U(unsafe.Pointer(C.QGraphicsScene_AddRect5(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer()))) + return UnsafeNewQGraphicsRectItem(unsafe.Pointer(C.QGraphicsScene_AddRect5(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer()))) } func (this *QGraphicsScene) AddRect6(x float64, y float64, w float64, h float64, pen *QPen, brush *QBrush) *QGraphicsRectItem { - return newQGraphicsRectItem_U(unsafe.Pointer(C.QGraphicsScene_AddRect6(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer(), brush.cPointer()))) + return UnsafeNewQGraphicsRectItem(unsafe.Pointer(C.QGraphicsScene_AddRect6(this.h, (C.double)(x), (C.double)(y), (C.double)(w), (C.double)(h), pen.cPointer(), brush.cPointer()))) } func (this *QGraphicsScene) SetFocusItem2(item *QGraphicsItem, focusReason FocusReason) { diff --git a/qt/gen_qgraphicsscene.h b/qt/gen_qgraphicsscene.h index 6dac21ba..82ce07a4 100644 --- a/qt/gen_qgraphicsscene.h +++ b/qt/gen_qgraphicsscene.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicssceneevent.cpp b/qt/gen_qgraphicssceneevent.cpp index 86da562a..6c836da8 100644 --- a/qt/gen_qgraphicssceneevent.cpp +++ b/qt/gen_qgraphicssceneevent.cpp @@ -12,7 +12,7 @@ #include #include #include -#include "qgraphicssceneevent.h" +#include #include "gen_qgraphicssceneevent.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicssceneevent.go b/qt/gen_qgraphicssceneevent.go index 6c8553ad..a6c1f76b 100644 --- a/qt/gen_qgraphicssceneevent.go +++ b/qt/gen_qgraphicssceneevent.go @@ -33,14 +33,21 @@ func (this *QGraphicsSceneEvent) cPointer() *C.QGraphicsSceneEvent { return this.h } +func (this *QGraphicsSceneEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneEvent(h *C.QGraphicsSceneEvent) *QGraphicsSceneEvent { if h == nil { return nil } - return &QGraphicsSceneEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneEvent_U(h unsafe.Pointer) *QGraphicsSceneEvent { +func UnsafeNewQGraphicsSceneEvent(h unsafe.Pointer) *QGraphicsSceneEvent { return newQGraphicsSceneEvent((*C.QGraphicsSceneEvent)(h)) } @@ -51,7 +58,7 @@ func NewQGraphicsSceneEvent(typeVal QEvent__Type) *QGraphicsSceneEvent { } func (this *QGraphicsSceneEvent) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QGraphicsSceneEvent_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QGraphicsSceneEvent_Widget(this.h))) } func (this *QGraphicsSceneEvent) SetWidget(widget *QWidget) { @@ -84,14 +91,21 @@ func (this *QGraphicsSceneMouseEvent) cPointer() *C.QGraphicsSceneMouseEvent { return this.h } +func (this *QGraphicsSceneMouseEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneMouseEvent(h *C.QGraphicsSceneMouseEvent) *QGraphicsSceneMouseEvent { if h == nil { return nil } - return &QGraphicsSceneMouseEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneMouseEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneMouseEvent_U(h unsafe.Pointer) *QGraphicsSceneMouseEvent { +func UnsafeNewQGraphicsSceneMouseEvent(h unsafe.Pointer) *QGraphicsSceneMouseEvent { return newQGraphicsSceneMouseEvent((*C.QGraphicsSceneMouseEvent)(h)) } @@ -272,14 +286,21 @@ func (this *QGraphicsSceneWheelEvent) cPointer() *C.QGraphicsSceneWheelEvent { return this.h } +func (this *QGraphicsSceneWheelEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneWheelEvent(h *C.QGraphicsSceneWheelEvent) *QGraphicsSceneWheelEvent { if h == nil { return nil } - return &QGraphicsSceneWheelEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneWheelEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneWheelEvent_U(h unsafe.Pointer) *QGraphicsSceneWheelEvent { +func UnsafeNewQGraphicsSceneWheelEvent(h unsafe.Pointer) *QGraphicsSceneWheelEvent { return newQGraphicsSceneWheelEvent((*C.QGraphicsSceneWheelEvent)(h)) } @@ -386,14 +407,21 @@ func (this *QGraphicsSceneContextMenuEvent) cPointer() *C.QGraphicsSceneContextM return this.h } +func (this *QGraphicsSceneContextMenuEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneContextMenuEvent(h *C.QGraphicsSceneContextMenuEvent) *QGraphicsSceneContextMenuEvent { if h == nil { return nil } - return &QGraphicsSceneContextMenuEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneContextMenuEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneContextMenuEvent_U(h unsafe.Pointer) *QGraphicsSceneContextMenuEvent { +func UnsafeNewQGraphicsSceneContextMenuEvent(h unsafe.Pointer) *QGraphicsSceneContextMenuEvent { return newQGraphicsSceneContextMenuEvent((*C.QGraphicsSceneContextMenuEvent)(h)) } @@ -484,14 +512,21 @@ func (this *QGraphicsSceneHoverEvent) cPointer() *C.QGraphicsSceneHoverEvent { return this.h } +func (this *QGraphicsSceneHoverEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneHoverEvent(h *C.QGraphicsSceneHoverEvent) *QGraphicsSceneHoverEvent { if h == nil { return nil } - return &QGraphicsSceneHoverEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneHoverEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneHoverEvent_U(h unsafe.Pointer) *QGraphicsSceneHoverEvent { +func UnsafeNewQGraphicsSceneHoverEvent(h unsafe.Pointer) *QGraphicsSceneHoverEvent { return newQGraphicsSceneHoverEvent((*C.QGraphicsSceneHoverEvent)(h)) } @@ -607,14 +642,21 @@ func (this *QGraphicsSceneHelpEvent) cPointer() *C.QGraphicsSceneHelpEvent { return this.h } +func (this *QGraphicsSceneHelpEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneHelpEvent(h *C.QGraphicsSceneHelpEvent) *QGraphicsSceneHelpEvent { if h == nil { return nil } - return &QGraphicsSceneHelpEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneHelpEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneHelpEvent_U(h unsafe.Pointer) *QGraphicsSceneHelpEvent { +func UnsafeNewQGraphicsSceneHelpEvent(h unsafe.Pointer) *QGraphicsSceneHelpEvent { return newQGraphicsSceneHelpEvent((*C.QGraphicsSceneHelpEvent)(h)) } @@ -678,14 +720,21 @@ func (this *QGraphicsSceneDragDropEvent) cPointer() *C.QGraphicsSceneDragDropEve return this.h } +func (this *QGraphicsSceneDragDropEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneDragDropEvent(h *C.QGraphicsSceneDragDropEvent) *QGraphicsSceneDragDropEvent { if h == nil { return nil } - return &QGraphicsSceneDragDropEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneDragDropEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneDragDropEvent_U(h unsafe.Pointer) *QGraphicsSceneDragDropEvent { +func UnsafeNewQGraphicsSceneDragDropEvent(h unsafe.Pointer) *QGraphicsSceneDragDropEvent { return newQGraphicsSceneDragDropEvent((*C.QGraphicsSceneDragDropEvent)(h)) } @@ -779,7 +828,7 @@ func (this *QGraphicsSceneDragDropEvent) SetDropAction(action DropAction) { } func (this *QGraphicsSceneDragDropEvent) Source() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QGraphicsSceneDragDropEvent_Source(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QGraphicsSceneDragDropEvent_Source(this.h))) } func (this *QGraphicsSceneDragDropEvent) SetSource(source *QWidget) { @@ -787,7 +836,7 @@ func (this *QGraphicsSceneDragDropEvent) SetSource(source *QWidget) { } func (this *QGraphicsSceneDragDropEvent) MimeData() *QMimeData { - return newQMimeData_U(unsafe.Pointer(C.QGraphicsSceneDragDropEvent_MimeData(this.h))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QGraphicsSceneDragDropEvent_MimeData(this.h))) } func (this *QGraphicsSceneDragDropEvent) SetMimeData(data *QMimeData) { @@ -820,14 +869,21 @@ func (this *QGraphicsSceneResizeEvent) cPointer() *C.QGraphicsSceneResizeEvent { return this.h } +func (this *QGraphicsSceneResizeEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneResizeEvent(h *C.QGraphicsSceneResizeEvent) *QGraphicsSceneResizeEvent { if h == nil { return nil } - return &QGraphicsSceneResizeEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneResizeEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneResizeEvent_U(h unsafe.Pointer) *QGraphicsSceneResizeEvent { +func UnsafeNewQGraphicsSceneResizeEvent(h unsafe.Pointer) *QGraphicsSceneResizeEvent { return newQGraphicsSceneResizeEvent((*C.QGraphicsSceneResizeEvent)(h)) } @@ -885,14 +941,21 @@ func (this *QGraphicsSceneMoveEvent) cPointer() *C.QGraphicsSceneMoveEvent { return this.h } +func (this *QGraphicsSceneMoveEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsSceneMoveEvent(h *C.QGraphicsSceneMoveEvent) *QGraphicsSceneMoveEvent { if h == nil { return nil } - return &QGraphicsSceneMoveEvent{h: h, QGraphicsSceneEvent: newQGraphicsSceneEvent_U(unsafe.Pointer(h))} + return &QGraphicsSceneMoveEvent{h: h, QGraphicsSceneEvent: UnsafeNewQGraphicsSceneEvent(unsafe.Pointer(h))} } -func newQGraphicsSceneMoveEvent_U(h unsafe.Pointer) *QGraphicsSceneMoveEvent { +func UnsafeNewQGraphicsSceneMoveEvent(h unsafe.Pointer) *QGraphicsSceneMoveEvent { return newQGraphicsSceneMoveEvent((*C.QGraphicsSceneMoveEvent)(h)) } diff --git a/qt/gen_qgraphicssceneevent.h b/qt/gen_qgraphicssceneevent.h index a0e20a0e..9654bb6e 100644 --- a/qt/gen_qgraphicssceneevent.h +++ b/qt/gen_qgraphicssceneevent.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicstransform.cpp b/qt/gen_qgraphicstransform.cpp index d14bf27d..c1fe5f1a 100644 --- a/qt/gen_qgraphicstransform.cpp +++ b/qt/gen_qgraphicstransform.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qgraphicstransform.h" +#include #include "gen_qgraphicstransform.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicstransform.go b/qt/gen_qgraphicstransform.go index 9c3fa517..c6a61cfa 100644 --- a/qt/gen_qgraphicstransform.go +++ b/qt/gen_qgraphicstransform.go @@ -26,19 +26,26 @@ func (this *QGraphicsTransform) cPointer() *C.QGraphicsTransform { return this.h } +func (this *QGraphicsTransform) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsTransform(h *C.QGraphicsTransform) *QGraphicsTransform { if h == nil { return nil } - return &QGraphicsTransform{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QGraphicsTransform{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQGraphicsTransform_U(h unsafe.Pointer) *QGraphicsTransform { +func UnsafeNewQGraphicsTransform(h unsafe.Pointer) *QGraphicsTransform { return newQGraphicsTransform((*C.QGraphicsTransform)(h)) } func (this *QGraphicsTransform) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsTransform_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsTransform_MetaObject(this.h))) } func (this *QGraphicsTransform) Metacast(param1 string) unsafe.Pointer { @@ -139,14 +146,21 @@ func (this *QGraphicsScale) cPointer() *C.QGraphicsScale { return this.h } +func (this *QGraphicsScale) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsScale(h *C.QGraphicsScale) *QGraphicsScale { if h == nil { return nil } - return &QGraphicsScale{h: h, QGraphicsTransform: newQGraphicsTransform_U(unsafe.Pointer(h))} + return &QGraphicsScale{h: h, QGraphicsTransform: UnsafeNewQGraphicsTransform(unsafe.Pointer(h))} } -func newQGraphicsScale_U(h unsafe.Pointer) *QGraphicsScale { +func UnsafeNewQGraphicsScale(h unsafe.Pointer) *QGraphicsScale { return newQGraphicsScale((*C.QGraphicsScale)(h)) } @@ -163,7 +177,7 @@ func NewQGraphicsScale2(parent *QObject) *QGraphicsScale { } func (this *QGraphicsScale) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsScale_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsScale_MetaObject(this.h))) } func (this *QGraphicsScale) Metacast(param1 string) unsafe.Pointer { @@ -384,14 +398,21 @@ func (this *QGraphicsRotation) cPointer() *C.QGraphicsRotation { return this.h } +func (this *QGraphicsRotation) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsRotation(h *C.QGraphicsRotation) *QGraphicsRotation { if h == nil { return nil } - return &QGraphicsRotation{h: h, QGraphicsTransform: newQGraphicsTransform_U(unsafe.Pointer(h))} + return &QGraphicsRotation{h: h, QGraphicsTransform: UnsafeNewQGraphicsTransform(unsafe.Pointer(h))} } -func newQGraphicsRotation_U(h unsafe.Pointer) *QGraphicsRotation { +func UnsafeNewQGraphicsRotation(h unsafe.Pointer) *QGraphicsRotation { return newQGraphicsRotation((*C.QGraphicsRotation)(h)) } @@ -408,7 +429,7 @@ func NewQGraphicsRotation2(parent *QObject) *QGraphicsRotation { } func (this *QGraphicsRotation) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsRotation_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsRotation_MetaObject(this.h))) } func (this *QGraphicsRotation) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qgraphicstransform.h b/qt/gen_qgraphicstransform.h index 91d7bc6c..1fa9be14 100644 --- a/qt/gen_qgraphicstransform.h +++ b/qt/gen_qgraphicstransform.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicsview.cpp b/qt/gen_qgraphicsview.cpp index 70a7f8ca..1f417151 100644 --- a/qt/gen_qgraphicsview.cpp +++ b/qt/gen_qgraphicsview.cpp @@ -18,7 +18,7 @@ #include #include #include -#include "qgraphicsview.h" +#include #include "gen_qgraphicsview.h" #include "_cgo_export.h" diff --git a/qt/gen_qgraphicsview.go b/qt/gen_qgraphicsview.go index aaffbd86..cb5a5d37 100644 --- a/qt/gen_qgraphicsview.go +++ b/qt/gen_qgraphicsview.go @@ -68,14 +68,21 @@ func (this *QGraphicsView) cPointer() *C.QGraphicsView { return this.h } +func (this *QGraphicsView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsView(h *C.QGraphicsView) *QGraphicsView { if h == nil { return nil } - return &QGraphicsView{h: h, QAbstractScrollArea: newQAbstractScrollArea_U(unsafe.Pointer(h))} + return &QGraphicsView{h: h, QAbstractScrollArea: UnsafeNewQAbstractScrollArea(unsafe.Pointer(h))} } -func newQGraphicsView_U(h unsafe.Pointer) *QGraphicsView { +func UnsafeNewQGraphicsView(h unsafe.Pointer) *QGraphicsView { return newQGraphicsView((*C.QGraphicsView)(h)) } @@ -104,7 +111,7 @@ func NewQGraphicsView4(scene *QGraphicsScene, parent *QWidget) *QGraphicsView { } func (this *QGraphicsView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsView_MetaObject(this.h))) } func (this *QGraphicsView) Metacast(param1 string) unsafe.Pointer { @@ -238,7 +245,7 @@ func (this *QGraphicsView) SetInteractive(allowed bool) { } func (this *QGraphicsView) Scene() *QGraphicsScene { - return newQGraphicsScene_U(unsafe.Pointer(C.QGraphicsView_Scene(this.h))) + return UnsafeNewQGraphicsScene(unsafe.Pointer(C.QGraphicsView_Scene(this.h))) } func (this *QGraphicsView) SetScene(scene *QGraphicsScene) { @@ -362,7 +369,7 @@ func (this *QGraphicsView) Items() []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -373,7 +380,7 @@ func (this *QGraphicsView) ItemsWithPos(pos *QPoint) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -384,7 +391,7 @@ func (this *QGraphicsView) Items2(x int, y int) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -395,7 +402,7 @@ func (this *QGraphicsView) ItemsWithRect(rect *QRect) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -406,7 +413,7 @@ func (this *QGraphicsView) Items3(x int, y int, w int, h int) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -417,18 +424,18 @@ func (this *QGraphicsView) ItemsWithPath(path *QPainterPath) []*QGraphicsItem { _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QGraphicsView) ItemAt(pos *QPoint) *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsView_ItemAt(this.h, pos.cPointer()))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsView_ItemAt(this.h, pos.cPointer()))) } func (this *QGraphicsView) ItemAt2(x int, y int) *QGraphicsItem { - return newQGraphicsItem_U(unsafe.Pointer(C.QGraphicsView_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQGraphicsItem(unsafe.Pointer(C.QGraphicsView_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) } func (this *QGraphicsView) MapToScene(point *QPoint) *QPointF { @@ -668,7 +675,7 @@ func (this *QGraphicsView) Items22(rect *QRect, mode ItemSelectionMode) []*QGrap _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -679,7 +686,7 @@ func (this *QGraphicsView) Items5(x int, y int, w int, h int, mode ItemSelection _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -690,7 +697,7 @@ func (this *QGraphicsView) Items24(path *QPainterPath, mode ItemSelectionMode) [ _ret := make([]*QGraphicsItem, int(_ma.len)) _outCast := (*[0xffff]*C.QGraphicsItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQGraphicsItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQGraphicsItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret diff --git a/qt/gen_qgraphicsview.h b/qt/gen_qgraphicsview.h index 398825e2..5158fb49 100644 --- a/qt/gen_qgraphicsview.h +++ b/qt/gen_qgraphicsview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgraphicswidget.cpp b/qt/gen_qgraphicswidget.cpp index b8aa317e..432a165b 100644 --- a/qt/gen_qgraphicswidget.cpp +++ b/qt/gen_qgraphicswidget.cpp @@ -18,7 +18,7 @@ #include #include #include -#include "qgraphicswidget.h" +#include #include "gen_qgraphicswidget.h" #include "_cgo_export.h" @@ -241,7 +241,7 @@ void QGraphicsWidget_AddAction(QGraphicsWidget* self, QAction* action) { } void QGraphicsWidget_AddActions(QGraphicsWidget* self, struct miqt_array* /* of QAction* */ actions) { - QList actions_QList; + QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { @@ -251,7 +251,7 @@ void QGraphicsWidget_AddActions(QGraphicsWidget* self, struct miqt_array* /* of } void QGraphicsWidget_InsertActions(QGraphicsWidget* self, QAction* before, struct miqt_array* /* of QAction* */ actions) { - QList actions_QList; + QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { diff --git a/qt/gen_qgraphicswidget.go b/qt/gen_qgraphicswidget.go index 93ccea72..41662dca 100644 --- a/qt/gen_qgraphicswidget.go +++ b/qt/gen_qgraphicswidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -33,14 +34,21 @@ func (this *QGraphicsWidget) cPointer() *C.QGraphicsWidget { return this.h } +func (this *QGraphicsWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGraphicsWidget(h *C.QGraphicsWidget) *QGraphicsWidget { if h == nil { return nil } - return &QGraphicsWidget{h: h, QGraphicsObject: newQGraphicsObject_U(unsafe.Pointer(h)), QGraphicsLayoutItem: newQGraphicsLayoutItem_U(unsafe.Pointer(h))} + return &QGraphicsWidget{h: h, QGraphicsObject: UnsafeNewQGraphicsObject(unsafe.Pointer(h)), QGraphicsLayoutItem: UnsafeNewQGraphicsLayoutItem(unsafe.Pointer(h))} } -func newQGraphicsWidget_U(h unsafe.Pointer) *QGraphicsWidget { +func UnsafeNewQGraphicsWidget(h unsafe.Pointer) *QGraphicsWidget { return newQGraphicsWidget((*C.QGraphicsWidget)(h)) } @@ -63,7 +71,7 @@ func NewQGraphicsWidget3(parent *QGraphicsItem, wFlags WindowType) *QGraphicsWid } func (this *QGraphicsWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGraphicsWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGraphicsWidget_MetaObject(this.h))) } func (this *QGraphicsWidget) Metacast(param1 string) unsafe.Pointer { @@ -91,7 +99,7 @@ func QGraphicsWidget_TrUtf8(s string) string { } func (this *QGraphicsWidget) Layout() *QGraphicsLayout { - return newQGraphicsLayout_U(unsafe.Pointer(C.QGraphicsWidget_Layout(this.h))) + return UnsafeNewQGraphicsLayout(unsafe.Pointer(C.QGraphicsWidget_Layout(this.h))) } func (this *QGraphicsWidget) SetLayout(layout *QGraphicsLayout) { @@ -115,7 +123,7 @@ func (this *QGraphicsWidget) UnsetLayoutDirection() { } func (this *QGraphicsWidget) Style() *QStyle { - return newQStyle_U(unsafe.Pointer(C.QGraphicsWidget_Style(this.h))) + return UnsafeNewQStyle(unsafe.Pointer(C.QGraphicsWidget_Style(this.h))) } func (this *QGraphicsWidget) SetStyle(style *QStyle) { @@ -241,7 +249,7 @@ func (this *QGraphicsWidget) IsActiveWindow() bool { } func (this *QGraphicsWidget) SetWindowTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QGraphicsWidget_SetWindowTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -266,7 +274,7 @@ func QGraphicsWidget_SetTabOrder(first *QGraphicsWidget, second *QGraphicsWidget } func (this *QGraphicsWidget) FocusWidget() *QGraphicsWidget { - return newQGraphicsWidget_U(unsafe.Pointer(C.QGraphicsWidget_FocusWidget(this.h))) + return UnsafeNewQGraphicsWidget(unsafe.Pointer(C.QGraphicsWidget_FocusWidget(this.h))) } func (this *QGraphicsWidget) GrabShortcut(sequence *QKeySequence) int { @@ -326,7 +334,7 @@ func (this *QGraphicsWidget) Actions() []*QAction { _ret := make([]*QAction, int(_ma.len)) _outCast := (*[0xffff]*C.QAction)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAction_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAction(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret diff --git a/qt/gen_qgraphicswidget.h b/qt/gen_qgraphicswidget.h index 6040558b..f4337d58 100644 --- a/qt/gen_qgraphicswidget.h +++ b/qt/gen_qgraphicswidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgridlayout.cpp b/qt/gen_qgridlayout.cpp index 981e5f4d..2054d241 100644 --- a/qt/gen_qgridlayout.cpp +++ b/qt/gen_qgridlayout.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qgridlayout.h" +#include #include "gen_qgridlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qgridlayout.go b/qt/gen_qgridlayout.go index 27e0b51f..aa1649c4 100644 --- a/qt/gen_qgridlayout.go +++ b/qt/gen_qgridlayout.go @@ -25,14 +25,21 @@ func (this *QGridLayout) cPointer() *C.QGridLayout { return this.h } +func (this *QGridLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGridLayout(h *C.QGridLayout) *QGridLayout { if h == nil { return nil } - return &QGridLayout{h: h, QLayout: newQLayout_U(unsafe.Pointer(h))} + return &QGridLayout{h: h, QLayout: UnsafeNewQLayout(unsafe.Pointer(h))} } -func newQGridLayout_U(h unsafe.Pointer) *QGridLayout { +func UnsafeNewQGridLayout(h unsafe.Pointer) *QGridLayout { return newQGridLayout((*C.QGridLayout)(h)) } @@ -49,7 +56,7 @@ func NewQGridLayout2() *QGridLayout { } func (this *QGridLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGridLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGridLayout_MetaObject(this.h))) } func (this *QGridLayout) Metacast(param1 string) unsafe.Pointer { @@ -217,15 +224,15 @@ func (this *QGridLayout) OriginCorner() Corner { } func (this *QGridLayout) ItemAt(index int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QGridLayout_ItemAt(this.h, (C.int)(index)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QGridLayout_ItemAt(this.h, (C.int)(index)))) } func (this *QGridLayout) ItemAtPosition(row int, column int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QGridLayout_ItemAtPosition(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QGridLayout_ItemAtPosition(this.h, (C.int)(row), (C.int)(column)))) } func (this *QGridLayout) TakeAt(index int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QGridLayout_TakeAt(this.h, (C.int)(index)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QGridLayout_TakeAt(this.h, (C.int)(index)))) } func (this *QGridLayout) Count() int { diff --git a/qt/gen_qgridlayout.h b/qt/gen_qgridlayout.h index f2ff61cb..5160112e 100644 --- a/qt/gen_qgridlayout.h +++ b/qt/gen_qgridlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qgroupbox.cpp b/qt/gen_qgroupbox.cpp index d6fbf1be..70c84bec 100644 --- a/qt/gen_qgroupbox.cpp +++ b/qt/gen_qgroupbox.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qgroupbox.h" +#include #include "gen_qgroupbox.h" #include "_cgo_export.h" diff --git a/qt/gen_qgroupbox.go b/qt/gen_qgroupbox.go index d72545d9..676a55cd 100644 --- a/qt/gen_qgroupbox.go +++ b/qt/gen_qgroupbox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QGroupBox) cPointer() *C.QGroupBox { return this.h } +func (this *QGroupBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGroupBox(h *C.QGroupBox) *QGroupBox { if h == nil { return nil } - return &QGroupBox{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QGroupBox{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQGroupBox_U(h unsafe.Pointer) *QGroupBox { +func UnsafeNewQGroupBox(h unsafe.Pointer) *QGroupBox { return newQGroupBox((*C.QGroupBox)(h)) } @@ -45,7 +53,7 @@ func NewQGroupBox() *QGroupBox { // NewQGroupBox2 constructs a new QGroupBox object. func NewQGroupBox2(title string) *QGroupBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QGroupBox_new2((*C.struct_miqt_string)(title_ms)) return newQGroupBox(ret) @@ -59,14 +67,14 @@ func NewQGroupBox3(parent *QWidget) *QGroupBox { // NewQGroupBox4 constructs a new QGroupBox object. func NewQGroupBox4(title string, parent *QWidget) *QGroupBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QGroupBox_new4((*C.struct_miqt_string)(title_ms), parent.cPointer()) return newQGroupBox(ret) } func (this *QGroupBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGroupBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGroupBox_MetaObject(this.h))) } func (this *QGroupBox) Metacast(param1 string) unsafe.Pointer { @@ -101,7 +109,7 @@ func (this *QGroupBox) Title() string { } func (this *QGroupBox) SetTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QGroupBox_SetTitle(this.h, (*C.struct_miqt_string)(title_ms)) } diff --git a/qt/gen_qgroupbox.h b/qt/gen_qgroupbox.h index b5697ba2..461b62ce 100644 --- a/qt/gen_qgroupbox.h +++ b/qt/gen_qgroupbox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qguiapplication.cpp b/qt/gen_qguiapplication.cpp index 8260e832..66c186de 100644 --- a/qt/gen_qguiapplication.cpp +++ b/qt/gen_qguiapplication.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "qguiapplication.h" +#include #include "gen_qguiapplication.h" #include "_cgo_export.h" diff --git a/qt/gen_qguiapplication.go b/qt/gen_qguiapplication.go index 65522c1d..44b299b1 100644 --- a/qt/gen_qguiapplication.go +++ b/qt/gen_qguiapplication.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QGuiApplication) cPointer() *C.QGuiApplication { return this.h } +func (this *QGuiApplication) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGuiApplication(h *C.QGuiApplication) *QGuiApplication { if h == nil { return nil } - return &QGuiApplication{h: h, QCoreApplication: newQCoreApplication_U(unsafe.Pointer(h))} + return &QGuiApplication{h: h, QCoreApplication: UnsafeNewQCoreApplication(unsafe.Pointer(h))} } -func newQGuiApplication_U(h unsafe.Pointer) *QGuiApplication { +func UnsafeNewQGuiApplication(h unsafe.Pointer) *QGuiApplication { return newQGuiApplication((*C.QGuiApplication)(h)) } @@ -64,7 +72,7 @@ func NewQGuiApplication2(args []string, param3 int) *QGuiApplication { } func (this *QGuiApplication) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QGuiApplication_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QGuiApplication_MetaObject(this.h))) } func (this *QGuiApplication) Metacast(param1 string) unsafe.Pointer { @@ -92,7 +100,7 @@ func QGuiApplication_TrUtf8(s string) string { } func QGuiApplication_SetApplicationDisplayName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QGuiApplication_SetApplicationDisplayName((*C.struct_miqt_string)(name_ms)) } @@ -105,7 +113,7 @@ func QGuiApplication_ApplicationDisplayName() string { } func QGuiApplication_SetDesktopFileName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QGuiApplication_SetDesktopFileName((*C.struct_miqt_string)(name_ms)) } @@ -122,7 +130,7 @@ func QGuiApplication_AllWindows() []*QWindow { _ret := make([]*QWindow, int(_ma.len)) _outCast := (*[0xffff]*C.QWindow)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQWindow_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQWindow(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -133,14 +141,14 @@ func QGuiApplication_TopLevelWindows() []*QWindow { _ret := make([]*QWindow, int(_ma.len)) _outCast := (*[0xffff]*C.QWindow)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQWindow_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQWindow(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func QGuiApplication_TopLevelAt(pos *QPoint) *QWindow { - return newQWindow_U(unsafe.Pointer(C.QGuiApplication_TopLevelAt(pos.cPointer()))) + return UnsafeNewQWindow(unsafe.Pointer(C.QGuiApplication_TopLevelAt(pos.cPointer()))) } func QGuiApplication_SetWindowIcon(icon *QIcon) { @@ -162,19 +170,19 @@ func QGuiApplication_PlatformName() string { } func QGuiApplication_ModalWindow() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QGuiApplication_ModalWindow())) + return UnsafeNewQWindow(unsafe.Pointer(C.QGuiApplication_ModalWindow())) } func QGuiApplication_FocusWindow() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QGuiApplication_FocusWindow())) + return UnsafeNewQWindow(unsafe.Pointer(C.QGuiApplication_FocusWindow())) } func QGuiApplication_FocusObject() *QObject { - return newQObject_U(unsafe.Pointer(C.QGuiApplication_FocusObject())) + return UnsafeNewQObject(unsafe.Pointer(C.QGuiApplication_FocusObject())) } func QGuiApplication_PrimaryScreen() *QScreen { - return newQScreen_U(unsafe.Pointer(C.QGuiApplication_PrimaryScreen())) + return UnsafeNewQScreen(unsafe.Pointer(C.QGuiApplication_PrimaryScreen())) } func QGuiApplication_Screens() []*QScreen { @@ -182,14 +190,14 @@ func QGuiApplication_Screens() []*QScreen { _ret := make([]*QScreen, int(_ma.len)) _outCast := (*[0xffff]*C.QScreen)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQScreen_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQScreen(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func QGuiApplication_ScreenAt(point *QPoint) *QScreen { - return newQScreen_U(unsafe.Pointer(C.QGuiApplication_ScreenAt(point.cPointer()))) + return UnsafeNewQScreen(unsafe.Pointer(C.QGuiApplication_ScreenAt(point.cPointer()))) } func (this *QGuiApplication) DevicePixelRatio() float64 { @@ -197,7 +205,7 @@ func (this *QGuiApplication) DevicePixelRatio() float64 { } func QGuiApplication_OverrideCursor() *QCursor { - return newQCursor_U(unsafe.Pointer(C.QGuiApplication_OverrideCursor())) + return UnsafeNewQCursor(unsafe.Pointer(C.QGuiApplication_OverrideCursor())) } func QGuiApplication_SetOverrideCursor(overrideCursor *QCursor) { @@ -224,7 +232,7 @@ func QGuiApplication_SetFont(font *QFont) { } func QGuiApplication_Clipboard() *QClipboard { - return newQClipboard_U(unsafe.Pointer(C.QGuiApplication_Clipboard())) + return UnsafeNewQClipboard(unsafe.Pointer(C.QGuiApplication_Clipboard())) } func QGuiApplication_Palette() *QPalette { @@ -267,7 +275,7 @@ func QGuiApplication_IsLeftToRight() bool { } func QGuiApplication_StyleHints() *QStyleHints { - return newQStyleHints_U(unsafe.Pointer(C.QGuiApplication_StyleHints())) + return UnsafeNewQStyleHints(unsafe.Pointer(C.QGuiApplication_StyleHints())) } func QGuiApplication_SetDesktopSettingsAware(on bool) { @@ -279,7 +287,7 @@ func QGuiApplication_DesktopSettingsAware() bool { } func QGuiApplication_InputMethod() *QInputMethod { - return newQInputMethod_U(unsafe.Pointer(C.QGuiApplication_InputMethod())) + return UnsafeNewQInputMethod(unsafe.Pointer(C.QGuiApplication_InputMethod())) } func QGuiApplication_SetQuitOnLastWindowClosed(quit bool) { @@ -376,7 +384,7 @@ func miqt_exec_callback_QGuiApplication_ScreenAdded(cb C.intptr_t, screen *C.QSc } // Convert all CABI parameters to Go parameters - slotval1 := newQScreen_U(unsafe.Pointer(screen)) + slotval1 := UnsafeNewQScreen(unsafe.Pointer(screen)) gofunc(slotval1) } @@ -396,7 +404,7 @@ func miqt_exec_callback_QGuiApplication_ScreenRemoved(cb C.intptr_t, screen *C.Q } // Convert all CABI parameters to Go parameters - slotval1 := newQScreen_U(unsafe.Pointer(screen)) + slotval1 := UnsafeNewQScreen(unsafe.Pointer(screen)) gofunc(slotval1) } @@ -416,7 +424,7 @@ func miqt_exec_callback_QGuiApplication_PrimaryScreenChanged(cb C.intptr_t, scre } // Convert all CABI parameters to Go parameters - slotval1 := newQScreen_U(unsafe.Pointer(screen)) + slotval1 := UnsafeNewQScreen(unsafe.Pointer(screen)) gofunc(slotval1) } @@ -453,7 +461,7 @@ func miqt_exec_callback_QGuiApplication_FocusObjectChanged(cb C.intptr_t, focusO } // Convert all CABI parameters to Go parameters - slotval1 := newQObject_U(unsafe.Pointer(focusObject)) + slotval1 := UnsafeNewQObject(unsafe.Pointer(focusObject)) gofunc(slotval1) } @@ -473,7 +481,7 @@ func miqt_exec_callback_QGuiApplication_FocusWindowChanged(cb C.intptr_t, focusW } // Convert all CABI parameters to Go parameters - slotval1 := newQWindow_U(unsafe.Pointer(focusWindow)) + slotval1 := UnsafeNewQWindow(unsafe.Pointer(focusWindow)) gofunc(slotval1) } @@ -533,7 +541,7 @@ func miqt_exec_callback_QGuiApplication_CommitDataRequest(cb C.intptr_t, session } // Convert all CABI parameters to Go parameters - slotval1 := newQSessionManager_U(unsafe.Pointer(sessionManager)) + slotval1 := UnsafeNewQSessionManager(unsafe.Pointer(sessionManager)) gofunc(slotval1) } @@ -553,7 +561,7 @@ func miqt_exec_callback_QGuiApplication_SaveStateRequest(cb C.intptr_t, sessionM } // Convert all CABI parameters to Go parameters - slotval1 := newQSessionManager_U(unsafe.Pointer(sessionManager)) + slotval1 := UnsafeNewQSessionManager(unsafe.Pointer(sessionManager)) gofunc(slotval1) } @@ -573,7 +581,7 @@ func miqt_exec_callback_QGuiApplication_PaletteChanged(cb C.intptr_t, pal *C.QPa } // Convert all CABI parameters to Go parameters - slotval1 := newQPalette_U(unsafe.Pointer(pal)) + slotval1 := UnsafeNewQPalette(unsafe.Pointer(pal)) gofunc(slotval1) } @@ -610,7 +618,7 @@ func miqt_exec_callback_QGuiApplication_FontChanged(cb C.intptr_t, font *C.QFont } // Convert all CABI parameters to Go parameters - slotval1 := newQFont_U(unsafe.Pointer(font)) + slotval1 := UnsafeNewQFont(unsafe.Pointer(font)) gofunc(slotval1) } diff --git a/qt/gen_qguiapplication.h b/qt/gen_qguiapplication.h index e0ba28b5..9f4868fd 100644 --- a/qt/gen_qguiapplication.h +++ b/qt/gen_qguiapplication.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qhash.cpp b/qt/gen_qhash.cpp index ab1ab846..990920c7 100644 --- a/qt/gen_qhash.cpp +++ b/qt/gen_qhash.cpp @@ -1,7 +1,7 @@ #include #define WORKAROUND_INNER_CLASS_DEFINITION_QHashData__Node #include -#include "qhash.h" +#include #include "gen_qhash.h" #include "_cgo_export.h" diff --git a/qt/gen_qhash.go b/qt/gen_qhash.go index aceb9a01..8d08b6c8 100644 --- a/qt/gen_qhash.go +++ b/qt/gen_qhash.go @@ -24,6 +24,13 @@ func (this *QHashData) cPointer() *C.QHashData { return this.h } +func (this *QHashData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHashData(h *C.QHashData) *QHashData { if h == nil { return nil @@ -31,7 +38,7 @@ func newQHashData(h *C.QHashData) *QHashData { return &QHashData{h: h} } -func newQHashData_U(h unsafe.Pointer) *QHashData { +func UnsafeNewQHashData(h unsafe.Pointer) *QHashData { return newQHashData((*C.QHashData)(h)) } @@ -56,15 +63,15 @@ func (this *QHashData) Rehash(hint int) { } func (this *QHashData) FirstNode() *QHashData__Node { - return newQHashData__Node_U(unsafe.Pointer(C.QHashData_FirstNode(this.h))) + return UnsafeNewQHashData__Node(unsafe.Pointer(C.QHashData_FirstNode(this.h))) } func QHashData_NextNode(node *QHashData__Node) *QHashData__Node { - return newQHashData__Node_U(unsafe.Pointer(C.QHashData_NextNode(node.cPointer()))) + return UnsafeNewQHashData__Node(unsafe.Pointer(C.QHashData_NextNode(node.cPointer()))) } func QHashData_PreviousNode(node *QHashData__Node) *QHashData__Node { - return newQHashData__Node_U(unsafe.Pointer(C.QHashData_PreviousNode(node.cPointer()))) + return UnsafeNewQHashData__Node(unsafe.Pointer(C.QHashData_PreviousNode(node.cPointer()))) } // Delete this object from C++ memory. @@ -92,6 +99,13 @@ func (this *QHashDummyValue) cPointer() *C.QHashDummyValue { return this.h } +func (this *QHashDummyValue) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHashDummyValue(h *C.QHashDummyValue) *QHashDummyValue { if h == nil { return nil @@ -99,7 +113,7 @@ func newQHashDummyValue(h *C.QHashDummyValue) *QHashDummyValue { return &QHashDummyValue{h: h} } -func newQHashDummyValue_U(h unsafe.Pointer) *QHashDummyValue { +func UnsafeNewQHashDummyValue(h unsafe.Pointer) *QHashDummyValue { return newQHashDummyValue((*C.QHashDummyValue)(h)) } @@ -140,6 +154,13 @@ func (this *QHashData__Node) cPointer() *C.QHashData__Node { return this.h } +func (this *QHashData__Node) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHashData__Node(h *C.QHashData__Node) *QHashData__Node { if h == nil { return nil @@ -147,7 +168,7 @@ func newQHashData__Node(h *C.QHashData__Node) *QHashData__Node { return &QHashData__Node{h: h} } -func newQHashData__Node_U(h unsafe.Pointer) *QHashData__Node { +func UnsafeNewQHashData__Node(h unsafe.Pointer) *QHashData__Node { return newQHashData__Node((*C.QHashData__Node)(h)) } diff --git a/qt/gen_qhash.h b/qt/gen_qhash.h index 58388bf1..a0bb7181 100644 --- a/qt/gen_qhash.h +++ b/qt/gen_qhash.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qhashfunctions.cpp b/qt/gen_qhashfunctions.cpp index 6708de02..059c876f 100644 --- a/qt/gen_qhashfunctions.cpp +++ b/qt/gen_qhashfunctions.cpp @@ -1,6 +1,6 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__QHashCombine #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__QHashCombineCommutative -#include "qhashfunctions.h" +#include #include "gen_qhashfunctions.h" #include "_cgo_export.h" diff --git a/qt/gen_qhashfunctions.go b/qt/gen_qhashfunctions.go index e22d6ce5..e1f895e9 100644 --- a/qt/gen_qhashfunctions.go +++ b/qt/gen_qhashfunctions.go @@ -24,6 +24,13 @@ func (this *QtPrivate__QHashCombine) cPointer() *C.QtPrivate__QHashCombine { return this.h } +func (this *QtPrivate__QHashCombine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__QHashCombine(h *C.QtPrivate__QHashCombine) *QtPrivate__QHashCombine { if h == nil { return nil @@ -31,7 +38,7 @@ func newQtPrivate__QHashCombine(h *C.QtPrivate__QHashCombine) *QtPrivate__QHashC return &QtPrivate__QHashCombine{h: h} } -func newQtPrivate__QHashCombine_U(h unsafe.Pointer) *QtPrivate__QHashCombine { +func UnsafeNewQtPrivate__QHashCombine(h unsafe.Pointer) *QtPrivate__QHashCombine { return newQtPrivate__QHashCombine((*C.QtPrivate__QHashCombine)(h)) } @@ -72,6 +79,13 @@ func (this *QtPrivate__QHashCombineCommutative) cPointer() *C.QtPrivate__QHashCo return this.h } +func (this *QtPrivate__QHashCombineCommutative) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__QHashCombineCommutative(h *C.QtPrivate__QHashCombineCommutative) *QtPrivate__QHashCombineCommutative { if h == nil { return nil @@ -79,7 +93,7 @@ func newQtPrivate__QHashCombineCommutative(h *C.QtPrivate__QHashCombineCommutati return &QtPrivate__QHashCombineCommutative{h: h} } -func newQtPrivate__QHashCombineCommutative_U(h unsafe.Pointer) *QtPrivate__QHashCombineCommutative { +func UnsafeNewQtPrivate__QHashCombineCommutative(h unsafe.Pointer) *QtPrivate__QHashCombineCommutative { return newQtPrivate__QHashCombineCommutative((*C.QtPrivate__QHashCombineCommutative)(h)) } diff --git a/qt/gen_qhashfunctions.h b/qt/gen_qhashfunctions.h index 2b39c933..7014441e 100644 --- a/qt/gen_qhashfunctions.h +++ b/qt/gen_qhashfunctions.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qheaderview.cpp b/qt/gen_qheaderview.cpp index cc98bb8d..f90658d7 100644 --- a/qt/gen_qheaderview.cpp +++ b/qt/gen_qheaderview.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qheaderview.h" +#include #include "gen_qheaderview.h" #include "_cgo_export.h" diff --git a/qt/gen_qheaderview.go b/qt/gen_qheaderview.go index 28863dc5..2bc4a55d 100644 --- a/qt/gen_qheaderview.go +++ b/qt/gen_qheaderview.go @@ -36,14 +36,21 @@ func (this *QHeaderView) cPointer() *C.QHeaderView { return this.h } +func (this *QHeaderView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHeaderView(h *C.QHeaderView) *QHeaderView { if h == nil { return nil } - return &QHeaderView{h: h, QAbstractItemView: newQAbstractItemView_U(unsafe.Pointer(h))} + return &QHeaderView{h: h, QAbstractItemView: UnsafeNewQAbstractItemView(unsafe.Pointer(h))} } -func newQHeaderView_U(h unsafe.Pointer) *QHeaderView { +func UnsafeNewQHeaderView(h unsafe.Pointer) *QHeaderView { return newQHeaderView((*C.QHeaderView)(h)) } @@ -60,7 +67,7 @@ func NewQHeaderView2(orientation Orientation, parent *QWidget) *QHeaderView { } func (this *QHeaderView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QHeaderView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QHeaderView_MetaObject(this.h))) } func (this *QHeaderView) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qheaderview.h b/qt/gen_qheaderview.h index 281e5a97..b7a28950 100644 --- a/qt/gen_qheaderview.h +++ b/qt/gen_qheaderview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qhistorystate.cpp b/qt/gen_qhistorystate.cpp index 4fce8429..fe304bdd 100644 --- a/qt/gen_qhistorystate.cpp +++ b/qt/gen_qhistorystate.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qhistorystate.h" +#include #include "gen_qhistorystate.h" #include "_cgo_export.h" diff --git a/qt/gen_qhistorystate.go b/qt/gen_qhistorystate.go index 31955ef9..13747ec8 100644 --- a/qt/gen_qhistorystate.go +++ b/qt/gen_qhistorystate.go @@ -32,14 +32,21 @@ func (this *QHistoryState) cPointer() *C.QHistoryState { return this.h } +func (this *QHistoryState) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQHistoryState(h *C.QHistoryState) *QHistoryState { if h == nil { return nil } - return &QHistoryState{h: h, QAbstractState: newQAbstractState_U(unsafe.Pointer(h))} + return &QHistoryState{h: h, QAbstractState: UnsafeNewQAbstractState(unsafe.Pointer(h))} } -func newQHistoryState_U(h unsafe.Pointer) *QHistoryState { +func UnsafeNewQHistoryState(h unsafe.Pointer) *QHistoryState { return newQHistoryState((*C.QHistoryState)(h)) } @@ -68,7 +75,7 @@ func NewQHistoryState4(typeVal QHistoryState__HistoryType, parent *QState) *QHis } func (this *QHistoryState) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QHistoryState_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QHistoryState_MetaObject(this.h))) } func (this *QHistoryState) Metacast(param1 string) unsafe.Pointer { @@ -96,7 +103,7 @@ func QHistoryState_TrUtf8(s string) string { } func (this *QHistoryState) DefaultTransition() *QAbstractTransition { - return newQAbstractTransition_U(unsafe.Pointer(C.QHistoryState_DefaultTransition(this.h))) + return UnsafeNewQAbstractTransition(unsafe.Pointer(C.QHistoryState_DefaultTransition(this.h))) } func (this *QHistoryState) SetDefaultTransition(transition *QAbstractTransition) { @@ -104,7 +111,7 @@ func (this *QHistoryState) SetDefaultTransition(transition *QAbstractTransition) } func (this *QHistoryState) DefaultState() *QAbstractState { - return newQAbstractState_U(unsafe.Pointer(C.QHistoryState_DefaultState(this.h))) + return UnsafeNewQAbstractState(unsafe.Pointer(C.QHistoryState_DefaultState(this.h))) } func (this *QHistoryState) SetDefaultState(state *QAbstractState) { diff --git a/qt/gen_qhistorystate.h b/qt/gen_qhistorystate.h index 6c1c2430..7a242a9c 100644 --- a/qt/gen_qhistorystate.h +++ b/qt/gen_qhistorystate.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qicon.cpp b/qt/gen_qicon.cpp index 868e9605..ea630ae8 100644 --- a/qt/gen_qicon.cpp +++ b/qt/gen_qicon.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qicon.h" +#include #include "gen_qicon.h" #include "_cgo_export.h" @@ -160,7 +160,7 @@ struct miqt_array* QIcon_ThemeSearchPaths() { } void QIcon_SetThemeSearchPaths(struct miqt_array* /* of struct miqt_string* */ searchpath) { - QList searchpath_QList; + QStringList searchpath_QList; searchpath_QList.reserve(searchpath->len); struct miqt_string** searchpath_arr = static_cast(searchpath->data); for(size_t i = 0; i < searchpath->len; ++i) { @@ -187,7 +187,7 @@ struct miqt_array* QIcon_FallbackSearchPaths() { } void QIcon_SetFallbackSearchPaths(struct miqt_array* /* of struct miqt_string* */ paths) { - QList paths_QList; + QStringList paths_QList; paths_QList.reserve(paths->len); struct miqt_string** paths_arr = static_cast(paths->data); for(size_t i = 0; i < paths->len; ++i) { diff --git a/qt/gen_qicon.go b/qt/gen_qicon.go index 061b52bc..0239fd31 100644 --- a/qt/gen_qicon.go +++ b/qt/gen_qicon.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -40,6 +41,13 @@ func (this *QIcon) cPointer() *C.QIcon { return this.h } +func (this *QIcon) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIcon(h *C.QIcon) *QIcon { if h == nil { return nil @@ -47,7 +55,7 @@ func newQIcon(h *C.QIcon) *QIcon { return &QIcon{h: h} } -func newQIcon_U(h unsafe.Pointer) *QIcon { +func UnsafeNewQIcon(h unsafe.Pointer) *QIcon { return newQIcon((*C.QIcon)(h)) } @@ -71,7 +79,7 @@ func NewQIcon3(other *QIcon) *QIcon { // NewQIcon4 constructs a new QIcon object. func NewQIcon4(fileName string) *QIcon { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QIcon_new4((*C.struct_miqt_string)(fileName_ms)) return newQIcon(ret) @@ -169,7 +177,7 @@ func (this *QIcon) AddPixmap(pixmap *QPixmap) { } func (this *QIcon) AddFile(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QIcon_AddFile(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -197,7 +205,7 @@ func (this *QIcon) IsMask() bool { } func QIcon_FromTheme(name string) *QIcon { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) _ret := C.QIcon_FromTheme((*C.struct_miqt_string)(name_ms)) _goptr := newQIcon(_ret) @@ -206,7 +214,7 @@ func QIcon_FromTheme(name string) *QIcon { } func QIcon_FromTheme2(name string, fallback *QIcon) *QIcon { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) _ret := C.QIcon_FromTheme2((*C.struct_miqt_string)(name_ms), fallback.cPointer()) _goptr := newQIcon(_ret) @@ -215,7 +223,7 @@ func QIcon_FromTheme2(name string, fallback *QIcon) *QIcon { } func QIcon_HasThemeIcon(name string) bool { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (bool)(C.QIcon_HasThemeIcon((*C.struct_miqt_string)(name_ms))) } @@ -239,7 +247,7 @@ func QIcon_SetThemeSearchPaths(searchpath []string) { searchpath_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(searchpath)))) defer C.free(unsafe.Pointer(searchpath_CArray)) for i := range searchpath { - searchpath_i_ms := miqt_strdupg(searchpath[i]) + searchpath_i_ms := libmiqt.Strdupg(searchpath[i]) defer C.free(searchpath_i_ms) searchpath_CArray[i] = (*C.struct_miqt_string)(searchpath_i_ms) } @@ -267,7 +275,7 @@ func QIcon_SetFallbackSearchPaths(paths []string) { paths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(paths)))) defer C.free(unsafe.Pointer(paths_CArray)) for i := range paths { - paths_i_ms := miqt_strdupg(paths[i]) + paths_i_ms := libmiqt.Strdupg(paths[i]) defer C.free(paths_i_ms) paths_CArray[i] = (*C.struct_miqt_string)(paths_i_ms) } @@ -284,7 +292,7 @@ func QIcon_ThemeName() string { } func QIcon_SetThemeName(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QIcon_SetThemeName((*C.struct_miqt_string)(path_ms)) } @@ -297,7 +305,7 @@ func QIcon_FallbackThemeName() string { } func QIcon_SetFallbackThemeName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QIcon_SetFallbackThemeName((*C.struct_miqt_string)(name_ms)) } @@ -419,19 +427,19 @@ func (this *QIcon) AddPixmap3(pixmap *QPixmap, mode QIcon__Mode, state QIcon__St } func (this *QIcon) AddFile2(fileName string, size *QSize) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QIcon_AddFile2(this.h, (*C.struct_miqt_string)(fileName_ms), size.cPointer()) } func (this *QIcon) AddFile3(fileName string, size *QSize, mode QIcon__Mode) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QIcon_AddFile3(this.h, (*C.struct_miqt_string)(fileName_ms), size.cPointer(), (C.int)(mode)) } func (this *QIcon) AddFile4(fileName string, size *QSize, mode QIcon__Mode, state QIcon__State) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QIcon_AddFile4(this.h, (*C.struct_miqt_string)(fileName_ms), size.cPointer(), (C.int)(mode), (C.int)(state)) } diff --git a/qt/gen_qicon.h b/qt/gen_qicon.h index dce160d6..74140aee 100644 --- a/qt/gen_qicon.h +++ b/qt/gen_qicon.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qiconengine.cpp b/qt/gen_qiconengine.cpp index cd42121c..d6f7f782 100644 --- a/qt/gen_qiconengine.cpp +++ b/qt/gen_qiconengine.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qiconengine.h" +#include #include "gen_qiconengine.h" #include "_cgo_export.h" diff --git a/qt/gen_qiconengine.go b/qt/gen_qiconengine.go index c80b9ad2..844df529 100644 --- a/qt/gen_qiconengine.go +++ b/qt/gen_qiconengine.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -33,6 +34,13 @@ func (this *QIconEngine) cPointer() *C.QIconEngine { return this.h } +func (this *QIconEngine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIconEngine(h *C.QIconEngine) *QIconEngine { if h == nil { return nil @@ -40,7 +48,7 @@ func newQIconEngine(h *C.QIconEngine) *QIconEngine { return &QIconEngine{h: h} } -func newQIconEngine_U(h unsafe.Pointer) *QIconEngine { +func UnsafeNewQIconEngine(h unsafe.Pointer) *QIconEngine { return newQIconEngine((*C.QIconEngine)(h)) } @@ -67,7 +75,7 @@ func (this *QIconEngine) AddPixmap(pixmap *QPixmap, mode QIcon__Mode, state QIco } func (this *QIconEngine) AddFile(fileName string, size *QSize, mode QIcon__Mode, state QIcon__State) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QIconEngine_AddFile(this.h, (*C.struct_miqt_string)(fileName_ms), size.cPointer(), (C.int)(mode), (C.int)(state)) } @@ -80,7 +88,7 @@ func (this *QIconEngine) Key() string { } func (this *QIconEngine) Clone() *QIconEngine { - return newQIconEngine_U(unsafe.Pointer(C.QIconEngine_Clone(this.h))) + return UnsafeNewQIconEngine(unsafe.Pointer(C.QIconEngine_Clone(this.h))) } func (this *QIconEngine) Read(in *QDataStream) bool { @@ -180,6 +188,13 @@ func (this *QIconEngine__AvailableSizesArgument) cPointer() *C.QIconEngine__Avai return this.h } +func (this *QIconEngine__AvailableSizesArgument) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIconEngine__AvailableSizesArgument(h *C.QIconEngine__AvailableSizesArgument) *QIconEngine__AvailableSizesArgument { if h == nil { return nil @@ -187,7 +202,7 @@ func newQIconEngine__AvailableSizesArgument(h *C.QIconEngine__AvailableSizesArgu return &QIconEngine__AvailableSizesArgument{h: h} } -func newQIconEngine__AvailableSizesArgument_U(h unsafe.Pointer) *QIconEngine__AvailableSizesArgument { +func UnsafeNewQIconEngine__AvailableSizesArgument(h unsafe.Pointer) *QIconEngine__AvailableSizesArgument { return newQIconEngine__AvailableSizesArgument((*C.QIconEngine__AvailableSizesArgument)(h)) } @@ -226,6 +241,13 @@ func (this *QIconEngine__ScaledPixmapArgument) cPointer() *C.QIconEngine__Scaled return this.h } +func (this *QIconEngine__ScaledPixmapArgument) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIconEngine__ScaledPixmapArgument(h *C.QIconEngine__ScaledPixmapArgument) *QIconEngine__ScaledPixmapArgument { if h == nil { return nil @@ -233,7 +255,7 @@ func newQIconEngine__ScaledPixmapArgument(h *C.QIconEngine__ScaledPixmapArgument return &QIconEngine__ScaledPixmapArgument{h: h} } -func newQIconEngine__ScaledPixmapArgument_U(h unsafe.Pointer) *QIconEngine__ScaledPixmapArgument { +func UnsafeNewQIconEngine__ScaledPixmapArgument(h unsafe.Pointer) *QIconEngine__ScaledPixmapArgument { return newQIconEngine__ScaledPixmapArgument((*C.QIconEngine__ScaledPixmapArgument)(h)) } diff --git a/qt/gen_qiconengine.h b/qt/gen_qiconengine.h index 5a2db3dd..c94dd82c 100644 --- a/qt/gen_qiconengine.h +++ b/qt/gen_qiconengine.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qiconengineplugin.cpp b/qt/gen_qiconengineplugin.cpp index 1f0db270..817e1e28 100644 --- a/qt/gen_qiconengineplugin.cpp +++ b/qt/gen_qiconengineplugin.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qiconengineplugin.h" +#include #include "gen_qiconengineplugin.h" #include "_cgo_export.h" diff --git a/qt/gen_qiconengineplugin.go b/qt/gen_qiconengineplugin.go index 55c793b8..e331dfe3 100644 --- a/qt/gen_qiconengineplugin.go +++ b/qt/gen_qiconengineplugin.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,19 +26,26 @@ func (this *QIconEnginePlugin) cPointer() *C.QIconEnginePlugin { return this.h } +func (this *QIconEnginePlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIconEnginePlugin(h *C.QIconEnginePlugin) *QIconEnginePlugin { if h == nil { return nil } - return &QIconEnginePlugin{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QIconEnginePlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQIconEnginePlugin_U(h unsafe.Pointer) *QIconEnginePlugin { +func UnsafeNewQIconEnginePlugin(h unsafe.Pointer) *QIconEnginePlugin { return newQIconEnginePlugin((*C.QIconEnginePlugin)(h)) } func (this *QIconEnginePlugin) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QIconEnginePlugin_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QIconEnginePlugin_MetaObject(this.h))) } func (this *QIconEnginePlugin) Metacast(param1 string) unsafe.Pointer { @@ -65,7 +73,7 @@ func QIconEnginePlugin_TrUtf8(s string) string { } func (this *QIconEnginePlugin) Create() *QIconEngine { - return newQIconEngine_U(unsafe.Pointer(C.QIconEnginePlugin_Create(this.h))) + return UnsafeNewQIconEngine(unsafe.Pointer(C.QIconEnginePlugin_Create(this.h))) } func QIconEnginePlugin_Tr2(s string, c string) string { @@ -113,9 +121,9 @@ func QIconEnginePlugin_TrUtf83(s string, c string, n int) string { } func (this *QIconEnginePlugin) Create1(filename string) *QIconEngine { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) - return newQIconEngine_U(unsafe.Pointer(C.QIconEnginePlugin_Create1(this.h, (*C.struct_miqt_string)(filename_ms)))) + return UnsafeNewQIconEngine(unsafe.Pointer(C.QIconEnginePlugin_Create1(this.h, (*C.struct_miqt_string)(filename_ms)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qiconengineplugin.h b/qt/gen_qiconengineplugin.h index fa7212a3..bd4c9edf 100644 --- a/qt/gen_qiconengineplugin.h +++ b/qt/gen_qiconengineplugin.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qidentityproxymodel.cpp b/qt/gen_qidentityproxymodel.cpp index 46d7eed5..f7396c4e 100644 --- a/qt/gen_qidentityproxymodel.cpp +++ b/qt/gen_qidentityproxymodel.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qidentityproxymodel.h" +#include #include "gen_qidentityproxymodel.h" #include "_cgo_export.h" diff --git a/qt/gen_qidentityproxymodel.go b/qt/gen_qidentityproxymodel.go index 76dcdb2b..97a18120 100644 --- a/qt/gen_qidentityproxymodel.go +++ b/qt/gen_qidentityproxymodel.go @@ -25,14 +25,21 @@ func (this *QIdentityProxyModel) cPointer() *C.QIdentityProxyModel { return this.h } +func (this *QIdentityProxyModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIdentityProxyModel(h *C.QIdentityProxyModel) *QIdentityProxyModel { if h == nil { return nil } - return &QIdentityProxyModel{h: h, QAbstractProxyModel: newQAbstractProxyModel_U(unsafe.Pointer(h))} + return &QIdentityProxyModel{h: h, QAbstractProxyModel: UnsafeNewQAbstractProxyModel(unsafe.Pointer(h))} } -func newQIdentityProxyModel_U(h unsafe.Pointer) *QIdentityProxyModel { +func UnsafeNewQIdentityProxyModel(h unsafe.Pointer) *QIdentityProxyModel { return newQIdentityProxyModel((*C.QIdentityProxyModel)(h)) } @@ -49,7 +56,7 @@ func NewQIdentityProxyModel2(parent *QObject) *QIdentityProxyModel { } func (this *QIdentityProxyModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QIdentityProxyModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QIdentityProxyModel_MetaObject(this.h))) } func (this *QIdentityProxyModel) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qidentityproxymodel.h b/qt/gen_qidentityproxymodel.h index 1c5641f2..2014a834 100644 --- a/qt/gen_qidentityproxymodel.h +++ b/qt/gen_qidentityproxymodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qimage.cpp b/qt/gen_qimage.cpp index 6f00e67f..9f327f6b 100644 --- a/qt/gen_qimage.cpp +++ b/qt/gen_qimage.cpp @@ -15,7 +15,7 @@ #include #include #include -#include "qimage.h" +#include #include "gen_qimage.h" #include "_cgo_export.h" @@ -111,7 +111,7 @@ QImage* QImage_ConvertToFormat(const QImage* self, int f) { } QImage* QImage_ConvertToFormat2(const QImage* self, int f, struct miqt_array* /* of unsigned int */ colorTable) { - QVector colorTable_QList; + QVector colorTable_QList; colorTable_QList.reserve(colorTable->len); unsigned int* colorTable_arr = static_cast(colorTable->data); for(size_t i = 0; i < colorTable->len; ++i) { @@ -284,7 +284,7 @@ struct miqt_array* QImage_ColorTable(const QImage* self) { } void QImage_SetColorTable(QImage* self, struct miqt_array* /* of unsigned int */ colors) { - QVector colors_QList; + QVector colors_QList; colors_QList.reserve(colors->len); unsigned int* colors_arr = static_cast(colors->data); for(size_t i = 0; i < colors->len; ++i) { @@ -520,7 +520,7 @@ QImage* QImage_ConvertToFormat22(const QImage* self, int f, int flags) { } QImage* QImage_ConvertToFormat3(const QImage* self, int f, struct miqt_array* /* of unsigned int */ colorTable, int flags) { - QVector colorTable_QList; + QVector colorTable_QList; colorTable_QList.reserve(colorTable->len); unsigned int* colorTable_arr = static_cast(colorTable->data); for(size_t i = 0; i < colorTable->len; ++i) { diff --git a/qt/gen_qimage.go b/qt/gen_qimage.go index c02243c2..2f201ce4 100644 --- a/qt/gen_qimage.go +++ b/qt/gen_qimage.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -68,14 +69,21 @@ func (this *QImage) cPointer() *C.QImage { return this.h } +func (this *QImage) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQImage(h *C.QImage) *QImage { if h == nil { return nil } - return &QImage{h: h, QPaintDevice: newQPaintDevice_U(unsafe.Pointer(h))} + return &QImage{h: h, QPaintDevice: UnsafeNewQPaintDevice(unsafe.Pointer(h))} } -func newQImage_U(h unsafe.Pointer) *QImage { +func UnsafeNewQImage(h unsafe.Pointer) *QImage { return newQImage((*C.QImage)(h)) } @@ -123,7 +131,7 @@ func NewQImage7(data *byte, width int, height int, bytesPerLine int, format QIma // NewQImage8 constructs a new QImage object. func NewQImage8(fileName string) *QImage { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QImage_new8((*C.struct_miqt_string)(fileName_ms)) return newQImage(ret) @@ -137,7 +145,7 @@ func NewQImage9(param1 *QImage) *QImage { // NewQImage10 constructs a new QImage object. func NewQImage10(fileName string, format string) *QImage { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -555,7 +563,7 @@ func (this *QImage) Load(device *QIODevice, format string) bool { } func (this *QImage) LoadWithFileName(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QImage_LoadWithFileName(this.h, (*C.struct_miqt_string)(fileName_ms))) } @@ -569,7 +577,7 @@ func (this *QImage) LoadFromDataWithData(data *QByteArray) bool { } func (this *QImage) Save(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QImage_Save(this.h, (*C.struct_miqt_string)(fileName_ms))) } @@ -597,7 +605,7 @@ func (this *QImage) CacheKey() int64 { } func (this *QImage) PaintEngine() *QPaintEngine { - return newQPaintEngine_U(unsafe.Pointer(C.QImage_PaintEngine(this.h))) + return UnsafeNewQPaintEngine(unsafe.Pointer(C.QImage_PaintEngine(this.h))) } func (this *QImage) DotsPerMeterX() int { @@ -649,9 +657,9 @@ func (this *QImage) Text() string { } func (this *QImage) SetText(key string, value string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) C.QImage_SetText(this.h, (*C.struct_miqt_string)(key_ms), (*C.struct_miqt_string)(value_ms)) } @@ -803,7 +811,7 @@ func (this *QImage) InvertPixels1(param1 QImage__InvertMode) { } func (this *QImage) Load2(fileName string, format string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -823,7 +831,7 @@ func (this *QImage) LoadFromData2(data *QByteArray, aformat string) bool { } func (this *QImage) Save2(fileName string, format string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -831,7 +839,7 @@ func (this *QImage) Save2(fileName string, format string) bool { } func (this *QImage) Save3(fileName string, format string, quality int) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -869,7 +877,7 @@ func QImage_FromData2(data *QByteArray, format string) *QImage { } func (this *QImage) Text1(key string) string { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) var _ms *C.struct_miqt_string = C.QImage_Text1(this.h, (*C.struct_miqt_string)(key_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qimage.h b/qt/gen_qimage.h index 4ad9844c..9fe73b55 100644 --- a/qt/gen_qimage.h +++ b/qt/gen_qimage.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qimageiohandler.cpp b/qt/gen_qimageiohandler.cpp index f657d998..a5a393b3 100644 --- a/qt/gen_qimageiohandler.cpp +++ b/qt/gen_qimageiohandler.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qimageiohandler.h" +#include #include "gen_qimageiohandler.h" #include "_cgo_export.h" diff --git a/qt/gen_qimageiohandler.go b/qt/gen_qimageiohandler.go index e1186e70..0c5c9753 100644 --- a/qt/gen_qimageiohandler.go +++ b/qt/gen_qimageiohandler.go @@ -70,6 +70,13 @@ func (this *QImageIOHandler) cPointer() *C.QImageIOHandler { return this.h } +func (this *QImageIOHandler) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQImageIOHandler(h *C.QImageIOHandler) *QImageIOHandler { if h == nil { return nil @@ -77,7 +84,7 @@ func newQImageIOHandler(h *C.QImageIOHandler) *QImageIOHandler { return &QImageIOHandler{h: h} } -func newQImageIOHandler_U(h unsafe.Pointer) *QImageIOHandler { +func UnsafeNewQImageIOHandler(h unsafe.Pointer) *QImageIOHandler { return newQImageIOHandler((*C.QImageIOHandler)(h)) } @@ -86,7 +93,7 @@ func (this *QImageIOHandler) SetDevice(device *QIODevice) { } func (this *QImageIOHandler) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QImageIOHandler_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QImageIOHandler_Device(this.h))) } func (this *QImageIOHandler) SetFormat(format *QByteArray) { @@ -195,19 +202,26 @@ func (this *QImageIOPlugin) cPointer() *C.QImageIOPlugin { return this.h } +func (this *QImageIOPlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQImageIOPlugin(h *C.QImageIOPlugin) *QImageIOPlugin { if h == nil { return nil } - return &QImageIOPlugin{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QImageIOPlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQImageIOPlugin_U(h unsafe.Pointer) *QImageIOPlugin { +func UnsafeNewQImageIOPlugin(h unsafe.Pointer) *QImageIOPlugin { return newQImageIOPlugin((*C.QImageIOPlugin)(h)) } func (this *QImageIOPlugin) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QImageIOPlugin_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QImageIOPlugin_MetaObject(this.h))) } func (this *QImageIOPlugin) Metacast(param1 string) unsafe.Pointer { @@ -239,7 +253,7 @@ func (this *QImageIOPlugin) Capabilities(device *QIODevice, format *QByteArray) } func (this *QImageIOPlugin) Create(device *QIODevice) *QImageIOHandler { - return newQImageIOHandler_U(unsafe.Pointer(C.QImageIOPlugin_Create(this.h, device.cPointer()))) + return UnsafeNewQImageIOHandler(unsafe.Pointer(C.QImageIOPlugin_Create(this.h, device.cPointer()))) } func QImageIOPlugin_Tr2(s string, c string) string { @@ -287,7 +301,7 @@ func QImageIOPlugin_TrUtf83(s string, c string, n int) string { } func (this *QImageIOPlugin) Create2(device *QIODevice, format *QByteArray) *QImageIOHandler { - return newQImageIOHandler_U(unsafe.Pointer(C.QImageIOPlugin_Create2(this.h, device.cPointer(), format.cPointer()))) + return UnsafeNewQImageIOHandler(unsafe.Pointer(C.QImageIOPlugin_Create2(this.h, device.cPointer(), format.cPointer()))) } // Delete this object from C++ memory. diff --git a/qt/gen_qimageiohandler.h b/qt/gen_qimageiohandler.h index be4063e7..d2699036 100644 --- a/qt/gen_qimageiohandler.h +++ b/qt/gen_qimageiohandler.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qimagereader.cpp b/qt/gen_qimagereader.cpp index bd50587f..8a133b5c 100644 --- a/qt/gen_qimagereader.cpp +++ b/qt/gen_qimagereader.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qimagereader.h" +#include #include "gen_qimagereader.h" #include "_cgo_export.h" diff --git a/qt/gen_qimagereader.go b/qt/gen_qimagereader.go index a38366c3..07588359 100644 --- a/qt/gen_qimagereader.go +++ b/qt/gen_qimagereader.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -34,6 +35,13 @@ func (this *QImageReader) cPointer() *C.QImageReader { return this.h } +func (this *QImageReader) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQImageReader(h *C.QImageReader) *QImageReader { if h == nil { return nil @@ -41,7 +49,7 @@ func newQImageReader(h *C.QImageReader) *QImageReader { return &QImageReader{h: h} } -func newQImageReader_U(h unsafe.Pointer) *QImageReader { +func UnsafeNewQImageReader(h unsafe.Pointer) *QImageReader { return newQImageReader((*C.QImageReader)(h)) } @@ -59,7 +67,7 @@ func NewQImageReader2(device *QIODevice) *QImageReader { // NewQImageReader3 constructs a new QImageReader object. func NewQImageReader3(fileName string) *QImageReader { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QImageReader_new3((*C.struct_miqt_string)(fileName_ms)) return newQImageReader(ret) @@ -73,7 +81,7 @@ func NewQImageReader4(device *QIODevice, format *QByteArray) *QImageReader { // NewQImageReader5 constructs a new QImageReader object. func NewQImageReader5(fileName string, format *QByteArray) *QImageReader { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QImageReader_new5((*C.struct_miqt_string)(fileName_ms), format.cPointer()) return newQImageReader(ret) @@ -129,11 +137,11 @@ func (this *QImageReader) SetDevice(device *QIODevice) { } func (this *QImageReader) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QImageReader_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QImageReader_Device(this.h))) } func (this *QImageReader) SetFileName(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QImageReader_SetFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -171,7 +179,7 @@ func (this *QImageReader) TextKeys() []string { } func (this *QImageReader) Text(key string) string { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) var _ms *C.struct_miqt_string = C.QImageReader_Text(this.h, (*C.struct_miqt_string)(key_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -338,7 +346,7 @@ func (this *QImageReader) SupportsOption(option QImageIOHandler__ImageOption) bo } func QImageReader_ImageFormatWithFileName(fileName string) *QByteArray { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QImageReader_ImageFormatWithFileName((*C.struct_miqt_string)(fileName_ms)) _goptr := newQByteArray(_ret) diff --git a/qt/gen_qimagereader.h b/qt/gen_qimagereader.h index 3117bcfc..f9012946 100644 --- a/qt/gen_qimagereader.h +++ b/qt/gen_qimagereader.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qimagewriter.cpp b/qt/gen_qimagewriter.cpp index 7517de81..fa93ece1 100644 --- a/qt/gen_qimagewriter.cpp +++ b/qt/gen_qimagewriter.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qimagewriter.h" +#include #include "gen_qimagewriter.h" #include "_cgo_export.h" diff --git a/qt/gen_qimagewriter.go b/qt/gen_qimagewriter.go index 4cf52eb1..f241c360 100644 --- a/qt/gen_qimagewriter.go +++ b/qt/gen_qimagewriter.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -33,6 +34,13 @@ func (this *QImageWriter) cPointer() *C.QImageWriter { return this.h } +func (this *QImageWriter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQImageWriter(h *C.QImageWriter) *QImageWriter { if h == nil { return nil @@ -40,7 +48,7 @@ func newQImageWriter(h *C.QImageWriter) *QImageWriter { return &QImageWriter{h: h} } -func newQImageWriter_U(h unsafe.Pointer) *QImageWriter { +func UnsafeNewQImageWriter(h unsafe.Pointer) *QImageWriter { return newQImageWriter((*C.QImageWriter)(h)) } @@ -58,7 +66,7 @@ func NewQImageWriter2(device *QIODevice, format *QByteArray) *QImageWriter { // NewQImageWriter3 constructs a new QImageWriter object. func NewQImageWriter3(fileName string) *QImageWriter { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QImageWriter_new3((*C.struct_miqt_string)(fileName_ms)) return newQImageWriter(ret) @@ -66,7 +74,7 @@ func NewQImageWriter3(fileName string) *QImageWriter { // NewQImageWriter4 constructs a new QImageWriter object. func NewQImageWriter4(fileName string, format *QByteArray) *QImageWriter { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QImageWriter_new4((*C.struct_miqt_string)(fileName_ms), format.cPointer()) return newQImageWriter(ret) @@ -106,11 +114,11 @@ func (this *QImageWriter) SetDevice(device *QIODevice) { } func (this *QImageWriter) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QImageWriter_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QImageWriter_Device(this.h))) } func (this *QImageWriter) SetFileName(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QImageWriter_SetFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -196,7 +204,7 @@ func (this *QImageWriter) SetTransformation(orientation QImageIOHandler__Transfo } func (this *QImageWriter) SetDescription(description string) { - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) C.QImageWriter_SetDescription(this.h, (*C.struct_miqt_string)(description_ms)) } @@ -209,9 +217,9 @@ func (this *QImageWriter) Description() string { } func (this *QImageWriter) SetText(key string, text string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QImageWriter_SetText(this.h, (*C.struct_miqt_string)(key_ms), (*C.struct_miqt_string)(text_ms)) } diff --git a/qt/gen_qimagewriter.h b/qt/gen_qimagewriter.h index 2753f53c..8fc6aa83 100644 --- a/qt/gen_qimagewriter.h +++ b/qt/gen_qimagewriter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qinputdialog.cpp b/qt/gen_qinputdialog.cpp index baf6ed22..c266658b 100644 --- a/qt/gen_qinputdialog.cpp +++ b/qt/gen_qinputdialog.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qinputdialog.h" +#include #include "gen_qinputdialog.h" #include "_cgo_export.h" @@ -112,7 +112,7 @@ bool QInputDialog_IsComboBoxEditable(const QInputDialog* self) { } void QInputDialog_SetComboBoxItems(QInputDialog* self, struct miqt_array* /* of struct miqt_string* */ items) { - QList items_QList; + QStringList items_QList; items_QList.reserve(items->len); struct miqt_string** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -267,7 +267,7 @@ struct miqt_string* QInputDialog_GetMultiLineText(QWidget* parent, struct miqt_s struct miqt_string* QInputDialog_GetItem(QWidget* parent, struct miqt_string* title, struct miqt_string* label, struct miqt_array* /* of struct miqt_string* */ items) { QString title_QString = QString::fromUtf8(&title->data, title->len); QString label_QString = QString::fromUtf8(&label->data, label->len); - QList items_QList; + QStringList items_QList; items_QList.reserve(items->len); struct miqt_string** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -508,7 +508,7 @@ struct miqt_string* QInputDialog_GetMultiLineText7(QWidget* parent, struct miqt_ struct miqt_string* QInputDialog_GetItem5(QWidget* parent, struct miqt_string* title, struct miqt_string* label, struct miqt_array* /* of struct miqt_string* */ items, int current) { QString title_QString = QString::fromUtf8(&title->data, title->len); QString label_QString = QString::fromUtf8(&label->data, label->len); - QList items_QList; + QStringList items_QList; items_QList.reserve(items->len); struct miqt_string** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -524,7 +524,7 @@ struct miqt_string* QInputDialog_GetItem5(QWidget* parent, struct miqt_string* t struct miqt_string* QInputDialog_GetItem6(QWidget* parent, struct miqt_string* title, struct miqt_string* label, struct miqt_array* /* of struct miqt_string* */ items, int current, bool editable) { QString title_QString = QString::fromUtf8(&title->data, title->len); QString label_QString = QString::fromUtf8(&label->data, label->len); - QList items_QList; + QStringList items_QList; items_QList.reserve(items->len); struct miqt_string** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -540,7 +540,7 @@ struct miqt_string* QInputDialog_GetItem6(QWidget* parent, struct miqt_string* t struct miqt_string* QInputDialog_GetItem7(QWidget* parent, struct miqt_string* title, struct miqt_string* label, struct miqt_array* /* of struct miqt_string* */ items, int current, bool editable, bool* ok) { QString title_QString = QString::fromUtf8(&title->data, title->len); QString label_QString = QString::fromUtf8(&label->data, label->len); - QList items_QList; + QStringList items_QList; items_QList.reserve(items->len); struct miqt_string** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -556,7 +556,7 @@ struct miqt_string* QInputDialog_GetItem7(QWidget* parent, struct miqt_string* t struct miqt_string* QInputDialog_GetItem8(QWidget* parent, struct miqt_string* title, struct miqt_string* label, struct miqt_array* /* of struct miqt_string* */ items, int current, bool editable, bool* ok, int flags) { QString title_QString = QString::fromUtf8(&title->data, title->len); QString label_QString = QString::fromUtf8(&label->data, label->len); - QList items_QList; + QStringList items_QList; items_QList.reserve(items->len); struct miqt_string** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -572,7 +572,7 @@ struct miqt_string* QInputDialog_GetItem8(QWidget* parent, struct miqt_string* t struct miqt_string* QInputDialog_GetItem9(QWidget* parent, struct miqt_string* title, struct miqt_string* label, struct miqt_array* /* of struct miqt_string* */ items, int current, bool editable, bool* ok, int flags, int inputMethodHints) { QString title_QString = QString::fromUtf8(&title->data, title->len); QString label_QString = QString::fromUtf8(&label->data, label->len); - QList items_QList; + QStringList items_QList; items_QList.reserve(items->len); struct miqt_string** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { diff --git a/qt/gen_qinputdialog.go b/qt/gen_qinputdialog.go index 0acacba4..56a930ff 100644 --- a/qt/gen_qinputdialog.go +++ b/qt/gen_qinputdialog.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -42,14 +43,21 @@ func (this *QInputDialog) cPointer() *C.QInputDialog { return this.h } +func (this *QInputDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQInputDialog(h *C.QInputDialog) *QInputDialog { if h == nil { return nil } - return &QInputDialog{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QInputDialog{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQInputDialog_U(h unsafe.Pointer) *QInputDialog { +func UnsafeNewQInputDialog(h unsafe.Pointer) *QInputDialog { return newQInputDialog((*C.QInputDialog)(h)) } @@ -72,7 +80,7 @@ func NewQInputDialog3(parent *QWidget, flags WindowType) *QInputDialog { } func (this *QInputDialog) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QInputDialog_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QInputDialog_MetaObject(this.h))) } func (this *QInputDialog) Metacast(param1 string) unsafe.Pointer { @@ -108,7 +116,7 @@ func (this *QInputDialog) InputMode() QInputDialog__InputMode { } func (this *QInputDialog) SetLabelText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QInputDialog_SetLabelText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -137,7 +145,7 @@ func (this *QInputDialog) Options() QInputDialog__InputDialogOption { } func (this *QInputDialog) SetTextValue(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QInputDialog_SetTextValue(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -170,7 +178,7 @@ func (this *QInputDialog) SetComboBoxItems(items []string) { items_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(items)))) defer C.free(unsafe.Pointer(items_CArray)) for i := range items { - items_i_ms := miqt_strdupg(items[i]) + items_i_ms := libmiqt.Strdupg(items[i]) defer C.free(items_i_ms) items_CArray[i] = (*C.struct_miqt_string)(items_i_ms) } @@ -266,7 +274,7 @@ func (this *QInputDialog) DoubleDecimals() int { } func (this *QInputDialog) SetOkButtonText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QInputDialog_SetOkButtonText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -279,7 +287,7 @@ func (this *QInputDialog) OkButtonText() string { } func (this *QInputDialog) SetCancelButtonText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QInputDialog_SetCancelButtonText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -310,9 +318,9 @@ func (this *QInputDialog) SetVisible(visible bool) { } func QInputDialog_GetText(parent *QWidget, title string, label string) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetText(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -321,9 +329,9 @@ func QInputDialog_GetText(parent *QWidget, title string, label string) string { } func QInputDialog_GetMultiLineText(parent *QWidget, title string, label string) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetMultiLineText(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -332,15 +340,15 @@ func QInputDialog_GetMultiLineText(parent *QWidget, title string, label string) } func QInputDialog_GetItem(parent *QWidget, title string, label string, items []string) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) // For the C ABI, malloc a C array of raw pointers items_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(items)))) defer C.free(unsafe.Pointer(items_CArray)) for i := range items { - items_i_ms := miqt_strdupg(items[i]) + items_i_ms := libmiqt.Strdupg(items[i]) defer C.free(items_i_ms) items_CArray[i] = (*C.struct_miqt_string)(items_i_ms) } @@ -353,25 +361,25 @@ func QInputDialog_GetItem(parent *QWidget, title string, label string, items []s } func QInputDialog_GetInt(parent *QWidget, title string, label string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QInputDialog_GetInt(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms))) } func QInputDialog_GetDouble(parent *QWidget, title string, label string) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms))) } func QInputDialog_GetDouble2(parent *QWidget, title string, label string, value float64, minValue float64, maxValue float64, decimals int, ok *bool, flags WindowType, step float64) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble2(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.double)(value), (C.double)(minValue), (C.double)(maxValue), (C.int)(decimals), (*C.bool)(unsafe.Pointer(ok)), (C.int)(flags), (C.double)(step))) } @@ -385,7 +393,7 @@ func (this *QInputDialog) DoubleStep() float64 { } func (this *QInputDialog) TextValueChanged(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QInputDialog_TextValueChanged(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -410,7 +418,7 @@ func miqt_exec_callback_QInputDialog_TextValueChanged(cb C.intptr_t, text *C.str } func (this *QInputDialog) TextValueSelected(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QInputDialog_TextValueSelected(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -567,9 +575,9 @@ func (this *QInputDialog) SetOption2(option QInputDialog__InputDialogOption, on } func QInputDialog_GetText4(parent *QWidget, title string, label string, echo QLineEdit__EchoMode) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetText4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(echo)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -578,11 +586,11 @@ func QInputDialog_GetText4(parent *QWidget, title string, label string, echo QLi } func QInputDialog_GetText5(parent *QWidget, title string, label string, echo QLineEdit__EchoMode, text string) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetText5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(echo), (*C.struct_miqt_string)(text_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -591,11 +599,11 @@ func QInputDialog_GetText5(parent *QWidget, title string, label string, echo QLi } func QInputDialog_GetText6(parent *QWidget, title string, label string, echo QLineEdit__EchoMode, text string, ok *bool) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetText6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(echo), (*C.struct_miqt_string)(text_ms), (*C.bool)(unsafe.Pointer(ok))) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -604,11 +612,11 @@ func QInputDialog_GetText6(parent *QWidget, title string, label string, echo QLi } func QInputDialog_GetText7(parent *QWidget, title string, label string, echo QLineEdit__EchoMode, text string, ok *bool, flags WindowType) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetText7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(echo), (*C.struct_miqt_string)(text_ms), (*C.bool)(unsafe.Pointer(ok)), (C.int)(flags)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -617,11 +625,11 @@ func QInputDialog_GetText7(parent *QWidget, title string, label string, echo QLi } func QInputDialog_GetText8(parent *QWidget, title string, label string, echo QLineEdit__EchoMode, text string, ok *bool, flags WindowType, inputMethodHints InputMethodHint) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetText8(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(echo), (*C.struct_miqt_string)(text_ms), (*C.bool)(unsafe.Pointer(ok)), (C.int)(flags), (C.int)(inputMethodHints)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -630,11 +638,11 @@ func QInputDialog_GetText8(parent *QWidget, title string, label string, echo QLi } func QInputDialog_GetMultiLineText4(parent *QWidget, title string, label string, text string) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetMultiLineText4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (*C.struct_miqt_string)(text_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -643,11 +651,11 @@ func QInputDialog_GetMultiLineText4(parent *QWidget, title string, label string, } func QInputDialog_GetMultiLineText5(parent *QWidget, title string, label string, text string, ok *bool) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetMultiLineText5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (*C.struct_miqt_string)(text_ms), (*C.bool)(unsafe.Pointer(ok))) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -656,11 +664,11 @@ func QInputDialog_GetMultiLineText5(parent *QWidget, title string, label string, } func QInputDialog_GetMultiLineText6(parent *QWidget, title string, label string, text string, ok *bool, flags WindowType) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetMultiLineText6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (*C.struct_miqt_string)(text_ms), (*C.bool)(unsafe.Pointer(ok)), (C.int)(flags)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -669,11 +677,11 @@ func QInputDialog_GetMultiLineText6(parent *QWidget, title string, label string, } func QInputDialog_GetMultiLineText7(parent *QWidget, title string, label string, text string, ok *bool, flags WindowType, inputMethodHints InputMethodHint) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ms *C.struct_miqt_string = C.QInputDialog_GetMultiLineText7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (*C.struct_miqt_string)(text_ms), (*C.bool)(unsafe.Pointer(ok)), (C.int)(flags), (C.int)(inputMethodHints)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -682,15 +690,15 @@ func QInputDialog_GetMultiLineText7(parent *QWidget, title string, label string, } func QInputDialog_GetItem5(parent *QWidget, title string, label string, items []string, current int) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) // For the C ABI, malloc a C array of raw pointers items_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(items)))) defer C.free(unsafe.Pointer(items_CArray)) for i := range items { - items_i_ms := miqt_strdupg(items[i]) + items_i_ms := libmiqt.Strdupg(items[i]) defer C.free(items_i_ms) items_CArray[i] = (*C.struct_miqt_string)(items_i_ms) } @@ -703,15 +711,15 @@ func QInputDialog_GetItem5(parent *QWidget, title string, label string, items [] } func QInputDialog_GetItem6(parent *QWidget, title string, label string, items []string, current int, editable bool) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) // For the C ABI, malloc a C array of raw pointers items_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(items)))) defer C.free(unsafe.Pointer(items_CArray)) for i := range items { - items_i_ms := miqt_strdupg(items[i]) + items_i_ms := libmiqt.Strdupg(items[i]) defer C.free(items_i_ms) items_CArray[i] = (*C.struct_miqt_string)(items_i_ms) } @@ -724,15 +732,15 @@ func QInputDialog_GetItem6(parent *QWidget, title string, label string, items [] } func QInputDialog_GetItem7(parent *QWidget, title string, label string, items []string, current int, editable bool, ok *bool) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) // For the C ABI, malloc a C array of raw pointers items_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(items)))) defer C.free(unsafe.Pointer(items_CArray)) for i := range items { - items_i_ms := miqt_strdupg(items[i]) + items_i_ms := libmiqt.Strdupg(items[i]) defer C.free(items_i_ms) items_CArray[i] = (*C.struct_miqt_string)(items_i_ms) } @@ -745,15 +753,15 @@ func QInputDialog_GetItem7(parent *QWidget, title string, label string, items [] } func QInputDialog_GetItem8(parent *QWidget, title string, label string, items []string, current int, editable bool, ok *bool, flags WindowType) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) // For the C ABI, malloc a C array of raw pointers items_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(items)))) defer C.free(unsafe.Pointer(items_CArray)) for i := range items { - items_i_ms := miqt_strdupg(items[i]) + items_i_ms := libmiqt.Strdupg(items[i]) defer C.free(items_i_ms) items_CArray[i] = (*C.struct_miqt_string)(items_i_ms) } @@ -766,15 +774,15 @@ func QInputDialog_GetItem8(parent *QWidget, title string, label string, items [] } func QInputDialog_GetItem9(parent *QWidget, title string, label string, items []string, current int, editable bool, ok *bool, flags WindowType, inputMethodHints InputMethodHint) string { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) // For the C ABI, malloc a C array of raw pointers items_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(items)))) defer C.free(unsafe.Pointer(items_CArray)) for i := range items { - items_i_ms := miqt_strdupg(items[i]) + items_i_ms := libmiqt.Strdupg(items[i]) defer C.free(items_i_ms) items_CArray[i] = (*C.struct_miqt_string)(items_i_ms) } @@ -787,97 +795,97 @@ func QInputDialog_GetItem9(parent *QWidget, title string, label string, items [] } func QInputDialog_GetInt4(parent *QWidget, title string, label string, value int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QInputDialog_GetInt4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(value))) } func QInputDialog_GetInt5(parent *QWidget, title string, label string, value int, minValue int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QInputDialog_GetInt5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(value), (C.int)(minValue))) } func QInputDialog_GetInt6(parent *QWidget, title string, label string, value int, minValue int, maxValue int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QInputDialog_GetInt6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(value), (C.int)(minValue), (C.int)(maxValue))) } func QInputDialog_GetInt7(parent *QWidget, title string, label string, value int, minValue int, maxValue int, step int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QInputDialog_GetInt7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(value), (C.int)(minValue), (C.int)(maxValue), (C.int)(step))) } func QInputDialog_GetInt8(parent *QWidget, title string, label string, value int, minValue int, maxValue int, step int, ok *bool) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QInputDialog_GetInt8(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(value), (C.int)(minValue), (C.int)(maxValue), (C.int)(step), (*C.bool)(unsafe.Pointer(ok)))) } func QInputDialog_GetInt9(parent *QWidget, title string, label string, value int, minValue int, maxValue int, step int, ok *bool, flags WindowType) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QInputDialog_GetInt9(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.int)(value), (C.int)(minValue), (C.int)(maxValue), (C.int)(step), (*C.bool)(unsafe.Pointer(ok)), (C.int)(flags))) } func QInputDialog_GetDouble4(parent *QWidget, title string, label string, value float64) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.double)(value))) } func QInputDialog_GetDouble5(parent *QWidget, title string, label string, value float64, minValue float64) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.double)(value), (C.double)(minValue))) } func QInputDialog_GetDouble6(parent *QWidget, title string, label string, value float64, minValue float64, maxValue float64) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.double)(value), (C.double)(minValue), (C.double)(maxValue))) } func QInputDialog_GetDouble7(parent *QWidget, title string, label string, value float64, minValue float64, maxValue float64, decimals int) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.double)(value), (C.double)(minValue), (C.double)(maxValue), (C.int)(decimals))) } func QInputDialog_GetDouble8(parent *QWidget, title string, label string, value float64, minValue float64, maxValue float64, decimals int, ok *bool) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble8(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.double)(value), (C.double)(minValue), (C.double)(maxValue), (C.int)(decimals), (*C.bool)(unsafe.Pointer(ok)))) } func QInputDialog_GetDouble9(parent *QWidget, title string, label string, value float64, minValue float64, maxValue float64, decimals int, ok *bool, flags WindowType) float64 { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (float64)(C.QInputDialog_GetDouble9(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(label_ms), (C.double)(value), (C.double)(minValue), (C.double)(maxValue), (C.int)(decimals), (*C.bool)(unsafe.Pointer(ok)), (C.int)(flags))) } diff --git a/qt/gen_qinputdialog.h b/qt/gen_qinputdialog.h index b1c056c7..2c4db6f5 100644 --- a/qt/gen_qinputdialog.h +++ b/qt/gen_qinputdialog.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qinputmethod.cpp b/qt/gen_qinputmethod.cpp index e3aebf8b..ef8b3699 100644 --- a/qt/gen_qinputmethod.cpp +++ b/qt/gen_qinputmethod.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qinputmethod.h" +#include #include "gen_qinputmethod.h" #include "_cgo_export.h" diff --git a/qt/gen_qinputmethod.go b/qt/gen_qinputmethod.go index 4699a92b..95ea4592 100644 --- a/qt/gen_qinputmethod.go +++ b/qt/gen_qinputmethod.go @@ -32,19 +32,26 @@ func (this *QInputMethod) cPointer() *C.QInputMethod { return this.h } +func (this *QInputMethod) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQInputMethod(h *C.QInputMethod) *QInputMethod { if h == nil { return nil } - return &QInputMethod{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QInputMethod{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQInputMethod_U(h unsafe.Pointer) *QInputMethod { +func UnsafeNewQInputMethod(h unsafe.Pointer) *QInputMethod { return newQInputMethod((*C.QInputMethod)(h)) } func (this *QInputMethod) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QInputMethod_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QInputMethod_MetaObject(this.h))) } func (this *QInputMethod) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qinputmethod.h b/qt/gen_qinputmethod.h index 63f6e385..4a4640d8 100644 --- a/qt/gen_qinputmethod.h +++ b/qt/gen_qinputmethod.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qiodevice.cpp b/qt/gen_qiodevice.cpp index 1b2a6b68..3f109206 100644 --- a/qt/gen_qiodevice.cpp +++ b/qt/gen_qiodevice.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qiodevice.h" +#include #include "gen_qiodevice.h" #include "_cgo_export.h" diff --git a/qt/gen_qiodevice.go b/qt/gen_qiodevice.go index 8e08d55a..b5557aa4 100644 --- a/qt/gen_qiodevice.go +++ b/qt/gen_qiodevice.go @@ -41,19 +41,26 @@ func (this *QIODevice) cPointer() *C.QIODevice { return this.h } +func (this *QIODevice) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIODevice(h *C.QIODevice) *QIODevice { if h == nil { return nil } - return &QIODevice{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QIODevice{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQIODevice_U(h unsafe.Pointer) *QIODevice { +func UnsafeNewQIODevice(h unsafe.Pointer) *QIODevice { return newQIODevice((*C.QIODevice)(h)) } func (this *QIODevice) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QIODevice_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QIODevice_MetaObject(this.h))) } func (this *QIODevice) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qiodevice.h b/qt/gen_qiodevice.h index 7135a25f..2630866c 100644 --- a/qt/gen_qiodevice.h +++ b/qt/gen_qiodevice.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qitemdelegate.cpp b/qt/gen_qitemdelegate.cpp index f4dbc1ec..89dd2818 100644 --- a/qt/gen_qitemdelegate.cpp +++ b/qt/gen_qitemdelegate.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qitemdelegate.h" +#include #include "gen_qitemdelegate.h" #include "_cgo_export.h" diff --git a/qt/gen_qitemdelegate.go b/qt/gen_qitemdelegate.go index 4b50f5b6..0158692d 100644 --- a/qt/gen_qitemdelegate.go +++ b/qt/gen_qitemdelegate.go @@ -25,14 +25,21 @@ func (this *QItemDelegate) cPointer() *C.QItemDelegate { return this.h } +func (this *QItemDelegate) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQItemDelegate(h *C.QItemDelegate) *QItemDelegate { if h == nil { return nil } - return &QItemDelegate{h: h, QAbstractItemDelegate: newQAbstractItemDelegate_U(unsafe.Pointer(h))} + return &QItemDelegate{h: h, QAbstractItemDelegate: UnsafeNewQAbstractItemDelegate(unsafe.Pointer(h))} } -func newQItemDelegate_U(h unsafe.Pointer) *QItemDelegate { +func UnsafeNewQItemDelegate(h unsafe.Pointer) *QItemDelegate { return newQItemDelegate((*C.QItemDelegate)(h)) } @@ -49,7 +56,7 @@ func NewQItemDelegate2(parent *QObject) *QItemDelegate { } func (this *QItemDelegate) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QItemDelegate_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QItemDelegate_MetaObject(this.h))) } func (this *QItemDelegate) Metacast(param1 string) unsafe.Pointer { @@ -96,7 +103,7 @@ func (this *QItemDelegate) SizeHint(option *QStyleOptionViewItem, index *QModelI } func (this *QItemDelegate) CreateEditor(parent *QWidget, option *QStyleOptionViewItem, index *QModelIndex) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QItemDelegate_CreateEditor(this.h, parent.cPointer(), option.cPointer(), index.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QItemDelegate_CreateEditor(this.h, parent.cPointer(), option.cPointer(), index.cPointer()))) } func (this *QItemDelegate) SetEditorData(editor *QWidget, index *QModelIndex) { @@ -112,7 +119,7 @@ func (this *QItemDelegate) UpdateEditorGeometry(editor *QWidget, option *QStyleO } func (this *QItemDelegate) ItemEditorFactory() *QItemEditorFactory { - return newQItemEditorFactory_U(unsafe.Pointer(C.QItemDelegate_ItemEditorFactory(this.h))) + return UnsafeNewQItemEditorFactory(unsafe.Pointer(C.QItemDelegate_ItemEditorFactory(this.h))) } func (this *QItemDelegate) SetItemEditorFactory(factory *QItemEditorFactory) { diff --git a/qt/gen_qitemdelegate.h b/qt/gen_qitemdelegate.h index f51043d4..5781fd8b 100644 --- a/qt/gen_qitemdelegate.h +++ b/qt/gen_qitemdelegate.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qitemeditorfactory.cpp b/qt/gen_qitemeditorfactory.cpp index 5bea45fd..41d40b50 100644 --- a/qt/gen_qitemeditorfactory.cpp +++ b/qt/gen_qitemeditorfactory.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qitemeditorfactory.h" +#include #include "gen_qitemeditorfactory.h" #include "_cgo_export.h" diff --git a/qt/gen_qitemeditorfactory.go b/qt/gen_qitemeditorfactory.go index fc4e6d04..36c4d5d1 100644 --- a/qt/gen_qitemeditorfactory.go +++ b/qt/gen_qitemeditorfactory.go @@ -24,6 +24,13 @@ func (this *QItemEditorCreatorBase) cPointer() *C.QItemEditorCreatorBase { return this.h } +func (this *QItemEditorCreatorBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQItemEditorCreatorBase(h *C.QItemEditorCreatorBase) *QItemEditorCreatorBase { if h == nil { return nil @@ -31,12 +38,12 @@ func newQItemEditorCreatorBase(h *C.QItemEditorCreatorBase) *QItemEditorCreatorB return &QItemEditorCreatorBase{h: h} } -func newQItemEditorCreatorBase_U(h unsafe.Pointer) *QItemEditorCreatorBase { +func UnsafeNewQItemEditorCreatorBase(h unsafe.Pointer) *QItemEditorCreatorBase { return newQItemEditorCreatorBase((*C.QItemEditorCreatorBase)(h)) } func (this *QItemEditorCreatorBase) CreateWidget(parent *QWidget) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QItemEditorCreatorBase_CreateWidget(this.h, parent.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QItemEditorCreatorBase_CreateWidget(this.h, parent.cPointer()))) } func (this *QItemEditorCreatorBase) ValuePropertyName() *QByteArray { @@ -75,6 +82,13 @@ func (this *QItemEditorFactory) cPointer() *C.QItemEditorFactory { return this.h } +func (this *QItemEditorFactory) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQItemEditorFactory(h *C.QItemEditorFactory) *QItemEditorFactory { if h == nil { return nil @@ -82,7 +96,7 @@ func newQItemEditorFactory(h *C.QItemEditorFactory) *QItemEditorFactory { return &QItemEditorFactory{h: h} } -func newQItemEditorFactory_U(h unsafe.Pointer) *QItemEditorFactory { +func UnsafeNewQItemEditorFactory(h unsafe.Pointer) *QItemEditorFactory { return newQItemEditorFactory((*C.QItemEditorFactory)(h)) } @@ -99,7 +113,7 @@ func NewQItemEditorFactory2(param1 *QItemEditorFactory) *QItemEditorFactory { } func (this *QItemEditorFactory) CreateEditor(userType int, parent *QWidget) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QItemEditorFactory_CreateEditor(this.h, (C.int)(userType), parent.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QItemEditorFactory_CreateEditor(this.h, (C.int)(userType), parent.cPointer()))) } func (this *QItemEditorFactory) ValuePropertyName(userType int) *QByteArray { @@ -114,7 +128,7 @@ func (this *QItemEditorFactory) RegisterEditor(userType int, creator *QItemEdito } func QItemEditorFactory_DefaultFactory() *QItemEditorFactory { - return newQItemEditorFactory_U(unsafe.Pointer(C.QItemEditorFactory_DefaultFactory())) + return UnsafeNewQItemEditorFactory(unsafe.Pointer(C.QItemEditorFactory_DefaultFactory())) } func QItemEditorFactory_SetDefaultFactory(factory *QItemEditorFactory) { diff --git a/qt/gen_qitemeditorfactory.h b/qt/gen_qitemeditorfactory.h index 030e2dfc..5d3153f7 100644 --- a/qt/gen_qitemeditorfactory.h +++ b/qt/gen_qitemeditorfactory.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qitemselectionmodel.cpp b/qt/gen_qitemselectionmodel.cpp index af831e37..9dc41dfb 100644 --- a/qt/gen_qitemselectionmodel.cpp +++ b/qt/gen_qitemselectionmodel.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qitemselectionmodel.h" +#include #include "gen_qitemselectionmodel.h" #include "_cgo_export.h" diff --git a/qt/gen_qitemselectionmodel.go b/qt/gen_qitemselectionmodel.go index 76153129..fff54c40 100644 --- a/qt/gen_qitemselectionmodel.go +++ b/qt/gen_qitemselectionmodel.go @@ -41,6 +41,13 @@ func (this *QItemSelectionRange) cPointer() *C.QItemSelectionRange { return this.h } +func (this *QItemSelectionRange) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQItemSelectionRange(h *C.QItemSelectionRange) *QItemSelectionRange { if h == nil { return nil @@ -48,7 +55,7 @@ func newQItemSelectionRange(h *C.QItemSelectionRange) *QItemSelectionRange { return &QItemSelectionRange{h: h} } -func newQItemSelectionRange_U(h unsafe.Pointer) *QItemSelectionRange { +func UnsafeNewQItemSelectionRange(h unsafe.Pointer) *QItemSelectionRange { return newQItemSelectionRange((*C.QItemSelectionRange)(h)) } @@ -109,11 +116,11 @@ func (this *QItemSelectionRange) Height() int { } func (this *QItemSelectionRange) TopLeft() *QPersistentModelIndex { - return newQPersistentModelIndex_U(unsafe.Pointer(C.QItemSelectionRange_TopLeft(this.h))) + return UnsafeNewQPersistentModelIndex(unsafe.Pointer(C.QItemSelectionRange_TopLeft(this.h))) } func (this *QItemSelectionRange) BottomRight() *QPersistentModelIndex { - return newQPersistentModelIndex_U(unsafe.Pointer(C.QItemSelectionRange_BottomRight(this.h))) + return UnsafeNewQPersistentModelIndex(unsafe.Pointer(C.QItemSelectionRange_BottomRight(this.h))) } func (this *QItemSelectionRange) Parent() *QModelIndex { @@ -124,7 +131,7 @@ func (this *QItemSelectionRange) Parent() *QModelIndex { } func (this *QItemSelectionRange) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QItemSelectionRange_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QItemSelectionRange_Model(this.h))) } func (this *QItemSelectionRange) Contains(index *QModelIndex) bool { @@ -206,14 +213,21 @@ func (this *QItemSelectionModel) cPointer() *C.QItemSelectionModel { return this.h } +func (this *QItemSelectionModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQItemSelectionModel(h *C.QItemSelectionModel) *QItemSelectionModel { if h == nil { return nil } - return &QItemSelectionModel{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QItemSelectionModel{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQItemSelectionModel_U(h unsafe.Pointer) *QItemSelectionModel { +func UnsafeNewQItemSelectionModel(h unsafe.Pointer) *QItemSelectionModel { return newQItemSelectionModel((*C.QItemSelectionModel)(h)) } @@ -236,7 +250,7 @@ func NewQItemSelectionModel3(model *QAbstractItemModel) *QItemSelectionModel { } func (this *QItemSelectionModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QItemSelectionModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QItemSelectionModel_MetaObject(this.h))) } func (this *QItemSelectionModel) Metacast(param1 string) unsafe.Pointer { @@ -337,11 +351,11 @@ func (this *QItemSelectionModel) SelectedColumns() []QModelIndex { } func (this *QItemSelectionModel) Model() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QItemSelectionModel_Model(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QItemSelectionModel_Model(this.h))) } func (this *QItemSelectionModel) Model2() *QAbstractItemModel { - return newQAbstractItemModel_U(unsafe.Pointer(C.QItemSelectionModel_Model2(this.h))) + return UnsafeNewQAbstractItemModel(unsafe.Pointer(C.QItemSelectionModel_Model2(this.h))) } func (this *QItemSelectionModel) SetModel(model *QAbstractItemModel) { @@ -387,8 +401,8 @@ func miqt_exec_callback_QItemSelectionModel_CurrentChanged(cb C.intptr_t, curren } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(current)) - slotval2 := newQModelIndex_U(unsafe.Pointer(previous)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(current)) + slotval2 := UnsafeNewQModelIndex(unsafe.Pointer(previous)) gofunc(slotval1, slotval2) } @@ -408,8 +422,8 @@ func miqt_exec_callback_QItemSelectionModel_CurrentRowChanged(cb C.intptr_t, cur } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(current)) - slotval2 := newQModelIndex_U(unsafe.Pointer(previous)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(current)) + slotval2 := UnsafeNewQModelIndex(unsafe.Pointer(previous)) gofunc(slotval1, slotval2) } @@ -429,8 +443,8 @@ func miqt_exec_callback_QItemSelectionModel_CurrentColumnChanged(cb C.intptr_t, } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(current)) - slotval2 := newQModelIndex_U(unsafe.Pointer(previous)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(current)) + slotval2 := UnsafeNewQModelIndex(unsafe.Pointer(previous)) gofunc(slotval1, slotval2) } @@ -450,7 +464,7 @@ func miqt_exec_callback_QItemSelectionModel_ModelChanged(cb C.intptr_t, model *C } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractItemModel_U(unsafe.Pointer(model)) + slotval1 := UnsafeNewQAbstractItemModel(unsafe.Pointer(model)) gofunc(slotval1) } diff --git a/qt/gen_qitemselectionmodel.h b/qt/gen_qitemselectionmodel.h index 6cb27f02..19c5b0ef 100644 --- a/qt/gen_qitemselectionmodel.h +++ b/qt/gen_qitemselectionmodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qjsonarray.cpp b/qt/gen_qjsonarray.cpp index 14d8c1d7..3141aed0 100644 --- a/qt/gen_qjsonarray.cpp +++ b/qt/gen_qjsonarray.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qjsonarray.h" +#include #include "gen_qjsonarray.h" #include "_cgo_export.h" @@ -26,7 +26,7 @@ void QJsonArray_OperatorAssign(QJsonArray* self, QJsonArray* other) { } QJsonArray* QJsonArray_FromStringList(struct miqt_array* /* of struct miqt_string* */ list) { - QList list_QList; + QStringList list_QList; list_QList.reserve(list->len); struct miqt_string** list_arr = static_cast(list->data); for(size_t i = 0; i < list->len; ++i) { diff --git a/qt/gen_qjsonarray.go b/qt/gen_qjsonarray.go index b624ea7b..fbfd189e 100644 --- a/qt/gen_qjsonarray.go +++ b/qt/gen_qjsonarray.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QJsonArray) cPointer() *C.QJsonArray { return this.h } +func (this *QJsonArray) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonArray(h *C.QJsonArray) *QJsonArray { if h == nil { return nil @@ -31,7 +39,7 @@ func newQJsonArray(h *C.QJsonArray) *QJsonArray { return &QJsonArray{h: h} } -func newQJsonArray_U(h unsafe.Pointer) *QJsonArray { +func UnsafeNewQJsonArray(h unsafe.Pointer) *QJsonArray { return newQJsonArray((*C.QJsonArray)(h)) } @@ -56,7 +64,7 @@ func QJsonArray_FromStringList(list []string) *QJsonArray { list_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(list)))) defer C.free(unsafe.Pointer(list_CArray)) for i := range list { - list_i_ms := miqt_strdupg(list[i]) + list_i_ms := libmiqt.Strdupg(list[i]) defer C.free(list_i_ms) list_CArray[i] = (*C.struct_miqt_string)(list_i_ms) } @@ -244,11 +252,11 @@ func (this *QJsonArray) OperatorPlus(v *QJsonValue) *QJsonArray { } func (this *QJsonArray) OperatorPlusAssign(v *QJsonValue) *QJsonArray { - return newQJsonArray_U(unsafe.Pointer(C.QJsonArray_OperatorPlusAssign(this.h, v.cPointer()))) + return UnsafeNewQJsonArray(unsafe.Pointer(C.QJsonArray_OperatorPlusAssign(this.h, v.cPointer()))) } func (this *QJsonArray) OperatorShiftLeft(v *QJsonValue) *QJsonArray { - return newQJsonArray_U(unsafe.Pointer(C.QJsonArray_OperatorShiftLeft(this.h, v.cPointer()))) + return UnsafeNewQJsonArray(unsafe.Pointer(C.QJsonArray_OperatorShiftLeft(this.h, v.cPointer()))) } func (this *QJsonArray) PushBack(t *QJsonValue) { @@ -296,6 +304,13 @@ func (this *QJsonArray__iterator) cPointer() *C.QJsonArray__iterator { return this.h } +func (this *QJsonArray__iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonArray__iterator(h *C.QJsonArray__iterator) *QJsonArray__iterator { if h == nil { return nil @@ -303,7 +318,7 @@ func newQJsonArray__iterator(h *C.QJsonArray__iterator) *QJsonArray__iterator { return &QJsonArray__iterator{h: h} } -func newQJsonArray__iterator_U(h unsafe.Pointer) *QJsonArray__iterator { +func UnsafeNewQJsonArray__iterator(h unsafe.Pointer) *QJsonArray__iterator { return newQJsonArray__iterator((*C.QJsonArray__iterator)(h)) } @@ -395,7 +410,7 @@ func (this *QJsonArray__iterator) OperatorGreaterOrEqualWithOther(other *QJsonAr } func (this *QJsonArray__iterator) OperatorPlusPlus() *QJsonArray__iterator { - return newQJsonArray__iterator_U(unsafe.Pointer(C.QJsonArray__iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQJsonArray__iterator(unsafe.Pointer(C.QJsonArray__iterator_OperatorPlusPlus(this.h))) } func (this *QJsonArray__iterator) OperatorPlusPlusWithInt(param1 int) *QJsonArray__iterator { @@ -406,7 +421,7 @@ func (this *QJsonArray__iterator) OperatorPlusPlusWithInt(param1 int) *QJsonArra } func (this *QJsonArray__iterator) OperatorMinusMinus() *QJsonArray__iterator { - return newQJsonArray__iterator_U(unsafe.Pointer(C.QJsonArray__iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQJsonArray__iterator(unsafe.Pointer(C.QJsonArray__iterator_OperatorMinusMinus(this.h))) } func (this *QJsonArray__iterator) OperatorMinusMinusWithInt(param1 int) *QJsonArray__iterator { @@ -417,11 +432,11 @@ func (this *QJsonArray__iterator) OperatorMinusMinusWithInt(param1 int) *QJsonAr } func (this *QJsonArray__iterator) OperatorPlusAssign(j int) *QJsonArray__iterator { - return newQJsonArray__iterator_U(unsafe.Pointer(C.QJsonArray__iterator_OperatorPlusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonArray__iterator(unsafe.Pointer(C.QJsonArray__iterator_OperatorPlusAssign(this.h, (C.int)(j)))) } func (this *QJsonArray__iterator) OperatorMinusAssign(j int) *QJsonArray__iterator { - return newQJsonArray__iterator_U(unsafe.Pointer(C.QJsonArray__iterator_OperatorMinusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonArray__iterator(unsafe.Pointer(C.QJsonArray__iterator_OperatorMinusAssign(this.h, (C.int)(j)))) } func (this *QJsonArray__iterator) OperatorPlus(j int) *QJsonArray__iterator { @@ -467,6 +482,13 @@ func (this *QJsonArray__const_iterator) cPointer() *C.QJsonArray__const_iterator return this.h } +func (this *QJsonArray__const_iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonArray__const_iterator(h *C.QJsonArray__const_iterator) *QJsonArray__const_iterator { if h == nil { return nil @@ -474,7 +496,7 @@ func newQJsonArray__const_iterator(h *C.QJsonArray__const_iterator) *QJsonArray_ return &QJsonArray__const_iterator{h: h} } -func newQJsonArray__const_iterator_U(h unsafe.Pointer) *QJsonArray__const_iterator { +func UnsafeNewQJsonArray__const_iterator(h unsafe.Pointer) *QJsonArray__const_iterator { return newQJsonArray__const_iterator((*C.QJsonArray__const_iterator)(h)) } @@ -548,7 +570,7 @@ func (this *QJsonArray__const_iterator) OperatorGreaterOrEqual(other *QJsonArray } func (this *QJsonArray__const_iterator) OperatorPlusPlus() *QJsonArray__const_iterator { - return newQJsonArray__const_iterator_U(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQJsonArray__const_iterator(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorPlusPlus(this.h))) } func (this *QJsonArray__const_iterator) OperatorPlusPlusWithInt(param1 int) *QJsonArray__const_iterator { @@ -559,7 +581,7 @@ func (this *QJsonArray__const_iterator) OperatorPlusPlusWithInt(param1 int) *QJs } func (this *QJsonArray__const_iterator) OperatorMinusMinus() *QJsonArray__const_iterator { - return newQJsonArray__const_iterator_U(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQJsonArray__const_iterator(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorMinusMinus(this.h))) } func (this *QJsonArray__const_iterator) OperatorMinusMinusWithInt(param1 int) *QJsonArray__const_iterator { @@ -570,11 +592,11 @@ func (this *QJsonArray__const_iterator) OperatorMinusMinusWithInt(param1 int) *Q } func (this *QJsonArray__const_iterator) OperatorPlusAssign(j int) *QJsonArray__const_iterator { - return newQJsonArray__const_iterator_U(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonArray__const_iterator(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) } func (this *QJsonArray__const_iterator) OperatorMinusAssign(j int) *QJsonArray__const_iterator { - return newQJsonArray__const_iterator_U(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonArray__const_iterator(unsafe.Pointer(C.QJsonArray__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) } func (this *QJsonArray__const_iterator) OperatorPlus(j int) *QJsonArray__const_iterator { diff --git a/qt/gen_qjsonarray.h b/qt/gen_qjsonarray.h index b205336c..246747fe 100644 --- a/qt/gen_qjsonarray.h +++ b/qt/gen_qjsonarray.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qjsondocument.cpp b/qt/gen_qjsondocument.cpp index ee390d3a..0b59a3d3 100644 --- a/qt/gen_qjsondocument.cpp +++ b/qt/gen_qjsondocument.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qjsondocument.h" +#include #include "gen_qjsondocument.h" #include "_cgo_export.h" diff --git a/qt/gen_qjsondocument.go b/qt/gen_qjsondocument.go index 74591239..e88001fc 100644 --- a/qt/gen_qjsondocument.go +++ b/qt/gen_qjsondocument.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -58,6 +59,13 @@ func (this *QJsonParseError) cPointer() *C.QJsonParseError { return this.h } +func (this *QJsonParseError) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonParseError(h *C.QJsonParseError) *QJsonParseError { if h == nil { return nil @@ -65,7 +73,7 @@ func newQJsonParseError(h *C.QJsonParseError) *QJsonParseError { return &QJsonParseError{h: h} } -func newQJsonParseError_U(h unsafe.Pointer) *QJsonParseError { +func UnsafeNewQJsonParseError(h unsafe.Pointer) *QJsonParseError { return newQJsonParseError((*C.QJsonParseError)(h)) } @@ -101,6 +109,13 @@ func (this *QJsonDocument) cPointer() *C.QJsonDocument { return this.h } +func (this *QJsonDocument) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonDocument(h *C.QJsonDocument) *QJsonDocument { if h == nil { return nil @@ -108,7 +123,7 @@ func newQJsonDocument(h *C.QJsonDocument) *QJsonDocument { return &QJsonDocument{h: h} } -func newQJsonDocument_U(h unsafe.Pointer) *QJsonDocument { +func UnsafeNewQJsonDocument(h unsafe.Pointer) *QJsonDocument { return newQJsonDocument((*C.QJsonDocument)(h)) } @@ -242,7 +257,7 @@ func (this *QJsonDocument) SetArray(array *QJsonArray) { } func (this *QJsonDocument) OperatorSubscript(key string) *QJsonValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonDocument_OperatorSubscript(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonValue(_ret) diff --git a/qt/gen_qjsondocument.h b/qt/gen_qjsondocument.h index 354c9d97..582bc43e 100644 --- a/qt/gen_qjsondocument.h +++ b/qt/gen_qjsondocument.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qjsonobject.cpp b/qt/gen_qjsonobject.cpp index c372dbff..4a9fa4d5 100644 --- a/qt/gen_qjsonobject.cpp +++ b/qt/gen_qjsonobject.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qjsonobject.h" +#include #include "gen_qjsonobject.h" #include "_cgo_export.h" diff --git a/qt/gen_qjsonobject.go b/qt/gen_qjsonobject.go index 32b0ff12..f894d956 100644 --- a/qt/gen_qjsonobject.go +++ b/qt/gen_qjsonobject.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QJsonObject) cPointer() *C.QJsonObject { return this.h } +func (this *QJsonObject) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonObject(h *C.QJsonObject) *QJsonObject { if h == nil { return nil @@ -31,7 +39,7 @@ func newQJsonObject(h *C.QJsonObject) *QJsonObject { return &QJsonObject{h: h} } -func newQJsonObject_U(h unsafe.Pointer) *QJsonObject { +func UnsafeNewQJsonObject(h unsafe.Pointer) *QJsonObject { return newQJsonObject((*C.QJsonObject)(h)) } @@ -86,7 +94,7 @@ func (this *QJsonObject) IsEmpty() bool { } func (this *QJsonObject) Value(key string) *QJsonValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_Value(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonValue(_ret) @@ -95,7 +103,7 @@ func (this *QJsonObject) Value(key string) *QJsonValue { } func (this *QJsonObject) OperatorSubscript(key string) *QJsonValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_OperatorSubscript(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonValue(_ret) @@ -104,7 +112,7 @@ func (this *QJsonObject) OperatorSubscript(key string) *QJsonValue { } func (this *QJsonObject) OperatorSubscriptWithKey(key string) *QJsonValueRef { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_OperatorSubscriptWithKey(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonValueRef(_ret) @@ -113,13 +121,13 @@ func (this *QJsonObject) OperatorSubscriptWithKey(key string) *QJsonValueRef { } func (this *QJsonObject) Remove(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QJsonObject_Remove(this.h, (*C.struct_miqt_string)(key_ms)) } func (this *QJsonObject) Take(key string) *QJsonValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_Take(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonValue(_ret) @@ -128,7 +136,7 @@ func (this *QJsonObject) Take(key string) *QJsonValue { } func (this *QJsonObject) Contains(key string) bool { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) return (bool)(C.QJsonObject_Contains(this.h, (*C.struct_miqt_string)(key_ms))) } @@ -191,7 +199,7 @@ func (this *QJsonObject) Erase(it QJsonObject__iterator) *QJsonObject__iterator } func (this *QJsonObject) Find(key string) *QJsonObject__iterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_Find(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonObject__iterator(_ret) @@ -200,7 +208,7 @@ func (this *QJsonObject) Find(key string) *QJsonObject__iterator { } func (this *QJsonObject) FindWithKey(key string) *QJsonObject__const_iterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_FindWithKey(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonObject__const_iterator(_ret) @@ -209,7 +217,7 @@ func (this *QJsonObject) FindWithKey(key string) *QJsonObject__const_iterator { } func (this *QJsonObject) ConstFind(key string) *QJsonObject__const_iterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_ConstFind(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonObject__const_iterator(_ret) @@ -218,7 +226,7 @@ func (this *QJsonObject) ConstFind(key string) *QJsonObject__const_iterator { } func (this *QJsonObject) Insert(key string, value *QJsonValue) *QJsonObject__iterator { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonObject_Insert(this.h, (*C.struct_miqt_string)(key_ms), value.cPointer()) _goptr := newQJsonObject__iterator(_ret) @@ -255,6 +263,13 @@ func (this *QJsonObject__iterator) cPointer() *C.QJsonObject__iterator { return this.h } +func (this *QJsonObject__iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonObject__iterator(h *C.QJsonObject__iterator) *QJsonObject__iterator { if h == nil { return nil @@ -262,7 +277,7 @@ func newQJsonObject__iterator(h *C.QJsonObject__iterator) *QJsonObject__iterator return &QJsonObject__iterator{h: h} } -func newQJsonObject__iterator_U(h unsafe.Pointer) *QJsonObject__iterator { +func UnsafeNewQJsonObject__iterator(h unsafe.Pointer) *QJsonObject__iterator { return newQJsonObject__iterator((*C.QJsonObject__iterator)(h)) } @@ -344,7 +359,7 @@ func (this *QJsonObject__iterator) OperatorGreaterOrEqual(other *QJsonObject__it } func (this *QJsonObject__iterator) OperatorPlusPlus() *QJsonObject__iterator { - return newQJsonObject__iterator_U(unsafe.Pointer(C.QJsonObject__iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQJsonObject__iterator(unsafe.Pointer(C.QJsonObject__iterator_OperatorPlusPlus(this.h))) } func (this *QJsonObject__iterator) OperatorPlusPlusWithInt(param1 int) *QJsonObject__iterator { @@ -355,7 +370,7 @@ func (this *QJsonObject__iterator) OperatorPlusPlusWithInt(param1 int) *QJsonObj } func (this *QJsonObject__iterator) OperatorMinusMinus() *QJsonObject__iterator { - return newQJsonObject__iterator_U(unsafe.Pointer(C.QJsonObject__iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQJsonObject__iterator(unsafe.Pointer(C.QJsonObject__iterator_OperatorMinusMinus(this.h))) } func (this *QJsonObject__iterator) OperatorMinusMinusWithInt(param1 int) *QJsonObject__iterator { @@ -380,11 +395,11 @@ func (this *QJsonObject__iterator) OperatorMinus(j int) *QJsonObject__iterator { } func (this *QJsonObject__iterator) OperatorPlusAssign(j int) *QJsonObject__iterator { - return newQJsonObject__iterator_U(unsafe.Pointer(C.QJsonObject__iterator_OperatorPlusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonObject__iterator(unsafe.Pointer(C.QJsonObject__iterator_OperatorPlusAssign(this.h, (C.int)(j)))) } func (this *QJsonObject__iterator) OperatorMinusAssign(j int) *QJsonObject__iterator { - return newQJsonObject__iterator_U(unsafe.Pointer(C.QJsonObject__iterator_OperatorMinusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonObject__iterator(unsafe.Pointer(C.QJsonObject__iterator_OperatorMinusAssign(this.h, (C.int)(j)))) } func (this *QJsonObject__iterator) OperatorMinusWithQJsonObjectiterator(j QJsonObject__iterator) int { @@ -440,6 +455,13 @@ func (this *QJsonObject__const_iterator) cPointer() *C.QJsonObject__const_iterat return this.h } +func (this *QJsonObject__const_iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonObject__const_iterator(h *C.QJsonObject__const_iterator) *QJsonObject__const_iterator { if h == nil { return nil @@ -447,7 +469,7 @@ func newQJsonObject__const_iterator(h *C.QJsonObject__const_iterator) *QJsonObje return &QJsonObject__const_iterator{h: h} } -func newQJsonObject__const_iterator_U(h unsafe.Pointer) *QJsonObject__const_iterator { +func UnsafeNewQJsonObject__const_iterator(h unsafe.Pointer) *QJsonObject__const_iterator { return newQJsonObject__const_iterator((*C.QJsonObject__const_iterator)(h)) } @@ -535,7 +557,7 @@ func (this *QJsonObject__const_iterator) OperatorGreaterOrEqual(other *QJsonObje } func (this *QJsonObject__const_iterator) OperatorPlusPlus() *QJsonObject__const_iterator { - return newQJsonObject__const_iterator_U(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQJsonObject__const_iterator(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorPlusPlus(this.h))) } func (this *QJsonObject__const_iterator) OperatorPlusPlusWithInt(param1 int) *QJsonObject__const_iterator { @@ -546,7 +568,7 @@ func (this *QJsonObject__const_iterator) OperatorPlusPlusWithInt(param1 int) *QJ } func (this *QJsonObject__const_iterator) OperatorMinusMinus() *QJsonObject__const_iterator { - return newQJsonObject__const_iterator_U(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQJsonObject__const_iterator(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorMinusMinus(this.h))) } func (this *QJsonObject__const_iterator) OperatorMinusMinusWithInt(param1 int) *QJsonObject__const_iterator { @@ -571,11 +593,11 @@ func (this *QJsonObject__const_iterator) OperatorMinus(j int) *QJsonObject__cons } func (this *QJsonObject__const_iterator) OperatorPlusAssign(j int) *QJsonObject__const_iterator { - return newQJsonObject__const_iterator_U(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonObject__const_iterator(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) } func (this *QJsonObject__const_iterator) OperatorMinusAssign(j int) *QJsonObject__const_iterator { - return newQJsonObject__const_iterator_U(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) + return UnsafeNewQJsonObject__const_iterator(unsafe.Pointer(C.QJsonObject__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) } func (this *QJsonObject__const_iterator) OperatorMinusWithQJsonObjectconstIterator(j QJsonObject__const_iterator) int { diff --git a/qt/gen_qjsonobject.h b/qt/gen_qjsonobject.h index a910a15f..073cd1aa 100644 --- a/qt/gen_qjsonobject.h +++ b/qt/gen_qjsonobject.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qjsonvalue.cpp b/qt/gen_qjsonvalue.cpp index 761cbf9a..5c61f674 100644 --- a/qt/gen_qjsonvalue.cpp +++ b/qt/gen_qjsonvalue.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qjsonvalue.h" +#include #include "gen_qjsonvalue.h" #include "_cgo_export.h" diff --git a/qt/gen_qjsonvalue.go b/qt/gen_qjsonvalue.go index b70535d4..c9957d3b 100644 --- a/qt/gen_qjsonvalue.go +++ b/qt/gen_qjsonvalue.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -36,6 +37,13 @@ func (this *QJsonValue) cPointer() *C.QJsonValue { return this.h } +func (this *QJsonValue) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonValue(h *C.QJsonValue) *QJsonValue { if h == nil { return nil @@ -43,7 +51,7 @@ func newQJsonValue(h *C.QJsonValue) *QJsonValue { return &QJsonValue{h: h} } -func newQJsonValue_U(h unsafe.Pointer) *QJsonValue { +func UnsafeNewQJsonValue(h unsafe.Pointer) *QJsonValue { return newQJsonValue((*C.QJsonValue)(h)) } @@ -79,7 +87,7 @@ func NewQJsonValue5(v int64) *QJsonValue { // NewQJsonValue6 constructs a new QJsonValue object. func NewQJsonValue6(s string) *QJsonValue { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) ret := C.QJsonValue_new6((*C.struct_miqt_string)(s_ms)) return newQJsonValue(ret) @@ -191,7 +199,7 @@ func (this *QJsonValue) ToString() string { } func (this *QJsonValue) ToStringWithDefaultValue(defaultValue string) string { - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) var _ms *C.struct_miqt_string = C.QJsonValue_ToStringWithDefaultValue(this.h, (*C.struct_miqt_string)(defaultValue_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -228,7 +236,7 @@ func (this *QJsonValue) ToObjectWithDefaultValue(defaultValue *QJsonObject) *QJs } func (this *QJsonValue) OperatorSubscript(key string) *QJsonValue { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QJsonValue_OperatorSubscript(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQJsonValue(_ret) @@ -288,6 +296,13 @@ func (this *QJsonValueRef) cPointer() *C.QJsonValueRef { return this.h } +func (this *QJsonValueRef) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonValueRef(h *C.QJsonValueRef) *QJsonValueRef { if h == nil { return nil @@ -295,7 +310,7 @@ func newQJsonValueRef(h *C.QJsonValueRef) *QJsonValueRef { return &QJsonValueRef{h: h} } -func newQJsonValueRef_U(h unsafe.Pointer) *QJsonValueRef { +func UnsafeNewQJsonValueRef(h unsafe.Pointer) *QJsonValueRef { return newQJsonValueRef((*C.QJsonValueRef)(h)) } @@ -410,7 +425,7 @@ func (this *QJsonValueRef) ToDoubleWithDefaultValue(defaultValue float64) float6 } func (this *QJsonValueRef) ToStringWithDefaultValue(defaultValue string) string { - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) var _ms *C.struct_miqt_string = C.QJsonValueRef_ToStringWithDefaultValue(this.h, (*C.struct_miqt_string)(defaultValue_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -451,6 +466,13 @@ func (this *QJsonValuePtr) cPointer() *C.QJsonValuePtr { return this.h } +func (this *QJsonValuePtr) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonValuePtr(h *C.QJsonValuePtr) *QJsonValuePtr { if h == nil { return nil @@ -458,7 +480,7 @@ func newQJsonValuePtr(h *C.QJsonValuePtr) *QJsonValuePtr { return &QJsonValuePtr{h: h} } -func newQJsonValuePtr_U(h unsafe.Pointer) *QJsonValuePtr { +func UnsafeNewQJsonValuePtr(h unsafe.Pointer) *QJsonValuePtr { return newQJsonValuePtr((*C.QJsonValuePtr)(h)) } @@ -475,11 +497,11 @@ func NewQJsonValuePtr2(param1 *QJsonValuePtr) *QJsonValuePtr { } func (this *QJsonValuePtr) OperatorMultiply() *QJsonValue { - return newQJsonValue_U(unsafe.Pointer(C.QJsonValuePtr_OperatorMultiply(this.h))) + return UnsafeNewQJsonValue(unsafe.Pointer(C.QJsonValuePtr_OperatorMultiply(this.h))) } func (this *QJsonValuePtr) OperatorMinusGreater() *QJsonValue { - return newQJsonValue_U(unsafe.Pointer(C.QJsonValuePtr_OperatorMinusGreater(this.h))) + return UnsafeNewQJsonValue(unsafe.Pointer(C.QJsonValuePtr_OperatorMinusGreater(this.h))) } func (this *QJsonValuePtr) OperatorAssign(param1 *QJsonValuePtr) { @@ -511,6 +533,13 @@ func (this *QJsonValueRefPtr) cPointer() *C.QJsonValueRefPtr { return this.h } +func (this *QJsonValueRefPtr) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQJsonValueRefPtr(h *C.QJsonValueRefPtr) *QJsonValueRefPtr { if h == nil { return nil @@ -518,7 +547,7 @@ func newQJsonValueRefPtr(h *C.QJsonValueRefPtr) *QJsonValueRefPtr { return &QJsonValueRefPtr{h: h} } -func newQJsonValueRefPtr_U(h unsafe.Pointer) *QJsonValueRefPtr { +func UnsafeNewQJsonValueRefPtr(h unsafe.Pointer) *QJsonValueRefPtr { return newQJsonValueRefPtr((*C.QJsonValueRefPtr)(h)) } @@ -541,11 +570,11 @@ func NewQJsonValueRefPtr3(param1 *QJsonValueRefPtr) *QJsonValueRefPtr { } func (this *QJsonValueRefPtr) OperatorMultiply() *QJsonValueRef { - return newQJsonValueRef_U(unsafe.Pointer(C.QJsonValueRefPtr_OperatorMultiply(this.h))) + return UnsafeNewQJsonValueRef(unsafe.Pointer(C.QJsonValueRefPtr_OperatorMultiply(this.h))) } func (this *QJsonValueRefPtr) OperatorMinusGreater() *QJsonValueRef { - return newQJsonValueRef_U(unsafe.Pointer(C.QJsonValueRefPtr_OperatorMinusGreater(this.h))) + return UnsafeNewQJsonValueRef(unsafe.Pointer(C.QJsonValueRefPtr_OperatorMinusGreater(this.h))) } func (this *QJsonValueRefPtr) OperatorAssign(param1 *QJsonValueRefPtr) { diff --git a/qt/gen_qjsonvalue.h b/qt/gen_qjsonvalue.h index 43960be9..32661296 100644 --- a/qt/gen_qjsonvalue.h +++ b/qt/gen_qjsonvalue.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qkeyeventtransition.cpp b/qt/gen_qkeyeventtransition.cpp index 16928fd9..1b24f97c 100644 --- a/qt/gen_qkeyeventtransition.cpp +++ b/qt/gen_qkeyeventtransition.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qkeyeventtransition.h" +#include #include "gen_qkeyeventtransition.h" #include "_cgo_export.h" diff --git a/qt/gen_qkeyeventtransition.go b/qt/gen_qkeyeventtransition.go index bbb8345f..0b7eb406 100644 --- a/qt/gen_qkeyeventtransition.go +++ b/qt/gen_qkeyeventtransition.go @@ -25,14 +25,21 @@ func (this *QKeyEventTransition) cPointer() *C.QKeyEventTransition { return this.h } +func (this *QKeyEventTransition) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQKeyEventTransition(h *C.QKeyEventTransition) *QKeyEventTransition { if h == nil { return nil } - return &QKeyEventTransition{h: h, QEventTransition: newQEventTransition_U(unsafe.Pointer(h))} + return &QKeyEventTransition{h: h, QEventTransition: UnsafeNewQEventTransition(unsafe.Pointer(h))} } -func newQKeyEventTransition_U(h unsafe.Pointer) *QKeyEventTransition { +func UnsafeNewQKeyEventTransition(h unsafe.Pointer) *QKeyEventTransition { return newQKeyEventTransition((*C.QKeyEventTransition)(h)) } @@ -61,7 +68,7 @@ func NewQKeyEventTransition4(object *QObject, typeVal QEvent__Type, key int, sou } func (this *QKeyEventTransition) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QKeyEventTransition_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QKeyEventTransition_MetaObject(this.h))) } func (this *QKeyEventTransition) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qkeyeventtransition.h b/qt/gen_qkeyeventtransition.h index 5fe5983d..2b96878d 100644 --- a/qt/gen_qkeyeventtransition.h +++ b/qt/gen_qkeyeventtransition.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qkeysequence.cpp b/qt/gen_qkeysequence.cpp index 8345a215..22340375 100644 --- a/qt/gen_qkeysequence.cpp +++ b/qt/gen_qkeysequence.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qkeysequence.h" +#include #include "gen_qkeysequence.h" #include "_cgo_export.h" diff --git a/qt/gen_qkeysequence.go b/qt/gen_qkeysequence.go index bf6a892a..dcb2b3ed 100644 --- a/qt/gen_qkeysequence.go +++ b/qt/gen_qkeysequence.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -115,6 +116,13 @@ func (this *QKeySequence) cPointer() *C.QKeySequence { return this.h } +func (this *QKeySequence) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQKeySequence(h *C.QKeySequence) *QKeySequence { if h == nil { return nil @@ -122,7 +130,7 @@ func newQKeySequence(h *C.QKeySequence) *QKeySequence { return &QKeySequence{h: h} } -func newQKeySequence_U(h unsafe.Pointer) *QKeySequence { +func UnsafeNewQKeySequence(h unsafe.Pointer) *QKeySequence { return newQKeySequence((*C.QKeySequence)(h)) } @@ -134,7 +142,7 @@ func NewQKeySequence() *QKeySequence { // NewQKeySequence2 constructs a new QKeySequence object. func NewQKeySequence2(key string) *QKeySequence { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QKeySequence_new2((*C.struct_miqt_string)(key_ms)) return newQKeySequence(ret) @@ -160,7 +168,7 @@ func NewQKeySequence5(key QKeySequence__StandardKey) *QKeySequence { // NewQKeySequence6 constructs a new QKeySequence object. func NewQKeySequence6(key string, format QKeySequence__SequenceFormat) *QKeySequence { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QKeySequence_new6((*C.struct_miqt_string)(key_ms), (C.int)(format)) return newQKeySequence(ret) @@ -200,7 +208,7 @@ func (this *QKeySequence) ToString() string { } func QKeySequence_FromString(str string) *QKeySequence { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QKeySequence_FromString((*C.struct_miqt_string)(str_ms)) _goptr := newQKeySequence(_ret) @@ -209,7 +217,7 @@ func QKeySequence_FromString(str string) *QKeySequence { } func QKeySequence_ListFromString(str string) []QKeySequence { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ma *C.struct_miqt_array = C.QKeySequence_ListFromString((*C.struct_miqt_string)(str_ms)) _ret := make([]QKeySequence, int(_ma.len)) @@ -244,7 +252,7 @@ func (this *QKeySequence) Matches(seq *QKeySequence) QKeySequence__SequenceMatch } func QKeySequence_Mnemonic(text string) *QKeySequence { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QKeySequence_Mnemonic((*C.struct_miqt_string)(text_ms)) _goptr := newQKeySequence(_ret) @@ -314,7 +322,7 @@ func (this *QKeySequence) ToString1(format QKeySequence__SequenceFormat) string } func QKeySequence_FromString2(str string, format QKeySequence__SequenceFormat) *QKeySequence { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QKeySequence_FromString2((*C.struct_miqt_string)(str_ms), (C.int)(format)) _goptr := newQKeySequence(_ret) @@ -323,7 +331,7 @@ func QKeySequence_FromString2(str string, format QKeySequence__SequenceFormat) * } func QKeySequence_ListFromString2(str string, format QKeySequence__SequenceFormat) []QKeySequence { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ma *C.struct_miqt_array = C.QKeySequence_ListFromString2((*C.struct_miqt_string)(str_ms), (C.int)(format)) _ret := make([]QKeySequence, int(_ma.len)) diff --git a/qt/gen_qkeysequence.h b/qt/gen_qkeysequence.h index d863ae01..188241e9 100644 --- a/qt/gen_qkeysequence.h +++ b/qt/gen_qkeysequence.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qkeysequenceedit.cpp b/qt/gen_qkeysequenceedit.cpp index 298ef0de..d598260e 100644 --- a/qt/gen_qkeysequenceedit.cpp +++ b/qt/gen_qkeysequenceedit.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qkeysequenceedit.h" +#include #include "gen_qkeysequenceedit.h" #include "_cgo_export.h" diff --git a/qt/gen_qkeysequenceedit.go b/qt/gen_qkeysequenceedit.go index f0e15589..5e122d5c 100644 --- a/qt/gen_qkeysequenceedit.go +++ b/qt/gen_qkeysequenceedit.go @@ -26,14 +26,21 @@ func (this *QKeySequenceEdit) cPointer() *C.QKeySequenceEdit { return this.h } +func (this *QKeySequenceEdit) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQKeySequenceEdit(h *C.QKeySequenceEdit) *QKeySequenceEdit { if h == nil { return nil } - return &QKeySequenceEdit{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QKeySequenceEdit{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQKeySequenceEdit_U(h unsafe.Pointer) *QKeySequenceEdit { +func UnsafeNewQKeySequenceEdit(h unsafe.Pointer) *QKeySequenceEdit { return newQKeySequenceEdit((*C.QKeySequenceEdit)(h)) } @@ -62,7 +69,7 @@ func NewQKeySequenceEdit4(keySequence *QKeySequence, parent *QWidget) *QKeySeque } func (this *QKeySequenceEdit) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QKeySequenceEdit_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QKeySequenceEdit_MetaObject(this.h))) } func (this *QKeySequenceEdit) Metacast(param1 string) unsafe.Pointer { @@ -136,7 +143,7 @@ func miqt_exec_callback_QKeySequenceEdit_KeySequenceChanged(cb C.intptr_t, keySe } // Convert all CABI parameters to Go parameters - slotval1 := newQKeySequence_U(unsafe.Pointer(keySequence)) + slotval1 := UnsafeNewQKeySequence(unsafe.Pointer(keySequence)) gofunc(slotval1) } diff --git a/qt/gen_qkeysequenceedit.h b/qt/gen_qkeysequenceedit.h index d45d2daf..431b0e95 100644 --- a/qt/gen_qkeysequenceedit.h +++ b/qt/gen_qkeysequenceedit.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlabel.cpp b/qt/gen_qlabel.cpp index 1a43a5b9..e5a189b4 100644 --- a/qt/gen_qlabel.cpp +++ b/qt/gen_qlabel.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qlabel.h" +#include #include "gen_qlabel.h" #include "_cgo_export.h" diff --git a/qt/gen_qlabel.go b/qt/gen_qlabel.go index d3c4d66a..1c30e753 100644 --- a/qt/gen_qlabel.go +++ b/qt/gen_qlabel.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QLabel) cPointer() *C.QLabel { return this.h } +func (this *QLabel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLabel(h *C.QLabel) *QLabel { if h == nil { return nil } - return &QLabel{h: h, QFrame: newQFrame_U(unsafe.Pointer(h))} + return &QLabel{h: h, QFrame: UnsafeNewQFrame(unsafe.Pointer(h))} } -func newQLabel_U(h unsafe.Pointer) *QLabel { +func UnsafeNewQLabel(h unsafe.Pointer) *QLabel { return newQLabel((*C.QLabel)(h)) } @@ -45,7 +53,7 @@ func NewQLabel() *QLabel { // NewQLabel2 constructs a new QLabel object. func NewQLabel2(text string) *QLabel { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QLabel_new2((*C.struct_miqt_string)(text_ms)) return newQLabel(ret) @@ -65,7 +73,7 @@ func NewQLabel4(parent *QWidget, f WindowType) *QLabel { // NewQLabel5 constructs a new QLabel object. func NewQLabel5(text string, parent *QWidget) *QLabel { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QLabel_new5((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQLabel(ret) @@ -73,14 +81,14 @@ func NewQLabel5(text string, parent *QWidget) *QLabel { // NewQLabel6 constructs a new QLabel object. func NewQLabel6(text string, parent *QWidget, f WindowType) *QLabel { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QLabel_new6((*C.struct_miqt_string)(text_ms), parent.cPointer(), (C.int)(f)) return newQLabel(ret) } func (this *QLabel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QLabel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QLabel_MetaObject(this.h))) } func (this *QLabel) Metacast(param1 string) unsafe.Pointer { @@ -115,7 +123,7 @@ func (this *QLabel) Text() string { } func (this *QLabel) Pixmap() *QPixmap { - return newQPixmap_U(unsafe.Pointer(C.QLabel_Pixmap(this.h))) + return UnsafeNewQPixmap(unsafe.Pointer(C.QLabel_Pixmap(this.h))) } func (this *QLabel) PixmapWithQtReturnByValueConstant(param1 ReturnByValueConstant) *QPixmap { @@ -126,7 +134,7 @@ func (this *QLabel) PixmapWithQtReturnByValueConstant(param1 ReturnByValueConsta } func (this *QLabel) Picture() *QPicture { - return newQPicture_U(unsafe.Pointer(C.QLabel_Picture(this.h))) + return UnsafeNewQPicture(unsafe.Pointer(C.QLabel_Picture(this.h))) } func (this *QLabel) PictureWithQtReturnByValueConstant(param1 ReturnByValueConstant) *QPicture { @@ -137,7 +145,7 @@ func (this *QLabel) PictureWithQtReturnByValueConstant(param1 ReturnByValueConst } func (this *QLabel) Movie() *QMovie { - return newQMovie_U(unsafe.Pointer(C.QLabel_Movie(this.h))) + return UnsafeNewQMovie(unsafe.Pointer(C.QLabel_Movie(this.h))) } func (this *QLabel) TextFormat() TextFormat { @@ -207,7 +215,7 @@ func (this *QLabel) SetBuddy(buddy *QWidget) { } func (this *QLabel) Buddy() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QLabel_Buddy(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QLabel_Buddy(this.h))) } func (this *QLabel) HeightForWidth(param1 int) int { @@ -250,7 +258,7 @@ func (this *QLabel) SelectionStart() int { } func (this *QLabel) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QLabel_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -280,7 +288,7 @@ func (this *QLabel) Clear() { } func (this *QLabel) LinkActivated(link string) { - link_ms := miqt_strdupg(link) + link_ms := libmiqt.Strdupg(link) defer C.free(link_ms) C.QLabel_LinkActivated(this.h, (*C.struct_miqt_string)(link_ms)) } @@ -305,7 +313,7 @@ func miqt_exec_callback_QLabel_LinkActivated(cb C.intptr_t, link *C.struct_miqt_ } func (this *QLabel) LinkHovered(link string) { - link_ms := miqt_strdupg(link) + link_ms := libmiqt.Strdupg(link) defer C.free(link_ms) C.QLabel_LinkHovered(this.h, (*C.struct_miqt_string)(link_ms)) } diff --git a/qt/gen_qlabel.h b/qt/gen_qlabel.h index c21ac7b5..b9a23259 100644 --- a/qt/gen_qlabel.h +++ b/qt/gen_qlabel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlayout.cpp b/qt/gen_qlayout.cpp index d406e661..9800627c 100644 --- a/qt/gen_qlayout.cpp +++ b/qt/gen_qlayout.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qlayout.h" +#include #include "gen_qlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qlayout.go b/qt/gen_qlayout.go index 1f9b4359..f7360c82 100644 --- a/qt/gen_qlayout.go +++ b/qt/gen_qlayout.go @@ -37,19 +37,26 @@ func (this *QLayout) cPointer() *C.QLayout { return this.h } +func (this *QLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLayout(h *C.QLayout) *QLayout { if h == nil { return nil } - return &QLayout{h: h, QObject: newQObject_U(unsafe.Pointer(h)), QLayoutItem: newQLayoutItem_U(unsafe.Pointer(h))} + return &QLayout{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h)), QLayoutItem: UnsafeNewQLayoutItem(unsafe.Pointer(h))} } -func newQLayout_U(h unsafe.Pointer) *QLayout { +func UnsafeNewQLayout(h unsafe.Pointer) *QLayout { return newQLayout((*C.QLayout)(h)) } func (this *QLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QLayout_MetaObject(this.h))) } func (this *QLayout) Metacast(param1 string) unsafe.Pointer { @@ -139,11 +146,11 @@ func (this *QLayout) SetMenuBar(w *QWidget) { } func (this *QLayout) MenuBar() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QLayout_MenuBar(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QLayout_MenuBar(this.h))) } func (this *QLayout) ParentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QLayout_ParentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QLayout_ParentWidget(this.h))) } func (this *QLayout) Invalidate() { @@ -204,11 +211,11 @@ func (this *QLayout) SetGeometry(geometry *QRect) { } func (this *QLayout) ItemAt(index int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QLayout_ItemAt(this.h, (C.int)(index)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QLayout_ItemAt(this.h, (C.int)(index)))) } func (this *QLayout) TakeAt(index int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QLayout_TakeAt(this.h, (C.int)(index)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QLayout_TakeAt(this.h, (C.int)(index)))) } func (this *QLayout) IndexOf(param1 *QWidget) int { @@ -232,7 +239,7 @@ func (this *QLayout) ControlTypes() QSizePolicy__ControlType { } func (this *QLayout) ReplaceWidget(from *QWidget, to *QWidget) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QLayout_ReplaceWidget(this.h, from.cPointer(), to.cPointer()))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QLayout_ReplaceWidget(this.h, from.cPointer(), to.cPointer()))) } func (this *QLayout) TotalHeightForWidth(w int) int { @@ -261,7 +268,7 @@ func (this *QLayout) TotalSizeHint() *QSize { } func (this *QLayout) Layout() *QLayout { - return newQLayout_U(unsafe.Pointer(C.QLayout_Layout(this.h))) + return UnsafeNewQLayout(unsafe.Pointer(C.QLayout_Layout(this.h))) } func (this *QLayout) SetEnabled(enabled bool) { @@ -324,7 +331,7 @@ func QLayout_TrUtf83(s string, c string, n int) string { } func (this *QLayout) ReplaceWidget3(from *QWidget, to *QWidget, options FindChildOption) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QLayout_ReplaceWidget3(this.h, from.cPointer(), to.cPointer(), (C.int)(options)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QLayout_ReplaceWidget3(this.h, from.cPointer(), to.cPointer(), (C.int)(options)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qlayout.h b/qt/gen_qlayout.h index ac126092..dcc13213 100644 --- a/qt/gen_qlayout.h +++ b/qt/gen_qlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlayoutitem.cpp b/qt/gen_qlayoutitem.cpp index 5b062c09..3b0dc1a6 100644 --- a/qt/gen_qlayoutitem.cpp +++ b/qt/gen_qlayoutitem.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qlayoutitem.h" +#include #include "gen_qlayoutitem.h" #include "_cgo_export.h" diff --git a/qt/gen_qlayoutitem.go b/qt/gen_qlayoutitem.go index 703b8e4d..4025237f 100644 --- a/qt/gen_qlayoutitem.go +++ b/qt/gen_qlayoutitem.go @@ -24,6 +24,13 @@ func (this *QLayoutItem) cPointer() *C.QLayoutItem { return this.h } +func (this *QLayoutItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLayoutItem(h *C.QLayoutItem) *QLayoutItem { if h == nil { return nil @@ -31,7 +38,7 @@ func newQLayoutItem(h *C.QLayoutItem) *QLayoutItem { return &QLayoutItem{h: h} } -func newQLayoutItem_U(h unsafe.Pointer) *QLayoutItem { +func UnsafeNewQLayoutItem(h unsafe.Pointer) *QLayoutItem { return newQLayoutItem((*C.QLayoutItem)(h)) } @@ -92,15 +99,15 @@ func (this *QLayoutItem) Invalidate() { } func (this *QLayoutItem) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QLayoutItem_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QLayoutItem_Widget(this.h))) } func (this *QLayoutItem) Layout() *QLayout { - return newQLayout_U(unsafe.Pointer(C.QLayoutItem_Layout(this.h))) + return UnsafeNewQLayout(unsafe.Pointer(C.QLayoutItem_Layout(this.h))) } func (this *QLayoutItem) SpacerItem() *QSpacerItem { - return newQSpacerItem_U(unsafe.Pointer(C.QLayoutItem_SpacerItem(this.h))) + return UnsafeNewQSpacerItem(unsafe.Pointer(C.QLayoutItem_SpacerItem(this.h))) } func (this *QLayoutItem) Alignment() AlignmentFlag { @@ -141,14 +148,21 @@ func (this *QSpacerItem) cPointer() *C.QSpacerItem { return this.h } +func (this *QSpacerItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSpacerItem(h *C.QSpacerItem) *QSpacerItem { if h == nil { return nil } - return &QSpacerItem{h: h, QLayoutItem: newQLayoutItem_U(unsafe.Pointer(h))} + return &QSpacerItem{h: h, QLayoutItem: UnsafeNewQLayoutItem(unsafe.Pointer(h))} } -func newQSpacerItem_U(h unsafe.Pointer) *QSpacerItem { +func UnsafeNewQSpacerItem(h unsafe.Pointer) *QSpacerItem { return newQSpacerItem((*C.QSpacerItem)(h)) } @@ -221,7 +235,7 @@ func (this *QSpacerItem) Geometry() *QRect { } func (this *QSpacerItem) SpacerItem() *QSpacerItem { - return newQSpacerItem_U(unsafe.Pointer(C.QSpacerItem_SpacerItem(this.h))) + return UnsafeNewQSpacerItem(unsafe.Pointer(C.QSpacerItem_SpacerItem(this.h))) } func (this *QSpacerItem) SizePolicy() *QSizePolicy { @@ -265,14 +279,21 @@ func (this *QWidgetItem) cPointer() *C.QWidgetItem { return this.h } +func (this *QWidgetItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWidgetItem(h *C.QWidgetItem) *QWidgetItem { if h == nil { return nil } - return &QWidgetItem{h: h, QLayoutItem: newQLayoutItem_U(unsafe.Pointer(h))} + return &QWidgetItem{h: h, QLayoutItem: UnsafeNewQLayoutItem(unsafe.Pointer(h))} } -func newQWidgetItem_U(h unsafe.Pointer) *QWidgetItem { +func UnsafeNewQWidgetItem(h unsafe.Pointer) *QWidgetItem { return newQWidgetItem((*C.QWidgetItem)(h)) } @@ -323,7 +344,7 @@ func (this *QWidgetItem) Geometry() *QRect { } func (this *QWidgetItem) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidgetItem_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidgetItem_Widget(this.h))) } func (this *QWidgetItem) HasHeightForWidth() bool { @@ -364,14 +385,21 @@ func (this *QWidgetItemV2) cPointer() *C.QWidgetItemV2 { return this.h } +func (this *QWidgetItemV2) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWidgetItemV2(h *C.QWidgetItemV2) *QWidgetItemV2 { if h == nil { return nil } - return &QWidgetItemV2{h: h, QWidgetItem: newQWidgetItem_U(unsafe.Pointer(h))} + return &QWidgetItemV2{h: h, QWidgetItem: UnsafeNewQWidgetItem(unsafe.Pointer(h))} } -func newQWidgetItemV2_U(h unsafe.Pointer) *QWidgetItemV2 { +func UnsafeNewQWidgetItemV2(h unsafe.Pointer) *QWidgetItemV2 { return newQWidgetItemV2((*C.QWidgetItemV2)(h)) } diff --git a/qt/gen_qlayoutitem.h b/qt/gen_qlayoutitem.h index aafd4cae..290d0569 100644 --- a/qt/gen_qlayoutitem.h +++ b/qt/gen_qlayoutitem.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlcdnumber.cpp b/qt/gen_qlcdnumber.cpp index 559dbb32..31170966 100644 --- a/qt/gen_qlcdnumber.cpp +++ b/qt/gen_qlcdnumber.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qlcdnumber.h" +#include #include "gen_qlcdnumber.h" #include "_cgo_export.h" diff --git a/qt/gen_qlcdnumber.go b/qt/gen_qlcdnumber.go index 7890d5aa..984bf742 100644 --- a/qt/gen_qlcdnumber.go +++ b/qt/gen_qlcdnumber.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -43,14 +44,21 @@ func (this *QLCDNumber) cPointer() *C.QLCDNumber { return this.h } +func (this *QLCDNumber) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLCDNumber(h *C.QLCDNumber) *QLCDNumber { if h == nil { return nil } - return &QLCDNumber{h: h, QFrame: newQFrame_U(unsafe.Pointer(h))} + return &QLCDNumber{h: h, QFrame: UnsafeNewQFrame(unsafe.Pointer(h))} } -func newQLCDNumber_U(h unsafe.Pointer) *QLCDNumber { +func UnsafeNewQLCDNumber(h unsafe.Pointer) *QLCDNumber { return newQLCDNumber((*C.QLCDNumber)(h)) } @@ -79,7 +87,7 @@ func NewQLCDNumber4(numDigits uint, parent *QWidget) *QLCDNumber { } func (this *QLCDNumber) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QLCDNumber_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QLCDNumber_MetaObject(this.h))) } func (this *QLCDNumber) Metacast(param1 string) unsafe.Pointer { @@ -158,7 +166,7 @@ func (this *QLCDNumber) SizeHint() *QSize { } func (this *QLCDNumber) Display(str string) { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) C.QLCDNumber_Display(this.h, (*C.struct_miqt_string)(str_ms)) } diff --git a/qt/gen_qlcdnumber.h b/qt/gen_qlcdnumber.h index beb58d0f..e763259b 100644 --- a/qt/gen_qlcdnumber.h +++ b/qt/gen_qlcdnumber.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlibrary.cpp b/qt/gen_qlibrary.cpp index d134deec..86b3a685 100644 --- a/qt/gen_qlibrary.cpp +++ b/qt/gen_qlibrary.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qlibrary.h" +#include #include "gen_qlibrary.h" #include "_cgo_export.h" diff --git a/qt/gen_qlibrary.go b/qt/gen_qlibrary.go index e71c19c1..1c36170a 100644 --- a/qt/gen_qlibrary.go +++ b/qt/gen_qlibrary.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -35,14 +36,21 @@ func (this *QLibrary) cPointer() *C.QLibrary { return this.h } +func (this *QLibrary) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLibrary(h *C.QLibrary) *QLibrary { if h == nil { return nil } - return &QLibrary{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QLibrary{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQLibrary_U(h unsafe.Pointer) *QLibrary { +func UnsafeNewQLibrary(h unsafe.Pointer) *QLibrary { return newQLibrary((*C.QLibrary)(h)) } @@ -54,7 +62,7 @@ func NewQLibrary() *QLibrary { // NewQLibrary2 constructs a new QLibrary object. func NewQLibrary2(fileName string) *QLibrary { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QLibrary_new2((*C.struct_miqt_string)(fileName_ms)) return newQLibrary(ret) @@ -62,7 +70,7 @@ func NewQLibrary2(fileName string) *QLibrary { // NewQLibrary3 constructs a new QLibrary object. func NewQLibrary3(fileName string, verNum int) *QLibrary { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QLibrary_new3((*C.struct_miqt_string)(fileName_ms), (C.int)(verNum)) return newQLibrary(ret) @@ -70,9 +78,9 @@ func NewQLibrary3(fileName string, verNum int) *QLibrary { // NewQLibrary4 constructs a new QLibrary object. func NewQLibrary4(fileName string, version string) *QLibrary { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) - version_ms := miqt_strdupg(version) + version_ms := libmiqt.Strdupg(version) defer C.free(version_ms) ret := C.QLibrary_new4((*C.struct_miqt_string)(fileName_ms), (*C.struct_miqt_string)(version_ms)) return newQLibrary(ret) @@ -86,7 +94,7 @@ func NewQLibrary5(parent *QObject) *QLibrary { // NewQLibrary6 constructs a new QLibrary object. func NewQLibrary6(fileName string, parent *QObject) *QLibrary { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QLibrary_new6((*C.struct_miqt_string)(fileName_ms), parent.cPointer()) return newQLibrary(ret) @@ -94,7 +102,7 @@ func NewQLibrary6(fileName string, parent *QObject) *QLibrary { // NewQLibrary7 constructs a new QLibrary object. func NewQLibrary7(fileName string, verNum int, parent *QObject) *QLibrary { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QLibrary_new7((*C.struct_miqt_string)(fileName_ms), (C.int)(verNum), parent.cPointer()) return newQLibrary(ret) @@ -102,16 +110,16 @@ func NewQLibrary7(fileName string, verNum int, parent *QObject) *QLibrary { // NewQLibrary8 constructs a new QLibrary object. func NewQLibrary8(fileName string, version string, parent *QObject) *QLibrary { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) - version_ms := miqt_strdupg(version) + version_ms := libmiqt.Strdupg(version) defer C.free(version_ms) ret := C.QLibrary_new8((*C.struct_miqt_string)(fileName_ms), (*C.struct_miqt_string)(version_ms), parent.cPointer()) return newQLibrary(ret) } func (this *QLibrary) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QLibrary_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QLibrary_MetaObject(this.h))) } func (this *QLibrary) Metacast(param1 string) unsafe.Pointer { @@ -151,13 +159,13 @@ func (this *QLibrary) IsLoaded() bool { } func QLibrary_IsLibrary(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QLibrary_IsLibrary((*C.struct_miqt_string)(fileName_ms))) } func (this *QLibrary) SetFileName(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QLibrary_SetFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -170,15 +178,15 @@ func (this *QLibrary) FileName() string { } func (this *QLibrary) SetFileNameAndVersion(fileName string, verNum int) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QLibrary_SetFileNameAndVersion(this.h, (*C.struct_miqt_string)(fileName_ms), (C.int)(verNum)) } func (this *QLibrary) SetFileNameAndVersion2(fileName string, version string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) - version_ms := miqt_strdupg(version) + version_ms := libmiqt.Strdupg(version) defer C.free(version_ms) C.QLibrary_SetFileNameAndVersion2(this.h, (*C.struct_miqt_string)(fileName_ms), (*C.struct_miqt_string)(version_ms)) } diff --git a/qt/gen_qlibrary.h b/qt/gen_qlibrary.h index fb62dabe..6d6eab5a 100644 --- a/qt/gen_qlibrary.h +++ b/qt/gen_qlibrary.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlibraryinfo.cpp b/qt/gen_qlibraryinfo.cpp index da655c8b..ef8852b5 100644 --- a/qt/gen_qlibraryinfo.cpp +++ b/qt/gen_qlibraryinfo.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qlibraryinfo.h" +#include #include "gen_qlibraryinfo.h" #include "_cgo_export.h" diff --git a/qt/gen_qlibraryinfo.go b/qt/gen_qlibraryinfo.go index f70195ac..53d42594 100644 --- a/qt/gen_qlibraryinfo.go +++ b/qt/gen_qlibraryinfo.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -44,6 +45,13 @@ func (this *QLibraryInfo) cPointer() *C.QLibraryInfo { return this.h } +func (this *QLibraryInfo) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLibraryInfo(h *C.QLibraryInfo) *QLibraryInfo { if h == nil { return nil @@ -51,7 +59,7 @@ func newQLibraryInfo(h *C.QLibraryInfo) *QLibraryInfo { return &QLibraryInfo{h: h} } -func newQLibraryInfo_U(h unsafe.Pointer) *QLibraryInfo { +func UnsafeNewQLibraryInfo(h unsafe.Pointer) *QLibraryInfo { return newQLibraryInfo((*C.QLibraryInfo)(h)) } @@ -100,7 +108,7 @@ func QLibraryInfo_Location(param1 QLibraryInfo__LibraryLocation) string { } func QLibraryInfo_PlatformPluginArguments(platformName string) []string { - platformName_ms := miqt_strdupg(platformName) + platformName_ms := libmiqt.Strdupg(platformName) defer C.free(platformName_ms) var _ma *C.struct_miqt_array = C.QLibraryInfo_PlatformPluginArguments((*C.struct_miqt_string)(platformName_ms)) _ret := make([]string, int(_ma.len)) diff --git a/qt/gen_qlibraryinfo.h b/qt/gen_qlibraryinfo.h index f1ff8b4f..34596c8a 100644 --- a/qt/gen_qlibraryinfo.h +++ b/qt/gen_qlibraryinfo.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qline.cpp b/qt/gen_qline.cpp index c1ebb3a4..db4e08e6 100644 --- a/qt/gen_qline.cpp +++ b/qt/gen_qline.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qline.h" +#include #include "gen_qline.h" #include "_cgo_export.h" diff --git a/qt/gen_qline.go b/qt/gen_qline.go index 187ab783..e74de68c 100644 --- a/qt/gen_qline.go +++ b/qt/gen_qline.go @@ -32,6 +32,13 @@ func (this *QLine) cPointer() *C.QLine { return this.h } +func (this *QLine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLine(h *C.QLine) *QLine { if h == nil { return nil @@ -39,7 +46,7 @@ func newQLine(h *C.QLine) *QLine { return &QLine{h: h} } -func newQLine_U(h unsafe.Pointer) *QLine { +func UnsafeNewQLine(h unsafe.Pointer) *QLine { return newQLine((*C.QLine)(h)) } @@ -187,6 +194,13 @@ func (this *QLineF) cPointer() *C.QLineF { return this.h } +func (this *QLineF) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLineF(h *C.QLineF) *QLineF { if h == nil { return nil @@ -194,7 +208,7 @@ func newQLineF(h *C.QLineF) *QLineF { return &QLineF{h: h} } -func newQLineF_U(h unsafe.Pointer) *QLineF { +func UnsafeNewQLineF(h unsafe.Pointer) *QLineF { return newQLineF((*C.QLineF)(h)) } diff --git a/qt/gen_qline.h b/qt/gen_qline.h index 2d9ce2b3..a7e2b37a 100644 --- a/qt/gen_qline.h +++ b/qt/gen_qline.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlineedit.cpp b/qt/gen_qlineedit.cpp index fe45ea92..bcfd8910 100644 --- a/qt/gen_qlineedit.cpp +++ b/qt/gen_qlineedit.cpp @@ -14,7 +14,7 @@ #include #include #include -#include "qlineedit.h" +#include #include "gen_qlineedit.h" #include "_cgo_export.h" diff --git a/qt/gen_qlineedit.go b/qt/gen_qlineedit.go index 77e8f022..157eaa6a 100644 --- a/qt/gen_qlineedit.go +++ b/qt/gen_qlineedit.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -42,14 +43,21 @@ func (this *QLineEdit) cPointer() *C.QLineEdit { return this.h } +func (this *QLineEdit) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLineEdit(h *C.QLineEdit) *QLineEdit { if h == nil { return nil } - return &QLineEdit{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QLineEdit{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQLineEdit_U(h unsafe.Pointer) *QLineEdit { +func UnsafeNewQLineEdit(h unsafe.Pointer) *QLineEdit { return newQLineEdit((*C.QLineEdit)(h)) } @@ -61,7 +69,7 @@ func NewQLineEdit() *QLineEdit { // NewQLineEdit2 constructs a new QLineEdit object. func NewQLineEdit2(param1 string) *QLineEdit { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) ret := C.QLineEdit_new2((*C.struct_miqt_string)(param1_ms)) return newQLineEdit(ret) @@ -75,14 +83,14 @@ func NewQLineEdit3(parent *QWidget) *QLineEdit { // NewQLineEdit4 constructs a new QLineEdit object. func NewQLineEdit4(param1 string, parent *QWidget) *QLineEdit { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) ret := C.QLineEdit_new4((*C.struct_miqt_string)(param1_ms), parent.cPointer()) return newQLineEdit(ret) } func (this *QLineEdit) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QLineEdit_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QLineEdit_MetaObject(this.h))) } func (this *QLineEdit) Metacast(param1 string) unsafe.Pointer { @@ -131,7 +139,7 @@ func (this *QLineEdit) PlaceholderText() string { } func (this *QLineEdit) SetPlaceholderText(placeholderText string) { - placeholderText_ms := miqt_strdupg(placeholderText) + placeholderText_ms := libmiqt.Strdupg(placeholderText) defer C.free(placeholderText_ms) C.QLineEdit_SetPlaceholderText(this.h, (*C.struct_miqt_string)(placeholderText_ms)) } @@ -181,7 +189,7 @@ func (this *QLineEdit) SetValidator(validator *QValidator) { } func (this *QLineEdit) Validator() *QValidator { - return newQValidator_U(unsafe.Pointer(C.QLineEdit_Validator(this.h))) + return UnsafeNewQValidator(unsafe.Pointer(C.QLineEdit_Validator(this.h))) } func (this *QLineEdit) SetCompleter(completer *QCompleter) { @@ -189,7 +197,7 @@ func (this *QLineEdit) SetCompleter(completer *QCompleter) { } func (this *QLineEdit) Completer() *QCompleter { - return newQCompleter_U(unsafe.Pointer(C.QLineEdit_Completer(this.h))) + return UnsafeNewQCompleter(unsafe.Pointer(C.QLineEdit_Completer(this.h))) } func (this *QLineEdit) SizeHint() *QSize { @@ -325,7 +333,7 @@ func (this *QLineEdit) InputMask() string { } func (this *QLineEdit) SetInputMask(inputMask string) { - inputMask_ms := miqt_strdupg(inputMask) + inputMask_ms := libmiqt.Strdupg(inputMask) defer C.free(inputMask_ms) C.QLineEdit_SetInputMask(this.h, (*C.struct_miqt_string)(inputMask_ms)) } @@ -358,11 +366,11 @@ func (this *QLineEdit) AddAction(action *QAction, position QLineEdit__ActionPosi } func (this *QLineEdit) AddAction2(icon *QIcon, position QLineEdit__ActionPosition) *QAction { - return newQAction_U(unsafe.Pointer(C.QLineEdit_AddAction2(this.h, icon.cPointer(), (C.int)(position)))) + return UnsafeNewQAction(unsafe.Pointer(C.QLineEdit_AddAction2(this.h, icon.cPointer(), (C.int)(position)))) } func (this *QLineEdit) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QLineEdit_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -400,17 +408,17 @@ func (this *QLineEdit) Deselect() { } func (this *QLineEdit) Insert(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QLineEdit_Insert(this.h, (*C.struct_miqt_string)(param1_ms)) } func (this *QLineEdit) CreateStandardContextMenu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QLineEdit_CreateStandardContextMenu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QLineEdit_CreateStandardContextMenu(this.h))) } func (this *QLineEdit) TextChanged(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QLineEdit_TextChanged(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -435,7 +443,7 @@ func miqt_exec_callback_QLineEdit_TextChanged(cb C.intptr_t, param1 *C.struct_mi } func (this *QLineEdit) TextEdited(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QLineEdit_TextEdited(this.h, (*C.struct_miqt_string)(param1_ms)) } diff --git a/qt/gen_qlineedit.h b/qt/gen_qlineedit.h index 325a0ae3..e8914b5e 100644 --- a/qt/gen_qlineedit.h +++ b/qt/gen_qlineedit.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlinkedlist.cpp b/qt/gen_qlinkedlist.cpp index 9cd201cd..20c37582 100644 --- a/qt/gen_qlinkedlist.cpp +++ b/qt/gen_qlinkedlist.cpp @@ -1,5 +1,5 @@ #include -#include "qlinkedlist.h" +#include #include "gen_qlinkedlist.h" #include "_cgo_export.h" diff --git a/qt/gen_qlinkedlist.go b/qt/gen_qlinkedlist.go index a826f732..b8379dc7 100644 --- a/qt/gen_qlinkedlist.go +++ b/qt/gen_qlinkedlist.go @@ -24,6 +24,13 @@ func (this *QLinkedListData) cPointer() *C.QLinkedListData { return this.h } +func (this *QLinkedListData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLinkedListData(h *C.QLinkedListData) *QLinkedListData { if h == nil { return nil @@ -31,7 +38,7 @@ func newQLinkedListData(h *C.QLinkedListData) *QLinkedListData { return &QLinkedListData{h: h} } -func newQLinkedListData_U(h unsafe.Pointer) *QLinkedListData { +func UnsafeNewQLinkedListData(h unsafe.Pointer) *QLinkedListData { return newQLinkedListData((*C.QLinkedListData)(h)) } diff --git a/qt/gen_qlinkedlist.h b/qt/gen_qlinkedlist.h index f6cfbe1e..95515013 100644 --- a/qt/gen_qlinkedlist.h +++ b/qt/gen_qlinkedlist.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlistview.cpp b/qt/gen_qlistview.cpp index 7f306608..67ed91c2 100644 --- a/qt/gen_qlistview.cpp +++ b/qt/gen_qlistview.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qlistview.h" +#include #include "gen_qlistview.h" #include "_cgo_export.h" @@ -198,7 +198,7 @@ void QListView_SetRootIndex(QListView* self, QModelIndex* index) { } void QListView_IndexesMoved(QListView* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { diff --git a/qt/gen_qlistview.go b/qt/gen_qlistview.go index ee76898b..11f9350f 100644 --- a/qt/gen_qlistview.go +++ b/qt/gen_qlistview.go @@ -62,14 +62,21 @@ func (this *QListView) cPointer() *C.QListView { return this.h } +func (this *QListView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQListView(h *C.QListView) *QListView { if h == nil { return nil } - return &QListView{h: h, QAbstractItemView: newQAbstractItemView_U(unsafe.Pointer(h))} + return &QListView{h: h, QAbstractItemView: UnsafeNewQAbstractItemView(unsafe.Pointer(h))} } -func newQListView_U(h unsafe.Pointer) *QListView { +func UnsafeNewQListView(h unsafe.Pointer) *QListView { return newQListView((*C.QListView)(h)) } @@ -86,7 +93,7 @@ func NewQListView2(parent *QWidget) *QListView { } func (this *QListView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QListView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QListView_MetaObject(this.h))) } func (this *QListView) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qlistview.h b/qt/gen_qlistview.h index f5069add..188097be 100644 --- a/qt/gen_qlistview.h +++ b/qt/gen_qlistview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlistwidget.cpp b/qt/gen_qlistwidget.cpp index 19108b2c..aea0809d 100644 --- a/qt/gen_qlistwidget.cpp +++ b/qt/gen_qlistwidget.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "qlistwidget.h" +#include #include "gen_qlistwidget.h" #include "_cgo_export.h" @@ -305,7 +305,7 @@ void QListWidget_InsertItem2(QListWidget* self, int row, struct miqt_string* lab } void QListWidget_InsertItems(QListWidget* self, int row, struct miqt_array* /* of struct miqt_string* */ labels) { - QList labels_QList; + QStringList labels_QList; labels_QList.reserve(labels->len); struct miqt_string** labels_arr = static_cast(labels->data); for(size_t i = 0; i < labels->len; ++i) { @@ -325,7 +325,7 @@ void QListWidget_AddItemWithItem(QListWidget* self, QListWidgetItem* item) { } void QListWidget_AddItems(QListWidget* self, struct miqt_array* /* of struct miqt_string* */ labels) { - QList labels_QList; + QStringList labels_QList; labels_QList.reserve(labels->len); struct miqt_string** labels_arr = static_cast(labels->data); for(size_t i = 0; i < labels->len; ++i) { diff --git a/qt/gen_qlistwidget.go b/qt/gen_qlistwidget.go index cfb8dd6e..aef3c463 100644 --- a/qt/gen_qlistwidget.go +++ b/qt/gen_qlistwidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -32,6 +33,13 @@ func (this *QListWidgetItem) cPointer() *C.QListWidgetItem { return this.h } +func (this *QListWidgetItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQListWidgetItem(h *C.QListWidgetItem) *QListWidgetItem { if h == nil { return nil @@ -39,7 +47,7 @@ func newQListWidgetItem(h *C.QListWidgetItem) *QListWidgetItem { return &QListWidgetItem{h: h} } -func newQListWidgetItem_U(h unsafe.Pointer) *QListWidgetItem { +func UnsafeNewQListWidgetItem(h unsafe.Pointer) *QListWidgetItem { return newQListWidgetItem((*C.QListWidgetItem)(h)) } @@ -51,7 +59,7 @@ func NewQListWidgetItem() *QListWidgetItem { // NewQListWidgetItem2 constructs a new QListWidgetItem object. func NewQListWidgetItem2(text string) *QListWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QListWidgetItem_new2((*C.struct_miqt_string)(text_ms)) return newQListWidgetItem(ret) @@ -59,7 +67,7 @@ func NewQListWidgetItem2(text string) *QListWidgetItem { // NewQListWidgetItem3 constructs a new QListWidgetItem object. func NewQListWidgetItem3(icon *QIcon, text string) *QListWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QListWidgetItem_new3(icon.cPointer(), (*C.struct_miqt_string)(text_ms)) return newQListWidgetItem(ret) @@ -85,7 +93,7 @@ func NewQListWidgetItem6(listview *QListWidget, typeVal int) *QListWidgetItem { // NewQListWidgetItem7 constructs a new QListWidgetItem object. func NewQListWidgetItem7(text string, listview *QListWidget) *QListWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QListWidgetItem_new7((*C.struct_miqt_string)(text_ms), listview.cPointer()) return newQListWidgetItem(ret) @@ -93,7 +101,7 @@ func NewQListWidgetItem7(text string, listview *QListWidget) *QListWidgetItem { // NewQListWidgetItem8 constructs a new QListWidgetItem object. func NewQListWidgetItem8(text string, listview *QListWidget, typeVal int) *QListWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QListWidgetItem_new8((*C.struct_miqt_string)(text_ms), listview.cPointer(), (C.int)(typeVal)) return newQListWidgetItem(ret) @@ -101,7 +109,7 @@ func NewQListWidgetItem8(text string, listview *QListWidget, typeVal int) *QList // NewQListWidgetItem9 constructs a new QListWidgetItem object. func NewQListWidgetItem9(icon *QIcon, text string, listview *QListWidget) *QListWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QListWidgetItem_new9(icon.cPointer(), (*C.struct_miqt_string)(text_ms), listview.cPointer()) return newQListWidgetItem(ret) @@ -109,18 +117,18 @@ func NewQListWidgetItem9(icon *QIcon, text string, listview *QListWidget) *QList // NewQListWidgetItem10 constructs a new QListWidgetItem object. func NewQListWidgetItem10(icon *QIcon, text string, listview *QListWidget, typeVal int) *QListWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QListWidgetItem_new10(icon.cPointer(), (*C.struct_miqt_string)(text_ms), listview.cPointer(), (C.int)(typeVal)) return newQListWidgetItem(ret) } func (this *QListWidgetItem) Clone() *QListWidgetItem { - return newQListWidgetItem_U(unsafe.Pointer(C.QListWidgetItem_Clone(this.h))) + return UnsafeNewQListWidgetItem(unsafe.Pointer(C.QListWidgetItem_Clone(this.h))) } func (this *QListWidgetItem) ListWidget() *QListWidget { - return newQListWidget_U(unsafe.Pointer(C.QListWidgetItem_ListWidget(this.h))) + return UnsafeNewQListWidget(unsafe.Pointer(C.QListWidgetItem_ListWidget(this.h))) } func (this *QListWidgetItem) SetSelected(selectVal bool) { @@ -155,7 +163,7 @@ func (this *QListWidgetItem) Text() string { } func (this *QListWidgetItem) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QListWidgetItem_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -179,7 +187,7 @@ func (this *QListWidgetItem) StatusTip() string { } func (this *QListWidgetItem) SetStatusTip(statusTip string) { - statusTip_ms := miqt_strdupg(statusTip) + statusTip_ms := libmiqt.Strdupg(statusTip) defer C.free(statusTip_ms) C.QListWidgetItem_SetStatusTip(this.h, (*C.struct_miqt_string)(statusTip_ms)) } @@ -192,7 +200,7 @@ func (this *QListWidgetItem) ToolTip() string { } func (this *QListWidgetItem) SetToolTip(toolTip string) { - toolTip_ms := miqt_strdupg(toolTip) + toolTip_ms := libmiqt.Strdupg(toolTip) defer C.free(toolTip_ms) C.QListWidgetItem_SetToolTip(this.h, (*C.struct_miqt_string)(toolTip_ms)) } @@ -205,7 +213,7 @@ func (this *QListWidgetItem) WhatsThis() string { } func (this *QListWidgetItem) SetWhatsThis(whatsThis string) { - whatsThis_ms := miqt_strdupg(whatsThis) + whatsThis_ms := libmiqt.Strdupg(whatsThis) defer C.free(whatsThis_ms) C.QListWidgetItem_SetWhatsThis(this.h, (*C.struct_miqt_string)(whatsThis_ms)) } @@ -349,14 +357,21 @@ func (this *QListWidget) cPointer() *C.QListWidget { return this.h } +func (this *QListWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQListWidget(h *C.QListWidget) *QListWidget { if h == nil { return nil } - return &QListWidget{h: h, QListView: newQListView_U(unsafe.Pointer(h))} + return &QListWidget{h: h, QListView: UnsafeNewQListView(unsafe.Pointer(h))} } -func newQListWidget_U(h unsafe.Pointer) *QListWidget { +func UnsafeNewQListWidget(h unsafe.Pointer) *QListWidget { return newQListWidget((*C.QListWidget)(h)) } @@ -373,7 +388,7 @@ func NewQListWidget2(parent *QWidget) *QListWidget { } func (this *QListWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QListWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QListWidget_MetaObject(this.h))) } func (this *QListWidget) Metacast(param1 string) unsafe.Pointer { @@ -405,7 +420,7 @@ func (this *QListWidget) SetSelectionModel(selectionModel *QItemSelectionModel) } func (this *QListWidget) Item(row int) *QListWidgetItem { - return newQListWidgetItem_U(unsafe.Pointer(C.QListWidget_Item(this.h, (C.int)(row)))) + return UnsafeNewQListWidgetItem(unsafe.Pointer(C.QListWidget_Item(this.h, (C.int)(row)))) } func (this *QListWidget) Row(item *QListWidgetItem) int { @@ -417,7 +432,7 @@ func (this *QListWidget) InsertItem(row int, item *QListWidgetItem) { } func (this *QListWidget) InsertItem2(row int, label string) { - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) C.QListWidget_InsertItem2(this.h, (C.int)(row), (*C.struct_miqt_string)(label_ms)) } @@ -427,7 +442,7 @@ func (this *QListWidget) InsertItems(row int, labels []string) { labels_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(labels)))) defer C.free(unsafe.Pointer(labels_CArray)) for i := range labels { - labels_i_ms := miqt_strdupg(labels[i]) + labels_i_ms := libmiqt.Strdupg(labels[i]) defer C.free(labels_i_ms) labels_CArray[i] = (*C.struct_miqt_string)(labels_i_ms) } @@ -437,7 +452,7 @@ func (this *QListWidget) InsertItems(row int, labels []string) { } func (this *QListWidget) AddItem(label string) { - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) C.QListWidget_AddItem(this.h, (*C.struct_miqt_string)(label_ms)) } @@ -451,7 +466,7 @@ func (this *QListWidget) AddItems(labels []string) { labels_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(labels)))) defer C.free(unsafe.Pointer(labels_CArray)) for i := range labels { - labels_i_ms := miqt_strdupg(labels[i]) + labels_i_ms := libmiqt.Strdupg(labels[i]) defer C.free(labels_i_ms) labels_CArray[i] = (*C.struct_miqt_string)(labels_i_ms) } @@ -461,7 +476,7 @@ func (this *QListWidget) AddItems(labels []string) { } func (this *QListWidget) TakeItem(row int) *QListWidgetItem { - return newQListWidgetItem_U(unsafe.Pointer(C.QListWidget_TakeItem(this.h, (C.int)(row)))) + return UnsafeNewQListWidgetItem(unsafe.Pointer(C.QListWidget_TakeItem(this.h, (C.int)(row)))) } func (this *QListWidget) Count() int { @@ -469,7 +484,7 @@ func (this *QListWidget) Count() int { } func (this *QListWidget) CurrentItem() *QListWidgetItem { - return newQListWidgetItem_U(unsafe.Pointer(C.QListWidget_CurrentItem(this.h))) + return UnsafeNewQListWidgetItem(unsafe.Pointer(C.QListWidget_CurrentItem(this.h))) } func (this *QListWidget) SetCurrentItem(item *QListWidgetItem) { @@ -493,11 +508,11 @@ func (this *QListWidget) SetCurrentRow2(row int, command QItemSelectionModel__Se } func (this *QListWidget) ItemAt(p *QPoint) *QListWidgetItem { - return newQListWidgetItem_U(unsafe.Pointer(C.QListWidget_ItemAt(this.h, p.cPointer()))) + return UnsafeNewQListWidgetItem(unsafe.Pointer(C.QListWidget_ItemAt(this.h, p.cPointer()))) } func (this *QListWidget) ItemAt2(x int, y int) *QListWidgetItem { - return newQListWidgetItem_U(unsafe.Pointer(C.QListWidget_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQListWidgetItem(unsafe.Pointer(C.QListWidget_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) } func (this *QListWidget) VisualItemRect(item *QListWidgetItem) *QRect { @@ -536,7 +551,7 @@ func (this *QListWidget) IsPersistentEditorOpen(item *QListWidgetItem) bool { } func (this *QListWidget) ItemWidget(item *QListWidgetItem) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QListWidget_ItemWidget(this.h, item.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QListWidget_ItemWidget(this.h, item.cPointer()))) } func (this *QListWidget) SetItemWidget(item *QListWidgetItem, widget *QWidget) { @@ -560,20 +575,20 @@ func (this *QListWidget) SelectedItems() []*QListWidgetItem { _ret := make([]*QListWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QListWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQListWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQListWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QListWidget) FindItems(text string, flags MatchFlag) []*QListWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QListWidget_FindItems(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(flags)) _ret := make([]*QListWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QListWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQListWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQListWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -614,7 +629,7 @@ func miqt_exec_callback_QListWidget_ItemPressed(cb C.intptr_t, item *C.QListWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQListWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQListWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -634,7 +649,7 @@ func miqt_exec_callback_QListWidget_ItemClicked(cb C.intptr_t, item *C.QListWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQListWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQListWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -654,7 +669,7 @@ func miqt_exec_callback_QListWidget_ItemDoubleClicked(cb C.intptr_t, item *C.QLi } // Convert all CABI parameters to Go parameters - slotval1 := newQListWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQListWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -674,7 +689,7 @@ func miqt_exec_callback_QListWidget_ItemActivated(cb C.intptr_t, item *C.QListWi } // Convert all CABI parameters to Go parameters - slotval1 := newQListWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQListWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -694,7 +709,7 @@ func miqt_exec_callback_QListWidget_ItemEntered(cb C.intptr_t, item *C.QListWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQListWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQListWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -714,7 +729,7 @@ func miqt_exec_callback_QListWidget_ItemChanged(cb C.intptr_t, item *C.QListWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQListWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQListWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -734,14 +749,14 @@ func miqt_exec_callback_QListWidget_CurrentItemChanged(cb C.intptr_t, current *C } // Convert all CABI parameters to Go parameters - slotval1 := newQListWidgetItem_U(unsafe.Pointer(current)) - slotval2 := newQListWidgetItem_U(unsafe.Pointer(previous)) + slotval1 := UnsafeNewQListWidgetItem(unsafe.Pointer(current)) + slotval2 := UnsafeNewQListWidgetItem(unsafe.Pointer(previous)) gofunc(slotval1, slotval2) } func (this *QListWidget) CurrentTextChanged(currentText string) { - currentText_ms := miqt_strdupg(currentText) + currentText_ms := libmiqt.Strdupg(currentText) defer C.free(currentText_ms) C.QListWidget_CurrentTextChanged(this.h, (*C.struct_miqt_string)(currentText_ms)) } diff --git a/qt/gen_qlistwidget.h b/qt/gen_qlistwidget.h index 5902603b..147a8204 100644 --- a/qt/gen_qlistwidget.h +++ b/qt/gen_qlistwidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlocale.cpp b/qt/gen_qlocale.cpp index b855bea3..e8d820a7 100644 --- a/qt/gen_qlocale.cpp +++ b/qt/gen_qlocale.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qlocale.h" +#include #include "gen_qlocale.h" #include "_cgo_export.h" @@ -673,7 +673,7 @@ struct miqt_string* QLocale_QuoteString(const QLocale* self, struct miqt_string* } struct miqt_string* QLocale_CreateSeparatedList(const QLocale* self, struct miqt_array* /* of struct miqt_string* */ strl) { - QList strl_QList; + QStringList strl_QList; strl_QList.reserve(strl->len); struct miqt_string** strl_arr = static_cast(strl->data); for(size_t i = 0; i < strl->len; ++i) { diff --git a/qt/gen_qlocale.go b/qt/gen_qlocale.go index a0e940b5..aa837f3c 100644 --- a/qt/gen_qlocale.go +++ b/qt/gen_qlocale.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -902,6 +903,13 @@ func (this *QLocale) cPointer() *C.QLocale { return this.h } +func (this *QLocale) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLocale(h *C.QLocale) *QLocale { if h == nil { return nil @@ -909,7 +917,7 @@ func newQLocale(h *C.QLocale) *QLocale { return &QLocale{h: h} } -func newQLocale_U(h unsafe.Pointer) *QLocale { +func UnsafeNewQLocale(h unsafe.Pointer) *QLocale { return newQLocale((*C.QLocale)(h)) } @@ -921,7 +929,7 @@ func NewQLocale() *QLocale { // NewQLocale2 constructs a new QLocale object. func NewQLocale2(name string) *QLocale { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QLocale_new2((*C.struct_miqt_string)(name_ms)) return newQLocale(ret) @@ -1000,61 +1008,61 @@ func (this *QLocale) NativeCountryName() string { } func (this *QLocale) ToShort(s string) int16 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int16)(C.QLocale_ToShort(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToUShort(s string) uint16 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint16)(C.QLocale_ToUShort(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToInt(s string) int { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int)(C.QLocale_ToInt(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToUInt(s string) uint { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint)(C.QLocale_ToUInt(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToLong(s string) int64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int64)(C.QLocale_ToLong(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToULong(s string) uint64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint64)(C.QLocale_ToULong(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToLongLong(s string) int64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int64)(C.QLocale_ToLongLong(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToULongLong(s string) uint64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint64)(C.QLocale_ToULongLong(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToFloat(s string) float32 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (float32)(C.QLocale_ToFloat(this.h, (*C.struct_miqt_string)(s_ms))) } func (this *QLocale) ToDouble(s string) float64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (float64)(C.QLocale_ToDouble(this.h, (*C.struct_miqt_string)(s_ms))) } @@ -1130,7 +1138,7 @@ func (this *QLocale) ToStringWithFloat(i float32) string { } func (this *QLocale) ToString2(date *QDate, formatStr string) string { - formatStr_ms := miqt_strdupg(formatStr) + formatStr_ms := libmiqt.Strdupg(formatStr) defer C.free(formatStr_ms) var _ms *C.struct_miqt_string = C.QLocale_ToString2(this.h, date.cPointer(), (*C.struct_miqt_string)(formatStr_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1139,7 +1147,7 @@ func (this *QLocale) ToString2(date *QDate, formatStr string) string { } func (this *QLocale) ToString3(time *QTime, formatStr string) string { - formatStr_ms := miqt_strdupg(formatStr) + formatStr_ms := libmiqt.Strdupg(formatStr) defer C.free(formatStr_ms) var _ms *C.struct_miqt_string = C.QLocale_ToString3(this.h, time.cPointer(), (*C.struct_miqt_string)(formatStr_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1148,7 +1156,7 @@ func (this *QLocale) ToString3(time *QTime, formatStr string) string { } func (this *QLocale) ToString4(dateTime *QDateTime, format string) string { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) var _ms *C.struct_miqt_string = C.QLocale_ToString4(this.h, dateTime.cPointer(), (*C.struct_miqt_string)(format_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1213,7 +1221,7 @@ func (this *QLocale) DateTimeFormat() string { } func (this *QLocale) ToDate(stringVal string) *QDate { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToDate(this.h, (*C.struct_miqt_string)(stringVal_ms)) _goptr := newQDate(_ret) @@ -1222,7 +1230,7 @@ func (this *QLocale) ToDate(stringVal string) *QDate { } func (this *QLocale) ToTime(stringVal string) *QTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToTime(this.h, (*C.struct_miqt_string)(stringVal_ms)) _goptr := newQTime(_ret) @@ -1231,7 +1239,7 @@ func (this *QLocale) ToTime(stringVal string) *QTime { } func (this *QLocale) ToDateTime(stringVal string) *QDateTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToDateTime(this.h, (*C.struct_miqt_string)(stringVal_ms)) _goptr := newQDateTime(_ret) @@ -1240,9 +1248,9 @@ func (this *QLocale) ToDateTime(stringVal string) *QDateTime { } func (this *QLocale) ToDate2(stringVal string, format string) *QDate { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QLocale_ToDate2(this.h, (*C.struct_miqt_string)(stringVal_ms), (*C.struct_miqt_string)(format_ms)) _goptr := newQDate(_ret) @@ -1251,9 +1259,9 @@ func (this *QLocale) ToDate2(stringVal string, format string) *QDate { } func (this *QLocale) ToTime2(stringVal string, format string) *QTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QLocale_ToTime2(this.h, (*C.struct_miqt_string)(stringVal_ms), (*C.struct_miqt_string)(format_ms)) _goptr := newQTime(_ret) @@ -1262,9 +1270,9 @@ func (this *QLocale) ToTime2(stringVal string, format string) *QTime { } func (this *QLocale) ToDateTime2(stringVal string, format string) *QDateTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QLocale_ToDateTime2(this.h, (*C.struct_miqt_string)(stringVal_ms), (*C.struct_miqt_string)(format_ms)) _goptr := newQDateTime(_ret) @@ -1273,7 +1281,7 @@ func (this *QLocale) ToDateTime2(stringVal string, format string) *QDateTime { } func (this *QLocale) ToDate3(stringVal string, format QLocale__FormatType, cal QCalendar) *QDate { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToDate3(this.h, (*C.struct_miqt_string)(stringVal_ms), (C.int)(format), cal.cPointer()) _goptr := newQDate(_ret) @@ -1282,7 +1290,7 @@ func (this *QLocale) ToDate3(stringVal string, format QLocale__FormatType, cal Q } func (this *QLocale) ToDateTime3(stringVal string, format QLocale__FormatType, cal QCalendar) *QDateTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToDateTime3(this.h, (*C.struct_miqt_string)(stringVal_ms), (C.int)(format), cal.cPointer()) _goptr := newQDateTime(_ret) @@ -1291,9 +1299,9 @@ func (this *QLocale) ToDateTime3(stringVal string, format QLocale__FormatType, c } func (this *QLocale) ToDate4(stringVal string, format string, cal QCalendar) *QDate { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QLocale_ToDate4(this.h, (*C.struct_miqt_string)(stringVal_ms), (*C.struct_miqt_string)(format_ms), cal.cPointer()) _goptr := newQDate(_ret) @@ -1302,9 +1310,9 @@ func (this *QLocale) ToDate4(stringVal string, format string, cal QCalendar) *QD } func (this *QLocale) ToDateTime4(stringVal string, format string, cal QCalendar) *QDateTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QLocale_ToDateTime4(this.h, (*C.struct_miqt_string)(stringVal_ms), (*C.struct_miqt_string)(format_ms), cal.cPointer()) _goptr := newQDateTime(_ret) @@ -1313,7 +1321,7 @@ func (this *QLocale) ToDateTime4(stringVal string, format string, cal QCalendar) } func (this *QLocale) ToTime3(stringVal string, format QLocale__FormatType, cal QCalendar) *QTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToTime3(this.h, (*C.struct_miqt_string)(stringVal_ms), (C.int)(format), cal.cPointer()) _goptr := newQTime(_ret) @@ -1322,9 +1330,9 @@ func (this *QLocale) ToTime3(stringVal string, format QLocale__FormatType, cal Q } func (this *QLocale) ToTime4(stringVal string, format string, cal QCalendar) *QTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) _ret := C.QLocale_ToTime4(this.h, (*C.struct_miqt_string)(stringVal_ms), (*C.struct_miqt_string)(format_ms), cal.cPointer()) _goptr := newQTime(_ret) @@ -1454,7 +1462,7 @@ func (this *QLocale) TextDirection() LayoutDirection { } func (this *QLocale) ToUpper(str string) string { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ms *C.struct_miqt_string = C.QLocale_ToUpper(this.h, (*C.struct_miqt_string)(str_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1463,7 +1471,7 @@ func (this *QLocale) ToUpper(str string) string { } func (this *QLocale) ToLower(str string) string { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ms *C.struct_miqt_string = C.QLocale_ToLower(this.h, (*C.struct_miqt_string)(str_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1528,7 +1536,7 @@ func (this *QLocale) ToCurrencyStringWithDouble(param1 float64) string { } func (this *QLocale) ToCurrencyString2(param1 float64, symbol string, precision int) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString2(this.h, (C.double)(param1), (*C.struct_miqt_string)(symbol_ms), (C.int)(precision)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1544,7 +1552,7 @@ func (this *QLocale) ToCurrencyStringWithFloat(i float32) string { } func (this *QLocale) ToCurrencyString3(i float32, symbol string, precision int) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString3(this.h, (C.float)(i), (*C.struct_miqt_string)(symbol_ms), (C.int)(precision)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1661,7 +1669,7 @@ func (this *QLocale) NumberOptions() QLocale__NumberOption { } func (this *QLocale) QuoteString(str string) string { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ms *C.struct_miqt_string = C.QLocale_QuoteString(this.h, (*C.struct_miqt_string)(str_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1674,7 +1682,7 @@ func (this *QLocale) CreateSeparatedList(strl []string) string { strl_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strl)))) defer C.free(unsafe.Pointer(strl_CArray)) for i := range strl { - strl_i_ms := miqt_strdupg(strl[i]) + strl_i_ms := libmiqt.Strdupg(strl[i]) defer C.free(strl_i_ms) strl_CArray[i] = (*C.struct_miqt_string)(strl_i_ms) } @@ -1687,61 +1695,61 @@ func (this *QLocale) CreateSeparatedList(strl []string) string { } func (this *QLocale) ToShort2(s string, ok *bool) int16 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int16)(C.QLocale_ToShort2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToUShort2(s string, ok *bool) uint16 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint16)(C.QLocale_ToUShort2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToInt2(s string, ok *bool) int { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int)(C.QLocale_ToInt2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToUInt2(s string, ok *bool) uint { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint)(C.QLocale_ToUInt2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToLong2(s string, ok *bool) int64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int64)(C.QLocale_ToLong2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToULong2(s string, ok *bool) uint64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint64)(C.QLocale_ToULong2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToLongLong2(s string, ok *bool) int64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (int64)(C.QLocale_ToLongLong2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToULongLong2(s string, ok *bool) uint64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (uint64)(C.QLocale_ToULongLong2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToFloat2(s string, ok *bool) float32 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (float32)(C.QLocale_ToFloat2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } func (this *QLocale) ToDouble2(s string, ok *bool) float64 { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) return (float64)(C.QLocale_ToDouble2(this.h, (*C.struct_miqt_string)(s_ms), (*C.bool)(unsafe.Pointer(ok)))) } @@ -1817,7 +1825,7 @@ func (this *QLocale) DateTimeFormat1(format QLocale__FormatType) string { } func (this *QLocale) ToDate22(stringVal string, param2 QLocale__FormatType) *QDate { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToDate22(this.h, (*C.struct_miqt_string)(stringVal_ms), (C.int)(param2)) _goptr := newQDate(_ret) @@ -1826,7 +1834,7 @@ func (this *QLocale) ToDate22(stringVal string, param2 QLocale__FormatType) *QDa } func (this *QLocale) ToTime22(stringVal string, param2 QLocale__FormatType) *QTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToTime22(this.h, (*C.struct_miqt_string)(stringVal_ms), (C.int)(param2)) _goptr := newQTime(_ret) @@ -1835,7 +1843,7 @@ func (this *QLocale) ToTime22(stringVal string, param2 QLocale__FormatType) *QTi } func (this *QLocale) ToDateTime22(stringVal string, format QLocale__FormatType) *QDateTime { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QLocale_ToDateTime22(this.h, (*C.struct_miqt_string)(stringVal_ms), (C.int)(format)) _goptr := newQDateTime(_ret) @@ -1879,7 +1887,7 @@ func (this *QLocale) CurrencySymbol1(param1 QLocale__CurrencySymbolFormat) strin } func (this *QLocale) ToCurrencyString22(param1 int64, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString22(this.h, (C.longlong)(param1), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1888,7 +1896,7 @@ func (this *QLocale) ToCurrencyString22(param1 int64, symbol string) string { } func (this *QLocale) ToCurrencyString23(param1 uint64, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString23(this.h, (C.ulonglong)(param1), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1897,7 +1905,7 @@ func (this *QLocale) ToCurrencyString23(param1 uint64, symbol string) string { } func (this *QLocale) ToCurrencyString24(param1 int16, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString24(this.h, (C.int16_t)(param1), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1906,7 +1914,7 @@ func (this *QLocale) ToCurrencyString24(param1 int16, symbol string) string { } func (this *QLocale) ToCurrencyString25(param1 uint16, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString25(this.h, (C.uint16_t)(param1), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1915,7 +1923,7 @@ func (this *QLocale) ToCurrencyString25(param1 uint16, symbol string) string { } func (this *QLocale) ToCurrencyString26(param1 int, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString26(this.h, (C.int)(param1), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1924,7 +1932,7 @@ func (this *QLocale) ToCurrencyString26(param1 int, symbol string) string { } func (this *QLocale) ToCurrencyString27(param1 uint, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString27(this.h, (C.uint)(param1), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1933,7 +1941,7 @@ func (this *QLocale) ToCurrencyString27(param1 uint, symbol string) string { } func (this *QLocale) ToCurrencyString28(param1 float64, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString28(this.h, (C.double)(param1), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1942,7 +1950,7 @@ func (this *QLocale) ToCurrencyString28(param1 float64, symbol string) string { } func (this *QLocale) ToCurrencyString29(i float32, symbol string) string { - symbol_ms := miqt_strdupg(symbol) + symbol_ms := libmiqt.Strdupg(symbol) defer C.free(symbol_ms) var _ms *C.struct_miqt_string = C.QLocale_ToCurrencyString29(this.h, (C.float)(i), (*C.struct_miqt_string)(symbol_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -1979,7 +1987,7 @@ func (this *QLocale) FormattedDataSize32(bytes int64, precision int, format QLoc } func (this *QLocale) QuoteString2(str string, style QLocale__QuotationStyle) string { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ms *C.struct_miqt_string = C.QLocale_QuoteString2(this.h, (*C.struct_miqt_string)(str_ms), (C.int)(style)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qlocale.h b/qt/gen_qlocale.h index dc9de32d..36ffdd03 100644 --- a/qt/gen_qlocale.h +++ b/qt/gen_qlocale.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qlockfile.cpp b/qt/gen_qlockfile.cpp index 96f57b19..98a566a6 100644 --- a/qt/gen_qlockfile.cpp +++ b/qt/gen_qlockfile.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qlockfile.h" +#include #include "gen_qlockfile.h" #include "_cgo_export.h" diff --git a/qt/gen_qlockfile.go b/qt/gen_qlockfile.go index 37dafd86..690b622c 100644 --- a/qt/gen_qlockfile.go +++ b/qt/gen_qlockfile.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -33,6 +34,13 @@ func (this *QLockFile) cPointer() *C.QLockFile { return this.h } +func (this *QLockFile) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLockFile(h *C.QLockFile) *QLockFile { if h == nil { return nil @@ -40,13 +48,13 @@ func newQLockFile(h *C.QLockFile) *QLockFile { return &QLockFile{h: h} } -func newQLockFile_U(h unsafe.Pointer) *QLockFile { +func UnsafeNewQLockFile(h unsafe.Pointer) *QLockFile { return newQLockFile((*C.QLockFile)(h)) } // NewQLockFile constructs a new QLockFile object. func NewQLockFile(fileName string) *QLockFile { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QLockFile_new((*C.struct_miqt_string)(fileName_ms)) return newQLockFile(ret) diff --git a/qt/gen_qlockfile.h b/qt/gen_qlockfile.h index ace760f8..d5fdc12d 100644 --- a/qt/gen_qlockfile.h +++ b/qt/gen_qlockfile.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qloggingcategory.cpp b/qt/gen_qloggingcategory.cpp index f2698a5f..a92f8357 100644 --- a/qt/gen_qloggingcategory.cpp +++ b/qt/gen_qloggingcategory.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qloggingcategory.h" +#include #include "gen_qloggingcategory.h" #include "_cgo_export.h" diff --git a/qt/gen_qloggingcategory.go b/qt/gen_qloggingcategory.go index a07c9e54..19fcfaf7 100644 --- a/qt/gen_qloggingcategory.go +++ b/qt/gen_qloggingcategory.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QLoggingCategory) cPointer() *C.QLoggingCategory { return this.h } +func (this *QLoggingCategory) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQLoggingCategory(h *C.QLoggingCategory) *QLoggingCategory { if h == nil { return nil @@ -31,7 +39,7 @@ func newQLoggingCategory(h *C.QLoggingCategory) *QLoggingCategory { return &QLoggingCategory{h: h} } -func newQLoggingCategory_U(h unsafe.Pointer) *QLoggingCategory { +func UnsafeNewQLoggingCategory(h unsafe.Pointer) *QLoggingCategory { return newQLoggingCategory((*C.QLoggingCategory)(h)) } @@ -65,19 +73,19 @@ func (this *QLoggingCategory) CategoryName() unsafe.Pointer { } func (this *QLoggingCategory) OperatorCall() *QLoggingCategory { - return newQLoggingCategory_U(unsafe.Pointer(C.QLoggingCategory_OperatorCall(this.h))) + return UnsafeNewQLoggingCategory(unsafe.Pointer(C.QLoggingCategory_OperatorCall(this.h))) } func (this *QLoggingCategory) OperatorCall2() *QLoggingCategory { - return newQLoggingCategory_U(unsafe.Pointer(C.QLoggingCategory_OperatorCall2(this.h))) + return UnsafeNewQLoggingCategory(unsafe.Pointer(C.QLoggingCategory_OperatorCall2(this.h))) } func QLoggingCategory_DefaultCategory() *QLoggingCategory { - return newQLoggingCategory_U(unsafe.Pointer(C.QLoggingCategory_DefaultCategory())) + return UnsafeNewQLoggingCategory(unsafe.Pointer(C.QLoggingCategory_DefaultCategory())) } func QLoggingCategory_SetFilterRules(rules string) { - rules_ms := miqt_strdupg(rules) + rules_ms := libmiqt.Strdupg(rules) defer C.free(rules_ms) C.QLoggingCategory_SetFilterRules((*C.struct_miqt_string)(rules_ms)) } diff --git a/qt/gen_qloggingcategory.h b/qt/gen_qloggingcategory.h index 888071ef..fbb4e2c5 100644 --- a/qt/gen_qloggingcategory.h +++ b/qt/gen_qloggingcategory.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmainwindow.cpp b/qt/gen_qmainwindow.cpp index eb0db42b..87298c0d 100644 --- a/qt/gen_qmainwindow.cpp +++ b/qt/gen_qmainwindow.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qmainwindow.h" +#include #include "gen_qmainwindow.h" #include "_cgo_export.h" @@ -249,7 +249,7 @@ int QMainWindow_DockWidgetArea(const QMainWindow* self, QDockWidget* dockwidget) } void QMainWindow_ResizeDocks(QMainWindow* self, struct miqt_array* /* of QDockWidget* */ docks, struct miqt_array* /* of int */ sizes, int orientation) { - QList docks_QList; + QList docks_QList; docks_QList.reserve(docks->len); QDockWidget** docks_arr = static_cast(docks->data); for(size_t i = 0; i < docks->len; ++i) { diff --git a/qt/gen_qmainwindow.go b/qt/gen_qmainwindow.go index 0a03b94f..b56a2037 100644 --- a/qt/gen_qmainwindow.go +++ b/qt/gen_qmainwindow.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -37,14 +38,21 @@ func (this *QMainWindow) cPointer() *C.QMainWindow { return this.h } +func (this *QMainWindow) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMainWindow(h *C.QMainWindow) *QMainWindow { if h == nil { return nil } - return &QMainWindow{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QMainWindow{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQMainWindow_U(h unsafe.Pointer) *QMainWindow { +func UnsafeNewQMainWindow(h unsafe.Pointer) *QMainWindow { return newQMainWindow((*C.QMainWindow)(h)) } @@ -67,7 +75,7 @@ func NewQMainWindow3(parent *QWidget, flags WindowType) *QMainWindow { } func (this *QMainWindow) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMainWindow_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMainWindow_MetaObject(this.h))) } func (this *QMainWindow) Metacast(param1 string) unsafe.Pointer { @@ -158,7 +166,7 @@ func (this *QMainWindow) IsSeparator(pos *QPoint) bool { } func (this *QMainWindow) MenuBar() *QMenuBar { - return newQMenuBar_U(unsafe.Pointer(C.QMainWindow_MenuBar(this.h))) + return UnsafeNewQMenuBar(unsafe.Pointer(C.QMainWindow_MenuBar(this.h))) } func (this *QMainWindow) SetMenuBar(menubar *QMenuBar) { @@ -166,7 +174,7 @@ func (this *QMainWindow) SetMenuBar(menubar *QMenuBar) { } func (this *QMainWindow) MenuWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMainWindow_MenuWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMainWindow_MenuWidget(this.h))) } func (this *QMainWindow) SetMenuWidget(menubar *QWidget) { @@ -174,7 +182,7 @@ func (this *QMainWindow) SetMenuWidget(menubar *QWidget) { } func (this *QMainWindow) StatusBar() *QStatusBar { - return newQStatusBar_U(unsafe.Pointer(C.QMainWindow_StatusBar(this.h))) + return UnsafeNewQStatusBar(unsafe.Pointer(C.QMainWindow_StatusBar(this.h))) } func (this *QMainWindow) SetStatusBar(statusbar *QStatusBar) { @@ -182,7 +190,7 @@ func (this *QMainWindow) SetStatusBar(statusbar *QStatusBar) { } func (this *QMainWindow) CentralWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMainWindow_CentralWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMainWindow_CentralWidget(this.h))) } func (this *QMainWindow) SetCentralWidget(widget *QWidget) { @@ -190,7 +198,7 @@ func (this *QMainWindow) SetCentralWidget(widget *QWidget) { } func (this *QMainWindow) TakeCentralWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMainWindow_TakeCentralWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMainWindow_TakeCentralWidget(this.h))) } func (this *QMainWindow) SetCorner(corner Corner, area DockWidgetArea) { @@ -218,9 +226,9 @@ func (this *QMainWindow) AddToolBarWithToolbar(toolbar *QToolBar) { } func (this *QMainWindow) AddToolBarWithTitle(title string) *QToolBar { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - return newQToolBar_U(unsafe.Pointer(C.QMainWindow_AddToolBarWithTitle(this.h, (*C.struct_miqt_string)(title_ms)))) + return UnsafeNewQToolBar(unsafe.Pointer(C.QMainWindow_AddToolBarWithTitle(this.h, (*C.struct_miqt_string)(title_ms)))) } func (this *QMainWindow) InsertToolBar(before *QToolBar, toolbar *QToolBar) { @@ -268,7 +276,7 @@ func (this *QMainWindow) TabifiedDockWidgets(dockwidget *QDockWidget) []*QDockWi _ret := make([]*QDockWidget, int(_ma.len)) _outCast := (*[0xffff]*C.QDockWidget)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQDockWidget_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQDockWidget(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -318,7 +326,7 @@ func (this *QMainWindow) RestoreState(state *QByteArray) bool { } func (this *QMainWindow) CreatePopupMenu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QMainWindow_CreatePopupMenu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QMainWindow_CreatePopupMenu(this.h))) } func (this *QMainWindow) SetAnimated(enabled bool) { @@ -348,7 +356,7 @@ func miqt_exec_callback_QMainWindow_IconSizeChanged(cb C.intptr_t, iconSize *C.Q } // Convert all CABI parameters to Go parameters - slotval1 := newQSize_U(unsafe.Pointer(iconSize)) + slotval1 := UnsafeNewQSize(unsafe.Pointer(iconSize)) gofunc(slotval1) } @@ -388,7 +396,7 @@ func miqt_exec_callback_QMainWindow_TabifiedDockWidgetActivated(cb C.intptr_t, d } // Convert all CABI parameters to Go parameters - slotval1 := newQDockWidget_U(unsafe.Pointer(dockWidget)) + slotval1 := UnsafeNewQDockWidget(unsafe.Pointer(dockWidget)) gofunc(slotval1) } diff --git a/qt/gen_qmainwindow.h b/qt/gen_qmainwindow.h index 6322dfba..72c6126a 100644 --- a/qt/gen_qmainwindow.h +++ b/qt/gen_qmainwindow.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmap.cpp b/qt/gen_qmap.cpp index 7ada1a0d..17f13bd7 100644 --- a/qt/gen_qmap.cpp +++ b/qt/gen_qmap.cpp @@ -1,6 +1,6 @@ #include #include -#include "qmap.h" +#include #include "gen_qmap.h" #include "_cgo_export.h" diff --git a/qt/gen_qmap.go b/qt/gen_qmap.go index 2c8dd812..e5060b3a 100644 --- a/qt/gen_qmap.go +++ b/qt/gen_qmap.go @@ -37,6 +37,13 @@ func (this *QMapNodeBase) cPointer() *C.QMapNodeBase { return this.h } +func (this *QMapNodeBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMapNodeBase(h *C.QMapNodeBase) *QMapNodeBase { if h == nil { return nil @@ -44,7 +51,7 @@ func newQMapNodeBase(h *C.QMapNodeBase) *QMapNodeBase { return &QMapNodeBase{h: h} } -func newQMapNodeBase_U(h unsafe.Pointer) *QMapNodeBase { +func UnsafeNewQMapNodeBase(h unsafe.Pointer) *QMapNodeBase { return newQMapNodeBase((*C.QMapNodeBase)(h)) } @@ -55,19 +62,19 @@ func NewQMapNodeBase(param1 *QMapNodeBase) *QMapNodeBase { } func (this *QMapNodeBase) NextNode() *QMapNodeBase { - return newQMapNodeBase_U(unsafe.Pointer(C.QMapNodeBase_NextNode(this.h))) + return UnsafeNewQMapNodeBase(unsafe.Pointer(C.QMapNodeBase_NextNode(this.h))) } func (this *QMapNodeBase) NextNode2() *QMapNodeBase { - return newQMapNodeBase_U(unsafe.Pointer(C.QMapNodeBase_NextNode2(this.h))) + return UnsafeNewQMapNodeBase(unsafe.Pointer(C.QMapNodeBase_NextNode2(this.h))) } func (this *QMapNodeBase) PreviousNode() *QMapNodeBase { - return newQMapNodeBase_U(unsafe.Pointer(C.QMapNodeBase_PreviousNode(this.h))) + return UnsafeNewQMapNodeBase(unsafe.Pointer(C.QMapNodeBase_PreviousNode(this.h))) } func (this *QMapNodeBase) PreviousNode2() *QMapNodeBase { - return newQMapNodeBase_U(unsafe.Pointer(C.QMapNodeBase_PreviousNode2(this.h))) + return UnsafeNewQMapNodeBase(unsafe.Pointer(C.QMapNodeBase_PreviousNode2(this.h))) } func (this *QMapNodeBase) Color() QMapNodeBase__Color { @@ -79,7 +86,7 @@ func (this *QMapNodeBase) SetColor(c QMapNodeBase__Color) { } func (this *QMapNodeBase) Parent() *QMapNodeBase { - return newQMapNodeBase_U(unsafe.Pointer(C.QMapNodeBase_Parent(this.h))) + return UnsafeNewQMapNodeBase(unsafe.Pointer(C.QMapNodeBase_Parent(this.h))) } func (this *QMapNodeBase) SetParent(pp *QMapNodeBase) { @@ -115,6 +122,13 @@ func (this *QMapDataBase) cPointer() *C.QMapDataBase { return this.h } +func (this *QMapDataBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMapDataBase(h *C.QMapDataBase) *QMapDataBase { if h == nil { return nil @@ -122,7 +136,7 @@ func newQMapDataBase(h *C.QMapDataBase) *QMapDataBase { return &QMapDataBase{h: h} } -func newQMapDataBase_U(h unsafe.Pointer) *QMapDataBase { +func UnsafeNewQMapDataBase(h unsafe.Pointer) *QMapDataBase { return newQMapDataBase((*C.QMapDataBase)(h)) } @@ -147,7 +161,7 @@ func (this *QMapDataBase) RecalcMostLeftNode() { } func (this *QMapDataBase) CreateNode(size int, alignment int, parent *QMapNodeBase, left bool) *QMapNodeBase { - return newQMapNodeBase_U(unsafe.Pointer(C.QMapDataBase_CreateNode(this.h, (C.int)(size), (C.int)(alignment), parent.cPointer(), (C.bool)(left)))) + return UnsafeNewQMapNodeBase(unsafe.Pointer(C.QMapDataBase_CreateNode(this.h, (C.int)(size), (C.int)(alignment), parent.cPointer(), (C.bool)(left)))) } func (this *QMapDataBase) FreeTree(root *QMapNodeBase, alignment int) { @@ -155,7 +169,7 @@ func (this *QMapDataBase) FreeTree(root *QMapNodeBase, alignment int) { } func QMapDataBase_CreateData() *QMapDataBase { - return newQMapDataBase_U(unsafe.Pointer(C.QMapDataBase_CreateData())) + return UnsafeNewQMapDataBase(unsafe.Pointer(C.QMapDataBase_CreateData())) } func QMapDataBase_FreeData(d *QMapDataBase) { diff --git a/qt/gen_qmap.h b/qt/gen_qmap.h index f77455d7..b8b90891 100644 --- a/qt/gen_qmap.h +++ b/qt/gen_qmap.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmargins.cpp b/qt/gen_qmargins.cpp index 99fd4ab3..6d52a535 100644 --- a/qt/gen_qmargins.cpp +++ b/qt/gen_qmargins.cpp @@ -1,6 +1,6 @@ #include #include -#include "qmargins.h" +#include #include "gen_qmargins.h" #include "_cgo_export.h" diff --git a/qt/gen_qmargins.go b/qt/gen_qmargins.go index 3745c546..d97e25d0 100644 --- a/qt/gen_qmargins.go +++ b/qt/gen_qmargins.go @@ -24,6 +24,13 @@ func (this *QMargins) cPointer() *C.QMargins { return this.h } +func (this *QMargins) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMargins(h *C.QMargins) *QMargins { if h == nil { return nil @@ -31,7 +38,7 @@ func newQMargins(h *C.QMargins) *QMargins { return &QMargins{h: h} } -func newQMargins_U(h unsafe.Pointer) *QMargins { +func UnsafeNewQMargins(h unsafe.Pointer) *QMargins { return newQMargins((*C.QMargins)(h)) } @@ -90,35 +97,35 @@ func (this *QMargins) SetBottom(bottom int) { } func (this *QMargins) OperatorPlusAssign(margins *QMargins) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorPlusAssign(this.h, margins.cPointer()))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorPlusAssign(this.h, margins.cPointer()))) } func (this *QMargins) OperatorMinusAssign(margins *QMargins) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorMinusAssign(this.h, margins.cPointer()))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorMinusAssign(this.h, margins.cPointer()))) } func (this *QMargins) OperatorPlusAssignWithInt(param1 int) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorPlusAssignWithInt(this.h, (C.int)(param1)))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorPlusAssignWithInt(this.h, (C.int)(param1)))) } func (this *QMargins) OperatorMinusAssignWithInt(param1 int) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorMinusAssignWithInt(this.h, (C.int)(param1)))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorMinusAssignWithInt(this.h, (C.int)(param1)))) } func (this *QMargins) OperatorMultiplyAssign(param1 int) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorMultiplyAssign(this.h, (C.int)(param1)))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorMultiplyAssign(this.h, (C.int)(param1)))) } func (this *QMargins) OperatorDivideAssign(param1 int) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorDivideAssign(this.h, (C.int)(param1)))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorDivideAssign(this.h, (C.int)(param1)))) } func (this *QMargins) OperatorMultiplyAssignWithQreal(param1 float64) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorMultiplyAssignWithQreal(this.h, (C.double)(param1)))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorMultiplyAssignWithQreal(this.h, (C.double)(param1)))) } func (this *QMargins) OperatorDivideAssignWithQreal(param1 float64) *QMargins { - return newQMargins_U(unsafe.Pointer(C.QMargins_OperatorDivideAssignWithQreal(this.h, (C.double)(param1)))) + return UnsafeNewQMargins(unsafe.Pointer(C.QMargins_OperatorDivideAssignWithQreal(this.h, (C.double)(param1)))) } // Delete this object from C++ memory. @@ -146,6 +153,13 @@ func (this *QMarginsF) cPointer() *C.QMarginsF { return this.h } +func (this *QMarginsF) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMarginsF(h *C.QMarginsF) *QMarginsF { if h == nil { return nil @@ -153,7 +167,7 @@ func newQMarginsF(h *C.QMarginsF) *QMarginsF { return &QMarginsF{h: h} } -func newQMarginsF_U(h unsafe.Pointer) *QMarginsF { +func UnsafeNewQMarginsF(h unsafe.Pointer) *QMarginsF { return newQMarginsF((*C.QMarginsF)(h)) } @@ -218,27 +232,27 @@ func (this *QMarginsF) SetBottom(bottom float64) { } func (this *QMarginsF) OperatorPlusAssign(margins *QMarginsF) *QMarginsF { - return newQMarginsF_U(unsafe.Pointer(C.QMarginsF_OperatorPlusAssign(this.h, margins.cPointer()))) + return UnsafeNewQMarginsF(unsafe.Pointer(C.QMarginsF_OperatorPlusAssign(this.h, margins.cPointer()))) } func (this *QMarginsF) OperatorMinusAssign(margins *QMarginsF) *QMarginsF { - return newQMarginsF_U(unsafe.Pointer(C.QMarginsF_OperatorMinusAssign(this.h, margins.cPointer()))) + return UnsafeNewQMarginsF(unsafe.Pointer(C.QMarginsF_OperatorMinusAssign(this.h, margins.cPointer()))) } func (this *QMarginsF) OperatorPlusAssignWithAddend(addend float64) *QMarginsF { - return newQMarginsF_U(unsafe.Pointer(C.QMarginsF_OperatorPlusAssignWithAddend(this.h, (C.double)(addend)))) + return UnsafeNewQMarginsF(unsafe.Pointer(C.QMarginsF_OperatorPlusAssignWithAddend(this.h, (C.double)(addend)))) } func (this *QMarginsF) OperatorMinusAssignWithSubtrahend(subtrahend float64) *QMarginsF { - return newQMarginsF_U(unsafe.Pointer(C.QMarginsF_OperatorMinusAssignWithSubtrahend(this.h, (C.double)(subtrahend)))) + return UnsafeNewQMarginsF(unsafe.Pointer(C.QMarginsF_OperatorMinusAssignWithSubtrahend(this.h, (C.double)(subtrahend)))) } func (this *QMarginsF) OperatorMultiplyAssign(factor float64) *QMarginsF { - return newQMarginsF_U(unsafe.Pointer(C.QMarginsF_OperatorMultiplyAssign(this.h, (C.double)(factor)))) + return UnsafeNewQMarginsF(unsafe.Pointer(C.QMarginsF_OperatorMultiplyAssign(this.h, (C.double)(factor)))) } func (this *QMarginsF) OperatorDivideAssign(divisor float64) *QMarginsF { - return newQMarginsF_U(unsafe.Pointer(C.QMarginsF_OperatorDivideAssign(this.h, (C.double)(divisor)))) + return UnsafeNewQMarginsF(unsafe.Pointer(C.QMarginsF_OperatorDivideAssign(this.h, (C.double)(divisor)))) } func (this *QMarginsF) ToMargins() *QMargins { diff --git a/qt/gen_qmargins.h b/qt/gen_qmargins.h index 5897693d..2d403ec0 100644 --- a/qt/gen_qmargins.h +++ b/qt/gen_qmargins.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmatrix.cpp b/qt/gen_qmatrix.cpp index 5a9b32e5..caad16ea 100644 --- a/qt/gen_qmatrix.cpp +++ b/qt/gen_qmatrix.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qmatrix.h" +#include #include "gen_qmatrix.h" #include "_cgo_export.h" diff --git a/qt/gen_qmatrix.go b/qt/gen_qmatrix.go index 93be44ed..34ee6a67 100644 --- a/qt/gen_qmatrix.go +++ b/qt/gen_qmatrix.go @@ -24,6 +24,13 @@ func (this *QMatrix) cPointer() *C.QMatrix { return this.h } +func (this *QMatrix) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMatrix(h *C.QMatrix) *QMatrix { if h == nil { return nil @@ -31,7 +38,7 @@ func newQMatrix(h *C.QMatrix) *QMatrix { return &QMatrix{h: h} } -func newQMatrix_U(h unsafe.Pointer) *QMatrix { +func UnsafeNewQMatrix(h unsafe.Pointer) *QMatrix { return newQMatrix((*C.QMatrix)(h)) } @@ -164,19 +171,19 @@ func (this *QMatrix) IsIdentity() bool { } func (this *QMatrix) Translate(dx float64, dy float64) *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QMatrix_Translate(this.h, (C.double)(dx), (C.double)(dy)))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Translate(this.h, (C.double)(dx), (C.double)(dy)))) } func (this *QMatrix) Scale(sx float64, sy float64) *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QMatrix_Scale(this.h, (C.double)(sx), (C.double)(sy)))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Scale(this.h, (C.double)(sx), (C.double)(sy)))) } func (this *QMatrix) Shear(sh float64, sv float64) *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QMatrix_Shear(this.h, (C.double)(sh), (C.double)(sv)))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Shear(this.h, (C.double)(sh), (C.double)(sv)))) } func (this *QMatrix) Rotate(a float64) *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QMatrix_Rotate(this.h, (C.double)(a)))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_Rotate(this.h, (C.double)(a)))) } func (this *QMatrix) IsInvertible() bool { @@ -203,7 +210,7 @@ func (this *QMatrix) OperatorNotEqual(param1 *QMatrix) bool { } func (this *QMatrix) OperatorMultiplyAssign(param1 *QMatrix) *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QMatrix_OperatorMultiplyAssign(this.h, param1.cPointer()))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QMatrix_OperatorMultiplyAssign(this.h, param1.cPointer()))) } func (this *QMatrix) OperatorMultiply(o *QMatrix) *QMatrix { diff --git a/qt/gen_qmatrix.h b/qt/gen_qmatrix.h index 037fe57b..7dd4d12e 100644 --- a/qt/gen_qmatrix.h +++ b/qt/gen_qmatrix.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmatrix4x4.cpp b/qt/gen_qmatrix4x4.cpp index 3700f076..e08158a9 100644 --- a/qt/gen_qmatrix4x4.cpp +++ b/qt/gen_qmatrix4x4.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qmatrix4x4.h" +#include #include "gen_qmatrix4x4.h" #include "_cgo_export.h" diff --git a/qt/gen_qmatrix4x4.go b/qt/gen_qmatrix4x4.go index a4aa2b7d..fa323284 100644 --- a/qt/gen_qmatrix4x4.go +++ b/qt/gen_qmatrix4x4.go @@ -24,6 +24,13 @@ func (this *QMatrix4x4) cPointer() *C.QMatrix4x4 { return this.h } +func (this *QMatrix4x4) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMatrix4x4(h *C.QMatrix4x4) *QMatrix4x4 { if h == nil { return nil @@ -31,7 +38,7 @@ func newQMatrix4x4(h *C.QMatrix4x4) *QMatrix4x4 { return &QMatrix4x4{h: h} } -func newQMatrix4x4_U(h unsafe.Pointer) *QMatrix4x4 { +func UnsafeNewQMatrix4x4(h unsafe.Pointer) *QMatrix4x4 { return newQMatrix4x4((*C.QMatrix4x4)(h)) } @@ -140,23 +147,23 @@ func (this *QMatrix4x4) Transposed() *QMatrix4x4 { } func (this *QMatrix4x4) OperatorPlusAssign(other *QMatrix4x4) *QMatrix4x4 { - return newQMatrix4x4_U(unsafe.Pointer(C.QMatrix4x4_OperatorPlusAssign(this.h, other.cPointer()))) + return UnsafeNewQMatrix4x4(unsafe.Pointer(C.QMatrix4x4_OperatorPlusAssign(this.h, other.cPointer()))) } func (this *QMatrix4x4) OperatorMinusAssign(other *QMatrix4x4) *QMatrix4x4 { - return newQMatrix4x4_U(unsafe.Pointer(C.QMatrix4x4_OperatorMinusAssign(this.h, other.cPointer()))) + return UnsafeNewQMatrix4x4(unsafe.Pointer(C.QMatrix4x4_OperatorMinusAssign(this.h, other.cPointer()))) } func (this *QMatrix4x4) OperatorMultiplyAssign(other *QMatrix4x4) *QMatrix4x4 { - return newQMatrix4x4_U(unsafe.Pointer(C.QMatrix4x4_OperatorMultiplyAssign(this.h, other.cPointer()))) + return UnsafeNewQMatrix4x4(unsafe.Pointer(C.QMatrix4x4_OperatorMultiplyAssign(this.h, other.cPointer()))) } func (this *QMatrix4x4) OperatorMultiplyAssignWithFactor(factor float32) *QMatrix4x4 { - return newQMatrix4x4_U(unsafe.Pointer(C.QMatrix4x4_OperatorMultiplyAssignWithFactor(this.h, (C.float)(factor)))) + return UnsafeNewQMatrix4x4(unsafe.Pointer(C.QMatrix4x4_OperatorMultiplyAssignWithFactor(this.h, (C.float)(factor)))) } func (this *QMatrix4x4) OperatorDivideAssign(divisor float32) *QMatrix4x4 { - return newQMatrix4x4_U(unsafe.Pointer(C.QMatrix4x4_OperatorDivideAssign(this.h, (C.float)(divisor)))) + return UnsafeNewQMatrix4x4(unsafe.Pointer(C.QMatrix4x4_OperatorDivideAssign(this.h, (C.float)(divisor)))) } func (this *QMatrix4x4) OperatorEqual(other *QMatrix4x4) bool { diff --git a/qt/gen_qmatrix4x4.h b/qt/gen_qmatrix4x4.h index 960e5329..0f956c82 100644 --- a/qt/gen_qmatrix4x4.h +++ b/qt/gen_qmatrix4x4.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmdiarea.cpp b/qt/gen_qmdiarea.cpp index 820967a3..36c8a877 100644 --- a/qt/gen_qmdiarea.cpp +++ b/qt/gen_qmdiarea.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qmdiarea.h" +#include #include "gen_qmdiarea.h" #include "_cgo_export.h" diff --git a/qt/gen_qmdiarea.go b/qt/gen_qmdiarea.go index 10cc9699..cea8cf23 100644 --- a/qt/gen_qmdiarea.go +++ b/qt/gen_qmdiarea.go @@ -47,14 +47,21 @@ func (this *QMdiArea) cPointer() *C.QMdiArea { return this.h } +func (this *QMdiArea) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMdiArea(h *C.QMdiArea) *QMdiArea { if h == nil { return nil } - return &QMdiArea{h: h, QAbstractScrollArea: newQAbstractScrollArea_U(unsafe.Pointer(h))} + return &QMdiArea{h: h, QAbstractScrollArea: UnsafeNewQAbstractScrollArea(unsafe.Pointer(h))} } -func newQMdiArea_U(h unsafe.Pointer) *QMdiArea { +func UnsafeNewQMdiArea(h unsafe.Pointer) *QMdiArea { return newQMdiArea((*C.QMdiArea)(h)) } @@ -71,7 +78,7 @@ func NewQMdiArea2(parent *QWidget) *QMdiArea { } func (this *QMdiArea) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMdiArea_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMdiArea_MetaObject(this.h))) } func (this *QMdiArea) Metacast(param1 string) unsafe.Pointer { @@ -113,11 +120,11 @@ func (this *QMdiArea) MinimumSizeHint() *QSize { } func (this *QMdiArea) CurrentSubWindow() *QMdiSubWindow { - return newQMdiSubWindow_U(unsafe.Pointer(C.QMdiArea_CurrentSubWindow(this.h))) + return UnsafeNewQMdiSubWindow(unsafe.Pointer(C.QMdiArea_CurrentSubWindow(this.h))) } func (this *QMdiArea) ActiveSubWindow() *QMdiSubWindow { - return newQMdiSubWindow_U(unsafe.Pointer(C.QMdiArea_ActiveSubWindow(this.h))) + return UnsafeNewQMdiSubWindow(unsafe.Pointer(C.QMdiArea_ActiveSubWindow(this.h))) } func (this *QMdiArea) SubWindowList() []*QMdiSubWindow { @@ -125,14 +132,14 @@ func (this *QMdiArea) SubWindowList() []*QMdiSubWindow { _ret := make([]*QMdiSubWindow, int(_ma.len)) _outCast := (*[0xffff]*C.QMdiSubWindow)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQMdiSubWindow_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQMdiSubWindow(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QMdiArea) AddSubWindow(widget *QWidget) *QMdiSubWindow { - return newQMdiSubWindow_U(unsafe.Pointer(C.QMdiArea_AddSubWindow(this.h, widget.cPointer()))) + return UnsafeNewQMdiSubWindow(unsafe.Pointer(C.QMdiArea_AddSubWindow(this.h, widget.cPointer()))) } func (this *QMdiArea) RemoveSubWindow(widget *QWidget) { @@ -229,7 +236,7 @@ func miqt_exec_callback_QMdiArea_SubWindowActivated(cb C.intptr_t, param1 *C.QMd } // Convert all CABI parameters to Go parameters - slotval1 := newQMdiSubWindow_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQMdiSubWindow(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -311,14 +318,14 @@ func (this *QMdiArea) SubWindowList1(order QMdiArea__WindowOrder) []*QMdiSubWind _ret := make([]*QMdiSubWindow, int(_ma.len)) _outCast := (*[0xffff]*C.QMdiSubWindow)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQMdiSubWindow_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQMdiSubWindow(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QMdiArea) AddSubWindow2(widget *QWidget, flags WindowType) *QMdiSubWindow { - return newQMdiSubWindow_U(unsafe.Pointer(C.QMdiArea_AddSubWindow2(this.h, widget.cPointer(), (C.int)(flags)))) + return UnsafeNewQMdiSubWindow(unsafe.Pointer(C.QMdiArea_AddSubWindow2(this.h, widget.cPointer(), (C.int)(flags)))) } func (this *QMdiArea) SetOption2(option QMdiArea__AreaOption, on bool) { diff --git a/qt/gen_qmdiarea.h b/qt/gen_qmdiarea.h index 37d42eed..406da3a1 100644 --- a/qt/gen_qmdiarea.h +++ b/qt/gen_qmdiarea.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmdisubwindow.cpp b/qt/gen_qmdisubwindow.cpp index 2950bfeb..db3811e3 100644 --- a/qt/gen_qmdisubwindow.cpp +++ b/qt/gen_qmdisubwindow.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qmdisubwindow.h" +#include #include "gen_qmdisubwindow.h" #include "_cgo_export.h" diff --git a/qt/gen_qmdisubwindow.go b/qt/gen_qmdisubwindow.go index e48f1686..433be17c 100644 --- a/qt/gen_qmdisubwindow.go +++ b/qt/gen_qmdisubwindow.go @@ -35,14 +35,21 @@ func (this *QMdiSubWindow) cPointer() *C.QMdiSubWindow { return this.h } +func (this *QMdiSubWindow) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMdiSubWindow(h *C.QMdiSubWindow) *QMdiSubWindow { if h == nil { return nil } - return &QMdiSubWindow{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QMdiSubWindow{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQMdiSubWindow_U(h unsafe.Pointer) *QMdiSubWindow { +func UnsafeNewQMdiSubWindow(h unsafe.Pointer) *QMdiSubWindow { return newQMdiSubWindow((*C.QMdiSubWindow)(h)) } @@ -65,7 +72,7 @@ func NewQMdiSubWindow3(parent *QWidget, flags WindowType) *QMdiSubWindow { } func (this *QMdiSubWindow) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMdiSubWindow_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMdiSubWindow_MetaObject(this.h))) } func (this *QMdiSubWindow) Metacast(param1 string) unsafe.Pointer { @@ -111,15 +118,15 @@ func (this *QMdiSubWindow) SetWidget(widget *QWidget) { } func (this *QMdiSubWindow) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMdiSubWindow_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMdiSubWindow_Widget(this.h))) } func (this *QMdiSubWindow) MaximizedButtonsWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMdiSubWindow_MaximizedButtonsWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMdiSubWindow_MaximizedButtonsWidget(this.h))) } func (this *QMdiSubWindow) MaximizedSystemMenuIconWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMdiSubWindow_MaximizedSystemMenuIconWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMdiSubWindow_MaximizedSystemMenuIconWidget(this.h))) } func (this *QMdiSubWindow) IsShaded() bool { @@ -155,11 +162,11 @@ func (this *QMdiSubWindow) SetSystemMenu(systemMenu *QMenu) { } func (this *QMdiSubWindow) SystemMenu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QMdiSubWindow_SystemMenu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QMdiSubWindow_SystemMenu(this.h))) } func (this *QMdiSubWindow) MdiArea() *QMdiArea { - return newQMdiArea_U(unsafe.Pointer(C.QMdiSubWindow_MdiArea(this.h))) + return UnsafeNewQMdiArea(unsafe.Pointer(C.QMdiSubWindow_MdiArea(this.h))) } func (this *QMdiSubWindow) WindowStateChanged(oldState WindowState, newState WindowState) { diff --git a/qt/gen_qmdisubwindow.h b/qt/gen_qmdisubwindow.h index a3b6af6e..77d16490 100644 --- a/qt/gen_qmdisubwindow.h +++ b/qt/gen_qmdisubwindow.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmenu.cpp b/qt/gen_qmenu.cpp index 3cd33a9a..02cd85eb 100644 --- a/qt/gen_qmenu.cpp +++ b/qt/gen_qmenu.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qmenu.h" +#include #include "gen_qmenu.h" #include "_cgo_export.h" @@ -171,7 +171,7 @@ QAction* QMenu_ExecWithPos(QMenu* self, QPoint* pos) { } QAction* QMenu_Exec2(struct miqt_array* /* of QAction* */ actions, QPoint* pos) { - QList actions_QList; + QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { @@ -315,7 +315,7 @@ QAction* QMenu_Exec22(QMenu* self, QPoint* pos, QAction* at) { } QAction* QMenu_Exec3(struct miqt_array* /* of QAction* */ actions, QPoint* pos, QAction* at) { - QList actions_QList; + QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { @@ -325,7 +325,7 @@ QAction* QMenu_Exec3(struct miqt_array* /* of QAction* */ actions, QPoint* pos, } QAction* QMenu_Exec4(struct miqt_array* /* of QAction* */ actions, QPoint* pos, QAction* at, QWidget* parent) { - QList actions_QList; + QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { diff --git a/qt/gen_qmenu.go b/qt/gen_qmenu.go index af22b90e..eba3f93c 100644 --- a/qt/gen_qmenu.go +++ b/qt/gen_qmenu.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QMenu) cPointer() *C.QMenu { return this.h } +func (this *QMenu) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMenu(h *C.QMenu) *QMenu { if h == nil { return nil } - return &QMenu{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QMenu{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQMenu_U(h unsafe.Pointer) *QMenu { +func UnsafeNewQMenu(h unsafe.Pointer) *QMenu { return newQMenu((*C.QMenu)(h)) } @@ -45,7 +53,7 @@ func NewQMenu() *QMenu { // NewQMenu2 constructs a new QMenu object. func NewQMenu2(title string) *QMenu { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QMenu_new2((*C.struct_miqt_string)(title_ms)) return newQMenu(ret) @@ -59,14 +67,14 @@ func NewQMenu3(parent *QWidget) *QMenu { // NewQMenu4 constructs a new QMenu object. func NewQMenu4(title string, parent *QWidget) *QMenu { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QMenu_new4((*C.struct_miqt_string)(title_ms), parent.cPointer()) return newQMenu(ret) } func (this *QMenu) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMenu_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMenu_MetaObject(this.h))) } func (this *QMenu) Metacast(param1 string) unsafe.Pointer { @@ -94,67 +102,67 @@ func QMenu_TrUtf8(s string) string { } func (this *QMenu) AddAction(text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QMenu_AddAction(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_AddAction(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QMenu) AddAction2(icon *QIcon, text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QMenu_AddAction2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_AddAction2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) } func (this *QMenu) AddMenu(menu *QMenu) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_AddMenu(this.h, menu.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_AddMenu(this.h, menu.cPointer()))) } func (this *QMenu) AddMenuWithTitle(title string) *QMenu { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - return newQMenu_U(unsafe.Pointer(C.QMenu_AddMenuWithTitle(this.h, (*C.struct_miqt_string)(title_ms)))) + return UnsafeNewQMenu(unsafe.Pointer(C.QMenu_AddMenuWithTitle(this.h, (*C.struct_miqt_string)(title_ms)))) } func (this *QMenu) AddMenu2(icon *QIcon, title string) *QMenu { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - return newQMenu_U(unsafe.Pointer(C.QMenu_AddMenu2(this.h, icon.cPointer(), (*C.struct_miqt_string)(title_ms)))) + return UnsafeNewQMenu(unsafe.Pointer(C.QMenu_AddMenu2(this.h, icon.cPointer(), (*C.struct_miqt_string)(title_ms)))) } func (this *QMenu) AddSeparator() *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_AddSeparator(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_AddSeparator(this.h))) } func (this *QMenu) AddSection(text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QMenu_AddSection(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_AddSection(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QMenu) AddSection2(icon *QIcon, text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QMenu_AddSection2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_AddSection2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) } func (this *QMenu) InsertMenu(before *QAction, menu *QMenu) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_InsertMenu(this.h, before.cPointer(), menu.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_InsertMenu(this.h, before.cPointer(), menu.cPointer()))) } func (this *QMenu) InsertSeparator(before *QAction) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_InsertSeparator(this.h, before.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_InsertSeparator(this.h, before.cPointer()))) } func (this *QMenu) InsertSection(before *QAction, text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QMenu_InsertSection(this.h, before.cPointer(), (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_InsertSection(this.h, before.cPointer(), (*C.struct_miqt_string)(text_ms)))) } func (this *QMenu) InsertSection2(before *QAction, icon *QIcon, text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QMenu_InsertSection2(this.h, before.cPointer(), icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_InsertSection2(this.h, before.cPointer(), icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) } func (this *QMenu) IsEmpty() bool { @@ -194,7 +202,7 @@ func (this *QMenu) SetDefaultAction(defaultAction *QAction) { } func (this *QMenu) DefaultAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_DefaultAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_DefaultAction(this.h))) } func (this *QMenu) SetActiveAction(act *QAction) { @@ -202,7 +210,7 @@ func (this *QMenu) SetActiveAction(act *QAction) { } func (this *QMenu) ActiveAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_ActiveAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_ActiveAction(this.h))) } func (this *QMenu) Popup(pos *QPoint) { @@ -210,11 +218,11 @@ func (this *QMenu) Popup(pos *QPoint) { } func (this *QMenu) Exec() *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_Exec(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_Exec(this.h))) } func (this *QMenu) ExecWithPos(pos *QPoint) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_ExecWithPos(this.h, pos.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_ExecWithPos(this.h, pos.cPointer()))) } func QMenu_Exec2(actions []*QAction, pos *QPoint) *QAction { @@ -226,7 +234,7 @@ func QMenu_Exec2(actions []*QAction, pos *QPoint) *QAction { } actions_ma := &C.struct_miqt_array{len: C.size_t(len(actions)), data: unsafe.Pointer(actions_CArray)} defer runtime.KeepAlive(unsafe.Pointer(actions_ma)) - return newQAction_U(unsafe.Pointer(C.QMenu_Exec2(actions_ma, pos.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_Exec2(actions_ma, pos.cPointer()))) } func (this *QMenu) SizeHint() *QSize { @@ -244,11 +252,11 @@ func (this *QMenu) ActionGeometry(param1 *QAction) *QRect { } func (this *QMenu) ActionAt(param1 *QPoint) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_ActionAt(this.h, param1.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_ActionAt(this.h, param1.cPointer()))) } func (this *QMenu) MenuAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_MenuAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_MenuAction(this.h))) } func (this *QMenu) Title() string { @@ -259,7 +267,7 @@ func (this *QMenu) Title() string { } func (this *QMenu) SetTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QMenu_SetTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -344,7 +352,7 @@ func miqt_exec_callback_QMenu_Triggered(cb C.intptr_t, action *C.QAction) { } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(action)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(action)) gofunc(slotval1) } @@ -364,7 +372,7 @@ func miqt_exec_callback_QMenu_Hovered(cb C.intptr_t, action *C.QAction) { } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(action)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(action)) gofunc(slotval1) } @@ -418,7 +426,7 @@ func (this *QMenu) Popup2(pos *QPoint, at *QAction) { } func (this *QMenu) Exec22(pos *QPoint, at *QAction) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenu_Exec22(this.h, pos.cPointer(), at.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_Exec22(this.h, pos.cPointer(), at.cPointer()))) } func QMenu_Exec3(actions []*QAction, pos *QPoint, at *QAction) *QAction { @@ -430,7 +438,7 @@ func QMenu_Exec3(actions []*QAction, pos *QPoint, at *QAction) *QAction { } actions_ma := &C.struct_miqt_array{len: C.size_t(len(actions)), data: unsafe.Pointer(actions_CArray)} defer runtime.KeepAlive(unsafe.Pointer(actions_ma)) - return newQAction_U(unsafe.Pointer(C.QMenu_Exec3(actions_ma, pos.cPointer(), at.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_Exec3(actions_ma, pos.cPointer(), at.cPointer()))) } func QMenu_Exec4(actions []*QAction, pos *QPoint, at *QAction, parent *QWidget) *QAction { @@ -442,7 +450,7 @@ func QMenu_Exec4(actions []*QAction, pos *QPoint, at *QAction, parent *QWidget) } actions_ma := &C.struct_miqt_array{len: C.size_t(len(actions)), data: unsafe.Pointer(actions_CArray)} defer runtime.KeepAlive(unsafe.Pointer(actions_ma)) - return newQAction_U(unsafe.Pointer(C.QMenu_Exec4(actions_ma, pos.cPointer(), at.cPointer(), parent.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenu_Exec4(actions_ma, pos.cPointer(), at.cPointer(), parent.cPointer()))) } // Delete this object from C++ memory. diff --git a/qt/gen_qmenu.h b/qt/gen_qmenu.h index 768c18bc..44e27939 100644 --- a/qt/gen_qmenu.h +++ b/qt/gen_qmenu.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmenubar.cpp b/qt/gen_qmenubar.cpp index 5c82220e..3f19a310 100644 --- a/qt/gen_qmenubar.cpp +++ b/qt/gen_qmenubar.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qmenubar.h" +#include #include "gen_qmenubar.h" #include "_cgo_export.h" diff --git a/qt/gen_qmenubar.go b/qt/gen_qmenubar.go index 7fc2f526..2abebcfe 100644 --- a/qt/gen_qmenubar.go +++ b/qt/gen_qmenubar.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QMenuBar) cPointer() *C.QMenuBar { return this.h } +func (this *QMenuBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMenuBar(h *C.QMenuBar) *QMenuBar { if h == nil { return nil } - return &QMenuBar{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QMenuBar{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQMenuBar_U(h unsafe.Pointer) *QMenuBar { +func UnsafeNewQMenuBar(h unsafe.Pointer) *QMenuBar { return newQMenuBar((*C.QMenuBar)(h)) } @@ -50,7 +58,7 @@ func NewQMenuBar2(parent *QWidget) *QMenuBar { } func (this *QMenuBar) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMenuBar_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMenuBar_MetaObject(this.h))) } func (this *QMenuBar) Metacast(param1 string) unsafe.Pointer { @@ -78,37 +86,37 @@ func QMenuBar_TrUtf8(s string) string { } func (this *QMenuBar) AddAction(text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QMenuBar_AddAction(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenuBar_AddAction(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QMenuBar) AddMenu(menu *QMenu) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenuBar_AddMenu(this.h, menu.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenuBar_AddMenu(this.h, menu.cPointer()))) } func (this *QMenuBar) AddMenuWithTitle(title string) *QMenu { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - return newQMenu_U(unsafe.Pointer(C.QMenuBar_AddMenuWithTitle(this.h, (*C.struct_miqt_string)(title_ms)))) + return UnsafeNewQMenu(unsafe.Pointer(C.QMenuBar_AddMenuWithTitle(this.h, (*C.struct_miqt_string)(title_ms)))) } func (this *QMenuBar) AddMenu2(icon *QIcon, title string) *QMenu { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - return newQMenu_U(unsafe.Pointer(C.QMenuBar_AddMenu2(this.h, icon.cPointer(), (*C.struct_miqt_string)(title_ms)))) + return UnsafeNewQMenu(unsafe.Pointer(C.QMenuBar_AddMenu2(this.h, icon.cPointer(), (*C.struct_miqt_string)(title_ms)))) } func (this *QMenuBar) AddSeparator() *QAction { - return newQAction_U(unsafe.Pointer(C.QMenuBar_AddSeparator(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenuBar_AddSeparator(this.h))) } func (this *QMenuBar) InsertSeparator(before *QAction) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenuBar_InsertSeparator(this.h, before.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenuBar_InsertSeparator(this.h, before.cPointer()))) } func (this *QMenuBar) InsertMenu(before *QAction, menu *QMenu) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenuBar_InsertMenu(this.h, before.cPointer(), menu.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenuBar_InsertMenu(this.h, before.cPointer(), menu.cPointer()))) } func (this *QMenuBar) Clear() { @@ -116,7 +124,7 @@ func (this *QMenuBar) Clear() { } func (this *QMenuBar) ActiveAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QMenuBar_ActiveAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenuBar_ActiveAction(this.h))) } func (this *QMenuBar) SetActiveAction(action *QAction) { @@ -157,7 +165,7 @@ func (this *QMenuBar) ActionGeometry(param1 *QAction) *QRect { } func (this *QMenuBar) ActionAt(param1 *QPoint) *QAction { - return newQAction_U(unsafe.Pointer(C.QMenuBar_ActionAt(this.h, param1.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QMenuBar_ActionAt(this.h, param1.cPointer()))) } func (this *QMenuBar) SetCornerWidget(w *QWidget) { @@ -165,7 +173,7 @@ func (this *QMenuBar) SetCornerWidget(w *QWidget) { } func (this *QMenuBar) CornerWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMenuBar_CornerWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMenuBar_CornerWidget(this.h))) } func (this *QMenuBar) IsNativeMenuBar() bool { @@ -195,7 +203,7 @@ func miqt_exec_callback_QMenuBar_Triggered(cb C.intptr_t, action *C.QAction) { } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(action)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(action)) gofunc(slotval1) } @@ -215,7 +223,7 @@ func miqt_exec_callback_QMenuBar_Hovered(cb C.intptr_t, action *C.QAction) { } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(action)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(action)) gofunc(slotval1) } @@ -269,7 +277,7 @@ func (this *QMenuBar) SetCornerWidget2(w *QWidget, corner Corner) { } func (this *QMenuBar) CornerWidget1(corner Corner) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QMenuBar_CornerWidget1(this.h, (C.int)(corner)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QMenuBar_CornerWidget1(this.h, (C.int)(corner)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qmenubar.h b/qt/gen_qmenubar.h index 2e551208..bb0b9081 100644 --- a/qt/gen_qmenubar.h +++ b/qt/gen_qmenubar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmessageauthenticationcode.cpp b/qt/gen_qmessageauthenticationcode.cpp index aa2f5db0..02969dc7 100644 --- a/qt/gen_qmessageauthenticationcode.cpp +++ b/qt/gen_qmessageauthenticationcode.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qmessageauthenticationcode.h" +#include #include "gen_qmessageauthenticationcode.h" #include "_cgo_export.h" diff --git a/qt/gen_qmessageauthenticationcode.go b/qt/gen_qmessageauthenticationcode.go index 2728241f..9a971972 100644 --- a/qt/gen_qmessageauthenticationcode.go +++ b/qt/gen_qmessageauthenticationcode.go @@ -24,6 +24,13 @@ func (this *QMessageAuthenticationCode) cPointer() *C.QMessageAuthenticationCode return this.h } +func (this *QMessageAuthenticationCode) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMessageAuthenticationCode(h *C.QMessageAuthenticationCode) *QMessageAuthenticationCode { if h == nil { return nil @@ -31,7 +38,7 @@ func newQMessageAuthenticationCode(h *C.QMessageAuthenticationCode) *QMessageAut return &QMessageAuthenticationCode{h: h} } -func newQMessageAuthenticationCode_U(h unsafe.Pointer) *QMessageAuthenticationCode { +func UnsafeNewQMessageAuthenticationCode(h unsafe.Pointer) *QMessageAuthenticationCode { return newQMessageAuthenticationCode((*C.QMessageAuthenticationCode)(h)) } diff --git a/qt/gen_qmessageauthenticationcode.h b/qt/gen_qmessageauthenticationcode.h index 66d83604..9c2a90e0 100644 --- a/qt/gen_qmessageauthenticationcode.h +++ b/qt/gen_qmessageauthenticationcode.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmessagebox.cpp b/qt/gen_qmessagebox.cpp index 23cd8781..8a9f980d 100644 --- a/qt/gen_qmessagebox.cpp +++ b/qt/gen_qmessagebox.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qmessagebox.h" +#include #include "gen_qmessagebox.h" #include "_cgo_export.h" diff --git a/qt/gen_qmessagebox.go b/qt/gen_qmessagebox.go index bba367b0..0a59853f 100644 --- a/qt/gen_qmessagebox.go +++ b/qt/gen_qmessagebox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -84,14 +85,21 @@ func (this *QMessageBox) cPointer() *C.QMessageBox { return this.h } +func (this *QMessageBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMessageBox(h *C.QMessageBox) *QMessageBox { if h == nil { return nil } - return &QMessageBox{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QMessageBox{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQMessageBox_U(h unsafe.Pointer) *QMessageBox { +func UnsafeNewQMessageBox(h unsafe.Pointer) *QMessageBox { return newQMessageBox((*C.QMessageBox)(h)) } @@ -103,9 +111,9 @@ func NewQMessageBox() *QMessageBox { // NewQMessageBox2 constructs a new QMessageBox object. func NewQMessageBox2(icon QMessageBox__Icon, title string, text string) *QMessageBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QMessageBox_new2((C.int)(icon), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms)) return newQMessageBox(ret) @@ -113,9 +121,9 @@ func NewQMessageBox2(icon QMessageBox__Icon, title string, text string) *QMessag // NewQMessageBox3 constructs a new QMessageBox object. func NewQMessageBox3(title string, text string, icon QMessageBox__Icon, button0 int, button1 int, button2 int) *QMessageBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QMessageBox_new3((*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(icon), (C.int)(button0), (C.int)(button1), (C.int)(button2)) return newQMessageBox(ret) @@ -129,9 +137,9 @@ func NewQMessageBox4(parent *QWidget) *QMessageBox { // NewQMessageBox5 constructs a new QMessageBox object. func NewQMessageBox5(icon QMessageBox__Icon, title string, text string, buttons QMessageBox__StandardButton) *QMessageBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QMessageBox_new5((C.int)(icon), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons)) return newQMessageBox(ret) @@ -139,9 +147,9 @@ func NewQMessageBox5(icon QMessageBox__Icon, title string, text string, buttons // NewQMessageBox6 constructs a new QMessageBox object. func NewQMessageBox6(icon QMessageBox__Icon, title string, text string, buttons QMessageBox__StandardButton, parent *QWidget) *QMessageBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QMessageBox_new6((C.int)(icon), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons), parent.cPointer()) return newQMessageBox(ret) @@ -149,9 +157,9 @@ func NewQMessageBox6(icon QMessageBox__Icon, title string, text string, buttons // NewQMessageBox7 constructs a new QMessageBox object. func NewQMessageBox7(icon QMessageBox__Icon, title string, text string, buttons QMessageBox__StandardButton, parent *QWidget, flags WindowType) *QMessageBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QMessageBox_new7((C.int)(icon), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons), parent.cPointer(), (C.int)(flags)) return newQMessageBox(ret) @@ -159,9 +167,9 @@ func NewQMessageBox7(icon QMessageBox__Icon, title string, text string, buttons // NewQMessageBox8 constructs a new QMessageBox object. func NewQMessageBox8(title string, text string, icon QMessageBox__Icon, button0 int, button1 int, button2 int, parent *QWidget) *QMessageBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QMessageBox_new8((*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(icon), (C.int)(button0), (C.int)(button1), (C.int)(button2), parent.cPointer()) return newQMessageBox(ret) @@ -169,16 +177,16 @@ func NewQMessageBox8(title string, text string, icon QMessageBox__Icon, button0 // NewQMessageBox9 constructs a new QMessageBox object. func NewQMessageBox9(title string, text string, icon QMessageBox__Icon, button0 int, button1 int, button2 int, parent *QWidget, f WindowType) *QMessageBox { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QMessageBox_new9((*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(icon), (C.int)(button0), (C.int)(button1), (C.int)(button2), parent.cPointer(), (C.int)(f)) return newQMessageBox(ret) } func (this *QMessageBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMessageBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMessageBox_MetaObject(this.h))) } func (this *QMessageBox) Metacast(param1 string) unsafe.Pointer { @@ -210,13 +218,13 @@ func (this *QMessageBox) AddButton(button *QAbstractButton, role QMessageBox__Bu } func (this *QMessageBox) AddButton2(text string, role QMessageBox__ButtonRole) *QPushButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQPushButton_U(unsafe.Pointer(C.QMessageBox_AddButton2(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(role)))) + return UnsafeNewQPushButton(unsafe.Pointer(C.QMessageBox_AddButton2(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(role)))) } func (this *QMessageBox) AddButtonWithButton(button QMessageBox__StandardButton) *QPushButton { - return newQPushButton_U(unsafe.Pointer(C.QMessageBox_AddButtonWithButton(this.h, (C.int)(button)))) + return UnsafeNewQPushButton(unsafe.Pointer(C.QMessageBox_AddButtonWithButton(this.h, (C.int)(button)))) } func (this *QMessageBox) RemoveButton(button *QAbstractButton) { @@ -228,7 +236,7 @@ func (this *QMessageBox) Buttons() []*QAbstractButton { _ret := make([]*QAbstractButton, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractButton)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractButton_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractButton(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -251,11 +259,11 @@ func (this *QMessageBox) StandardButton(button *QAbstractButton) QMessageBox__St } func (this *QMessageBox) Button(which QMessageBox__StandardButton) *QAbstractButton { - return newQAbstractButton_U(unsafe.Pointer(C.QMessageBox_Button(this.h, (C.int)(which)))) + return UnsafeNewQAbstractButton(unsafe.Pointer(C.QMessageBox_Button(this.h, (C.int)(which)))) } func (this *QMessageBox) DefaultButton() *QPushButton { - return newQPushButton_U(unsafe.Pointer(C.QMessageBox_DefaultButton(this.h))) + return UnsafeNewQPushButton(unsafe.Pointer(C.QMessageBox_DefaultButton(this.h))) } func (this *QMessageBox) SetDefaultButton(button *QPushButton) { @@ -267,7 +275,7 @@ func (this *QMessageBox) SetDefaultButtonWithButton(button QMessageBox__Standard } func (this *QMessageBox) EscapeButton() *QAbstractButton { - return newQAbstractButton_U(unsafe.Pointer(C.QMessageBox_EscapeButton(this.h))) + return UnsafeNewQAbstractButton(unsafe.Pointer(C.QMessageBox_EscapeButton(this.h))) } func (this *QMessageBox) SetEscapeButton(button *QAbstractButton) { @@ -279,7 +287,7 @@ func (this *QMessageBox) SetEscapeButtonWithButton(button QMessageBox__StandardB } func (this *QMessageBox) ClickedButton() *QAbstractButton { - return newQAbstractButton_U(unsafe.Pointer(C.QMessageBox_ClickedButton(this.h))) + return UnsafeNewQAbstractButton(unsafe.Pointer(C.QMessageBox_ClickedButton(this.h))) } func (this *QMessageBox) Text() string { @@ -290,7 +298,7 @@ func (this *QMessageBox) Text() string { } func (this *QMessageBox) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QMessageBox_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -335,45 +343,45 @@ func (this *QMessageBox) SetCheckBox(cb *QCheckBox) { } func (this *QMessageBox) CheckBox() *QCheckBox { - return newQCheckBox_U(unsafe.Pointer(C.QMessageBox_CheckBox(this.h))) + return UnsafeNewQCheckBox(unsafe.Pointer(C.QMessageBox_CheckBox(this.h))) } func QMessageBox_Information(parent *QWidget, title string, text string) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Information(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms))) } func QMessageBox_Question(parent *QWidget, title string, text string) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Question(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms))) } func QMessageBox_Warning(parent *QWidget, title string, text string) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Warning(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms))) } func QMessageBox_Critical(parent *QWidget, title string, text string) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Critical(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms))) } func QMessageBox_About(parent *QWidget, title string, text string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QMessageBox_About(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms)) } @@ -383,105 +391,105 @@ func QMessageBox_AboutQt(parent *QWidget) { } func QMessageBox_Information2(parent *QWidget, title string, text string, button0 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Information2(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0))) } func QMessageBox_Information3(parent *QWidget, title string, text string, button0Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) return (int)(C.QMessageBox_Information3(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms))) } func QMessageBox_Information4(parent *QWidget, title string, text string, button0 QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Information4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0))) } func QMessageBox_Question2(parent *QWidget, title string, text string, button0 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Question2(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0))) } func QMessageBox_Question3(parent *QWidget, title string, text string, button0Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) return (int)(C.QMessageBox_Question3(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms))) } func QMessageBox_Question4(parent *QWidget, title string, text string, button0 QMessageBox__StandardButton, button1 QMessageBox__StandardButton) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Question4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } func QMessageBox_Warning2(parent *QWidget, title string, text string, button0 int, button1 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Warning2(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } func QMessageBox_Warning3(parent *QWidget, title string, text string, button0Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) return (int)(C.QMessageBox_Warning3(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms))) } func QMessageBox_Warning4(parent *QWidget, title string, text string, button0 QMessageBox__StandardButton, button1 QMessageBox__StandardButton) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Warning4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } func QMessageBox_Critical2(parent *QWidget, title string, text string, button0 int, button1 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Critical2(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } func QMessageBox_Critical3(parent *QWidget, title string, text string, button0Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) return (int)(C.QMessageBox_Critical3(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms))) } func QMessageBox_Critical4(parent *QWidget, title string, text string, button0 QMessageBox__StandardButton, button1 QMessageBox__StandardButton) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Critical4(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } @@ -494,7 +502,7 @@ func (this *QMessageBox) ButtonText(button int) string { } func (this *QMessageBox) SetButtonText(button int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QMessageBox_SetButtonText(this.h, (C.int)(button), (*C.struct_miqt_string)(text_ms)) } @@ -507,7 +515,7 @@ func (this *QMessageBox) InformativeText() string { } func (this *QMessageBox) SetInformativeText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QMessageBox_SetInformativeText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -520,13 +528,13 @@ func (this *QMessageBox) DetailedText() string { } func (this *QMessageBox) SetDetailedText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QMessageBox_SetDetailedText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QMessageBox) SetWindowTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QMessageBox_SetWindowTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -557,7 +565,7 @@ func miqt_exec_callback_QMessageBox_ButtonClicked(cb C.intptr_t, button *C.QAbst } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractButton_U(unsafe.Pointer(button)) + slotval1 := UnsafeNewQAbstractButton(unsafe.Pointer(button)) gofunc(slotval1) } @@ -607,343 +615,343 @@ func QMessageBox_TrUtf83(s string, c string, n int) string { } func QMessageBox_Information42(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Information42(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons))) } func QMessageBox_Information5(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton, defaultButton QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Information5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons), (C.int)(defaultButton))) } func QMessageBox_Question42(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Question42(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons))) } func QMessageBox_Question5(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton, defaultButton QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Question5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons), (C.int)(defaultButton))) } func QMessageBox_Warning42(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Warning42(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons))) } func QMessageBox_Warning5(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton, defaultButton QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Warning5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons), (C.int)(defaultButton))) } func QMessageBox_Critical42(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Critical42(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons))) } func QMessageBox_Critical5(parent *QWidget, title string, text string, buttons QMessageBox__StandardButton, defaultButton QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Critical5(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(buttons), (C.int)(defaultButton))) } func QMessageBox_AboutQt2(parent *QWidget, title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QMessageBox_AboutQt2(parent.cPointer(), (*C.struct_miqt_string)(title_ms)) } func QMessageBox_Information52(parent *QWidget, title string, text string, button0 int, button1 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Information52(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } func QMessageBox_Information6(parent *QWidget, title string, text string, button0 int, button1 int, button2 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Information6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1), (C.int)(button2))) } func QMessageBox_Information53(parent *QWidget, title string, text string, button0Text string, button1Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) return (int)(C.QMessageBox_Information53(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms))) } func QMessageBox_Information62(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Information62(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms))) } func QMessageBox_Information7(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Information7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber))) } func QMessageBox_Information8(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int, escapeButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Information8(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber), (C.int)(escapeButtonNumber))) } func QMessageBox_Information54(parent *QWidget, title string, text string, button0 QMessageBox__StandardButton, button1 QMessageBox__StandardButton) QMessageBox__StandardButton { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (QMessageBox__StandardButton)(C.QMessageBox_Information54(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } func QMessageBox_Question52(parent *QWidget, title string, text string, button0 int, button1 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Question52(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1))) } func QMessageBox_Question6(parent *QWidget, title string, text string, button0 int, button1 int, button2 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Question6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1), (C.int)(button2))) } func QMessageBox_Question53(parent *QWidget, title string, text string, button0Text string, button1Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) return (int)(C.QMessageBox_Question53(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms))) } func QMessageBox_Question62(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Question62(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms))) } func QMessageBox_Question7(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Question7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber))) } func QMessageBox_Question8(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int, escapeButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Question8(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber), (C.int)(escapeButtonNumber))) } func QMessageBox_Warning6(parent *QWidget, title string, text string, button0 int, button1 int, button2 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Warning6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1), (C.int)(button2))) } func QMessageBox_Warning52(parent *QWidget, title string, text string, button0Text string, button1Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) return (int)(C.QMessageBox_Warning52(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms))) } func QMessageBox_Warning62(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Warning62(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms))) } func QMessageBox_Warning7(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Warning7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber))) } func QMessageBox_Warning8(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int, escapeButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Warning8(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber), (C.int)(escapeButtonNumber))) } func QMessageBox_Critical6(parent *QWidget, title string, text string, button0 int, button1 int, button2 int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QMessageBox_Critical6(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (C.int)(button0), (C.int)(button1), (C.int)(button2))) } func QMessageBox_Critical52(parent *QWidget, title string, text string, button0Text string, button1Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) return (int)(C.QMessageBox_Critical52(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms))) } func QMessageBox_Critical62(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Critical62(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms))) } func QMessageBox_Critical7(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Critical7(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber))) } func QMessageBox_Critical8(parent *QWidget, title string, text string, button0Text string, button1Text string, button2Text string, defaultButtonNumber int, escapeButtonNumber int) int { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - button0Text_ms := miqt_strdupg(button0Text) + button0Text_ms := libmiqt.Strdupg(button0Text) defer C.free(button0Text_ms) - button1Text_ms := miqt_strdupg(button1Text) + button1Text_ms := libmiqt.Strdupg(button1Text) defer C.free(button1Text_ms) - button2Text_ms := miqt_strdupg(button2Text) + button2Text_ms := libmiqt.Strdupg(button2Text) defer C.free(button2Text_ms) return (int)(C.QMessageBox_Critical8(parent.cPointer(), (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(text_ms), (*C.struct_miqt_string)(button0Text_ms), (*C.struct_miqt_string)(button1Text_ms), (*C.struct_miqt_string)(button2Text_ms), (C.int)(defaultButtonNumber), (C.int)(escapeButtonNumber))) } diff --git a/qt/gen_qmessagebox.h b/qt/gen_qmessagebox.h index 77621ce8..520893f8 100644 --- a/qt/gen_qmessagebox.h +++ b/qt/gen_qmessagebox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmetaobject.cpp b/qt/gen_qmetaobject.cpp index d20c82a7..40b58e0d 100644 --- a/qt/gen_qmetaobject.cpp +++ b/qt/gen_qmetaobject.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qmetaobject.h" +#include #include "gen_qmetaobject.h" #include "_cgo_export.h" diff --git a/qt/gen_qmetaobject.go b/qt/gen_qmetaobject.go index ba0d9fa9..bd4e2298 100644 --- a/qt/gen_qmetaobject.go +++ b/qt/gen_qmetaobject.go @@ -49,6 +49,13 @@ func (this *QMetaMethod) cPointer() *C.QMetaMethod { return this.h } +func (this *QMetaMethod) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaMethod(h *C.QMetaMethod) *QMetaMethod { if h == nil { return nil @@ -56,7 +63,7 @@ func newQMetaMethod(h *C.QMetaMethod) *QMetaMethod { return &QMetaMethod{h: h} } -func newQMetaMethod_U(h unsafe.Pointer) *QMetaMethod { +func UnsafeNewQMetaMethod(h unsafe.Pointer) *QMetaMethod { return newQMetaMethod((*C.QMetaMethod)(h)) } @@ -161,7 +168,7 @@ func (this *QMetaMethod) Revision() int { } func (this *QMetaMethod) EnclosingMetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaMethod_EnclosingMetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaMethod_EnclosingMetaObject(this.h))) } func (this *QMetaMethod) Invoke(object *QObject, connectionType ConnectionType, returnValue QGenericReturnArgument) bool { @@ -457,6 +464,13 @@ func (this *QMetaEnum) cPointer() *C.QMetaEnum { return this.h } +func (this *QMetaEnum) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaEnum(h *C.QMetaEnum) *QMetaEnum { if h == nil { return nil @@ -464,7 +478,7 @@ func newQMetaEnum(h *C.QMetaEnum) *QMetaEnum { return &QMetaEnum{h: h} } -func newQMetaEnum_U(h unsafe.Pointer) *QMetaEnum { +func UnsafeNewQMetaEnum(h unsafe.Pointer) *QMetaEnum { return newQMetaEnum((*C.QMetaEnum)(h)) } @@ -541,7 +555,7 @@ func (this *QMetaEnum) ValueToKeys(value int) *QByteArray { } func (this *QMetaEnum) EnclosingMetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaEnum_EnclosingMetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaEnum_EnclosingMetaObject(this.h))) } func (this *QMetaEnum) IsValid() bool { @@ -585,6 +599,13 @@ func (this *QMetaProperty) cPointer() *C.QMetaProperty { return this.h } +func (this *QMetaProperty) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaProperty(h *C.QMetaProperty) *QMetaProperty { if h == nil { return nil @@ -592,7 +613,7 @@ func newQMetaProperty(h *C.QMetaProperty) *QMetaProperty { return &QMetaProperty{h: h} } -func newQMetaProperty_U(h unsafe.Pointer) *QMetaProperty { +func UnsafeNewQMetaProperty(h unsafe.Pointer) *QMetaProperty { return newQMetaProperty((*C.QMetaProperty)(h)) } @@ -745,7 +766,7 @@ func (this *QMetaProperty) IsValid() bool { } func (this *QMetaProperty) EnclosingMetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaProperty_EnclosingMetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaProperty_EnclosingMetaObject(this.h))) } func (this *QMetaProperty) IsDesignable1(obj *QObject) bool { @@ -793,6 +814,13 @@ func (this *QMetaClassInfo) cPointer() *C.QMetaClassInfo { return this.h } +func (this *QMetaClassInfo) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaClassInfo(h *C.QMetaClassInfo) *QMetaClassInfo { if h == nil { return nil @@ -800,7 +828,7 @@ func newQMetaClassInfo(h *C.QMetaClassInfo) *QMetaClassInfo { return &QMetaClassInfo{h: h} } -func newQMetaClassInfo_U(h unsafe.Pointer) *QMetaClassInfo { +func UnsafeNewQMetaClassInfo(h unsafe.Pointer) *QMetaClassInfo { return newQMetaClassInfo((*C.QMetaClassInfo)(h)) } @@ -821,7 +849,7 @@ func (this *QMetaClassInfo) Value() unsafe.Pointer { } func (this *QMetaClassInfo) EnclosingMetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaClassInfo_EnclosingMetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaClassInfo_EnclosingMetaObject(this.h))) } // Delete this object from C++ memory. diff --git a/qt/gen_qmetaobject.h b/qt/gen_qmetaobject.h index 5570e4f8..4b8ac9bf 100644 --- a/qt/gen_qmetaobject.h +++ b/qt/gen_qmetaobject.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmetatype.cpp b/qt/gen_qmetatype.cpp index a7abab51..57106e45 100644 --- a/qt/gen_qmetatype.cpp +++ b/qt/gen_qmetatype.cpp @@ -11,7 +11,7 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__AbstractComparatorFunction #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__AbstractConverterFunction #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__AbstractDebugStreamFunction -#include "qmetatype.h" +#include #include "gen_qmetatype.h" #include "_cgo_export.h" diff --git a/qt/gen_qmetatype.go b/qt/gen_qmetatype.go index a883e31f..08e99651 100644 --- a/qt/gen_qmetatype.go +++ b/qt/gen_qmetatype.go @@ -156,6 +156,13 @@ func (this *QtPrivate__AbstractDebugStreamFunction) cPointer() *C.QtPrivate__Abs return this.h } +func (this *QtPrivate__AbstractDebugStreamFunction) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__AbstractDebugStreamFunction(h *C.QtPrivate__AbstractDebugStreamFunction) *QtPrivate__AbstractDebugStreamFunction { if h == nil { return nil @@ -163,7 +170,7 @@ func newQtPrivate__AbstractDebugStreamFunction(h *C.QtPrivate__AbstractDebugStre return &QtPrivate__AbstractDebugStreamFunction{h: h} } -func newQtPrivate__AbstractDebugStreamFunction_U(h unsafe.Pointer) *QtPrivate__AbstractDebugStreamFunction { +func UnsafeNewQtPrivate__AbstractDebugStreamFunction(h unsafe.Pointer) *QtPrivate__AbstractDebugStreamFunction { return newQtPrivate__AbstractDebugStreamFunction((*C.QtPrivate__AbstractDebugStreamFunction)(h)) } @@ -198,6 +205,13 @@ func (this *QtPrivate__AbstractComparatorFunction) cPointer() *C.QtPrivate__Abst return this.h } +func (this *QtPrivate__AbstractComparatorFunction) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__AbstractComparatorFunction(h *C.QtPrivate__AbstractComparatorFunction) *QtPrivate__AbstractComparatorFunction { if h == nil { return nil @@ -205,7 +219,7 @@ func newQtPrivate__AbstractComparatorFunction(h *C.QtPrivate__AbstractComparator return &QtPrivate__AbstractComparatorFunction{h: h} } -func newQtPrivate__AbstractComparatorFunction_U(h unsafe.Pointer) *QtPrivate__AbstractComparatorFunction { +func UnsafeNewQtPrivate__AbstractComparatorFunction(h unsafe.Pointer) *QtPrivate__AbstractComparatorFunction { return newQtPrivate__AbstractComparatorFunction((*C.QtPrivate__AbstractComparatorFunction)(h)) } @@ -240,6 +254,13 @@ func (this *QtPrivate__AbstractConverterFunction) cPointer() *C.QtPrivate__Abstr return this.h } +func (this *QtPrivate__AbstractConverterFunction) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__AbstractConverterFunction(h *C.QtPrivate__AbstractConverterFunction) *QtPrivate__AbstractConverterFunction { if h == nil { return nil @@ -247,7 +268,7 @@ func newQtPrivate__AbstractConverterFunction(h *C.QtPrivate__AbstractConverterFu return &QtPrivate__AbstractConverterFunction{h: h} } -func newQtPrivate__AbstractConverterFunction_U(h unsafe.Pointer) *QtPrivate__AbstractConverterFunction { +func UnsafeNewQtPrivate__AbstractConverterFunction(h unsafe.Pointer) *QtPrivate__AbstractConverterFunction { return newQtPrivate__AbstractConverterFunction((*C.QtPrivate__AbstractConverterFunction)(h)) } @@ -282,6 +303,13 @@ func (this *QMetaType) cPointer() *C.QMetaType { return this.h } +func (this *QMetaType) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaType(h *C.QMetaType) *QMetaType { if h == nil { return nil @@ -289,7 +317,7 @@ func newQMetaType(h *C.QMetaType) *QMetaType { return &QMetaType{h: h} } -func newQMetaType_U(h unsafe.Pointer) *QMetaType { +func UnsafeNewQMetaType(h unsafe.Pointer) *QMetaType { return newQMetaType((*C.QMetaType)(h)) } @@ -343,7 +371,7 @@ func QMetaType_TypeFlags(typeVal int) QMetaType__TypeFlag { } func QMetaType_MetaObjectForType(typeVal int) *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaType_MetaObjectForType((C.int)(typeVal)))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaType_MetaObjectForType((C.int)(typeVal)))) } func QMetaType_IsRegistered(typeVal int) bool { @@ -395,7 +423,7 @@ func (this *QMetaType) Flags() QMetaType__TypeFlag { } func (this *QMetaType) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaType_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaType_MetaObject(this.h))) } func (this *QMetaType) Name() *QByteArray { @@ -486,6 +514,13 @@ func (this *QtMetaTypePrivate__VariantData) cPointer() *C.QtMetaTypePrivate__Var return this.h } +func (this *QtMetaTypePrivate__VariantData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtMetaTypePrivate__VariantData(h *C.QtMetaTypePrivate__VariantData) *QtMetaTypePrivate__VariantData { if h == nil { return nil @@ -493,7 +528,7 @@ func newQtMetaTypePrivate__VariantData(h *C.QtMetaTypePrivate__VariantData) *QtM return &QtMetaTypePrivate__VariantData{h: h} } -func newQtMetaTypePrivate__VariantData_U(h unsafe.Pointer) *QtMetaTypePrivate__VariantData { +func UnsafeNewQtMetaTypePrivate__VariantData(h unsafe.Pointer) *QtMetaTypePrivate__VariantData { return newQtMetaTypePrivate__VariantData((*C.QtMetaTypePrivate__VariantData)(h)) } @@ -534,6 +569,13 @@ func (this *QtMetaTypePrivate__VectorBoolElements) cPointer() *C.QtMetaTypePriva return this.h } +func (this *QtMetaTypePrivate__VectorBoolElements) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtMetaTypePrivate__VectorBoolElements(h *C.QtMetaTypePrivate__VectorBoolElements) *QtMetaTypePrivate__VectorBoolElements { if h == nil { return nil @@ -541,7 +583,7 @@ func newQtMetaTypePrivate__VectorBoolElements(h *C.QtMetaTypePrivate__VectorBool return &QtMetaTypePrivate__VectorBoolElements{h: h} } -func newQtMetaTypePrivate__VectorBoolElements_U(h unsafe.Pointer) *QtMetaTypePrivate__VectorBoolElements { +func UnsafeNewQtMetaTypePrivate__VectorBoolElements(h unsafe.Pointer) *QtMetaTypePrivate__VectorBoolElements { return newQtMetaTypePrivate__VectorBoolElements((*C.QtMetaTypePrivate__VectorBoolElements)(h)) } @@ -570,6 +612,13 @@ func (this *QtMetaTypePrivate__QSequentialIterableImpl) cPointer() *C.QtMetaType return this.h } +func (this *QtMetaTypePrivate__QSequentialIterableImpl) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtMetaTypePrivate__QSequentialIterableImpl(h *C.QtMetaTypePrivate__QSequentialIterableImpl) *QtMetaTypePrivate__QSequentialIterableImpl { if h == nil { return nil @@ -577,7 +626,7 @@ func newQtMetaTypePrivate__QSequentialIterableImpl(h *C.QtMetaTypePrivate__QSequ return &QtMetaTypePrivate__QSequentialIterableImpl{h: h} } -func newQtMetaTypePrivate__QSequentialIterableImpl_U(h unsafe.Pointer) *QtMetaTypePrivate__QSequentialIterableImpl { +func UnsafeNewQtMetaTypePrivate__QSequentialIterableImpl(h unsafe.Pointer) *QtMetaTypePrivate__QSequentialIterableImpl { return newQtMetaTypePrivate__QSequentialIterableImpl((*C.QtMetaTypePrivate__QSequentialIterableImpl)(h)) } @@ -618,7 +667,7 @@ func (this *QtMetaTypePrivate__QSequentialIterableImpl) Equal(other *QtMetaTypeP } func (this *QtMetaTypePrivate__QSequentialIterableImpl) Advance(i int) *QtMetaTypePrivate__QSequentialIterableImpl { - return newQtMetaTypePrivate__QSequentialIterableImpl_U(unsafe.Pointer(C.QtMetaTypePrivate__QSequentialIterableImpl_Advance(this.h, (C.int)(i)))) + return UnsafeNewQtMetaTypePrivate__QSequentialIterableImpl(unsafe.Pointer(C.QtMetaTypePrivate__QSequentialIterableImpl_Advance(this.h, (C.int)(i)))) } func (this *QtMetaTypePrivate__QSequentialIterableImpl) Append(newElement unsafe.Pointer) { @@ -680,6 +729,13 @@ func (this *QtMetaTypePrivate__QAssociativeIterableImpl) cPointer() *C.QtMetaTyp return this.h } +func (this *QtMetaTypePrivate__QAssociativeIterableImpl) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtMetaTypePrivate__QAssociativeIterableImpl(h *C.QtMetaTypePrivate__QAssociativeIterableImpl) *QtMetaTypePrivate__QAssociativeIterableImpl { if h == nil { return nil @@ -687,7 +743,7 @@ func newQtMetaTypePrivate__QAssociativeIterableImpl(h *C.QtMetaTypePrivate__QAss return &QtMetaTypePrivate__QAssociativeIterableImpl{h: h} } -func newQtMetaTypePrivate__QAssociativeIterableImpl_U(h unsafe.Pointer) *QtMetaTypePrivate__QAssociativeIterableImpl { +func UnsafeNewQtMetaTypePrivate__QAssociativeIterableImpl(h unsafe.Pointer) *QtMetaTypePrivate__QAssociativeIterableImpl { return newQtMetaTypePrivate__QAssociativeIterableImpl((*C.QtMetaTypePrivate__QAssociativeIterableImpl)(h)) } @@ -716,7 +772,7 @@ func (this *QtMetaTypePrivate__QAssociativeIterableImpl) Equal(other *QtMetaType } func (this *QtMetaTypePrivate__QAssociativeIterableImpl) Advance(i int) *QtMetaTypePrivate__QAssociativeIterableImpl { - return newQtMetaTypePrivate__QAssociativeIterableImpl_U(unsafe.Pointer(C.QtMetaTypePrivate__QAssociativeIterableImpl_Advance(this.h, (C.int)(i)))) + return UnsafeNewQtMetaTypePrivate__QAssociativeIterableImpl(unsafe.Pointer(C.QtMetaTypePrivate__QAssociativeIterableImpl_Advance(this.h, (C.int)(i)))) } func (this *QtMetaTypePrivate__QAssociativeIterableImpl) DestroyIter() { @@ -778,6 +834,13 @@ func (this *QtMetaTypePrivate__QPairVariantInterfaceImpl) cPointer() *C.QtMetaTy return this.h } +func (this *QtMetaTypePrivate__QPairVariantInterfaceImpl) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtMetaTypePrivate__QPairVariantInterfaceImpl(h *C.QtMetaTypePrivate__QPairVariantInterfaceImpl) *QtMetaTypePrivate__QPairVariantInterfaceImpl { if h == nil { return nil @@ -785,7 +848,7 @@ func newQtMetaTypePrivate__QPairVariantInterfaceImpl(h *C.QtMetaTypePrivate__QPa return &QtMetaTypePrivate__QPairVariantInterfaceImpl{h: h} } -func newQtMetaTypePrivate__QPairVariantInterfaceImpl_U(h unsafe.Pointer) *QtMetaTypePrivate__QPairVariantInterfaceImpl { +func UnsafeNewQtMetaTypePrivate__QPairVariantInterfaceImpl(h unsafe.Pointer) *QtMetaTypePrivate__QPairVariantInterfaceImpl { return newQtMetaTypePrivate__QPairVariantInterfaceImpl((*C.QtMetaTypePrivate__QPairVariantInterfaceImpl)(h)) } diff --git a/qt/gen_qmetatype.h b/qt/gen_qmetatype.h index 9fd172cf..6b3acc75 100644 --- a/qt/gen_qmetatype.h +++ b/qt/gen_qmetatype.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmimedata.cpp b/qt/gen_qmimedata.cpp index 6ed96674..4f14646d 100644 --- a/qt/gen_qmimedata.cpp +++ b/qt/gen_qmimedata.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qmimedata.h" +#include #include "gen_qmimedata.h" #include "_cgo_export.h" diff --git a/qt/gen_qmimedata.go b/qt/gen_qmimedata.go index a61c22cb..0ca29340 100644 --- a/qt/gen_qmimedata.go +++ b/qt/gen_qmimedata.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QMimeData) cPointer() *C.QMimeData { return this.h } +func (this *QMimeData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMimeData(h *C.QMimeData) *QMimeData { if h == nil { return nil } - return &QMimeData{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QMimeData{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQMimeData_U(h unsafe.Pointer) *QMimeData { +func UnsafeNewQMimeData(h unsafe.Pointer) *QMimeData { return newQMimeData((*C.QMimeData)(h)) } @@ -43,7 +51,7 @@ func NewQMimeData() *QMimeData { } func (this *QMimeData) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMimeData_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMimeData_MetaObject(this.h))) } func (this *QMimeData) Metacast(param1 string) unsafe.Pointer { @@ -108,7 +116,7 @@ func (this *QMimeData) Text() string { } func (this *QMimeData) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QMimeData_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -125,7 +133,7 @@ func (this *QMimeData) Html() string { } func (this *QMimeData) SetHtml(html string) { - html_ms := miqt_strdupg(html) + html_ms := libmiqt.Strdupg(html) defer C.free(html_ms) C.QMimeData_SetHtml(this.h, (*C.struct_miqt_string)(html_ms)) } @@ -165,7 +173,7 @@ func (this *QMimeData) HasColor() bool { } func (this *QMimeData) Data(mimetype string) *QByteArray { - mimetype_ms := miqt_strdupg(mimetype) + mimetype_ms := libmiqt.Strdupg(mimetype) defer C.free(mimetype_ms) _ret := C.QMimeData_Data(this.h, (*C.struct_miqt_string)(mimetype_ms)) _goptr := newQByteArray(_ret) @@ -174,19 +182,19 @@ func (this *QMimeData) Data(mimetype string) *QByteArray { } func (this *QMimeData) SetData(mimetype string, data *QByteArray) { - mimetype_ms := miqt_strdupg(mimetype) + mimetype_ms := libmiqt.Strdupg(mimetype) defer C.free(mimetype_ms) C.QMimeData_SetData(this.h, (*C.struct_miqt_string)(mimetype_ms), data.cPointer()) } func (this *QMimeData) RemoveFormat(mimetype string) { - mimetype_ms := miqt_strdupg(mimetype) + mimetype_ms := libmiqt.Strdupg(mimetype) defer C.free(mimetype_ms) C.QMimeData_RemoveFormat(this.h, (*C.struct_miqt_string)(mimetype_ms)) } func (this *QMimeData) HasFormat(mimetype string) bool { - mimetype_ms := miqt_strdupg(mimetype) + mimetype_ms := libmiqt.Strdupg(mimetype) defer C.free(mimetype_ms) return (bool)(C.QMimeData_HasFormat(this.h, (*C.struct_miqt_string)(mimetype_ms))) } diff --git a/qt/gen_qmimedata.h b/qt/gen_qmimedata.h index 4e79f098..66e4c3c9 100644 --- a/qt/gen_qmimedata.h +++ b/qt/gen_qmimedata.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmimedatabase.cpp b/qt/gen_qmimedatabase.cpp index 8ba5b461..611d2e80 100644 --- a/qt/gen_qmimedatabase.cpp +++ b/qt/gen_qmimedatabase.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qmimedatabase.h" +#include #include "gen_qmimedatabase.h" #include "_cgo_export.h" diff --git a/qt/gen_qmimedatabase.go b/qt/gen_qmimedatabase.go index 8b6edaf4..7fe751a4 100644 --- a/qt/gen_qmimedatabase.go +++ b/qt/gen_qmimedatabase.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -32,6 +33,13 @@ func (this *QMimeDatabase) cPointer() *C.QMimeDatabase { return this.h } +func (this *QMimeDatabase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMimeDatabase(h *C.QMimeDatabase) *QMimeDatabase { if h == nil { return nil @@ -39,7 +47,7 @@ func newQMimeDatabase(h *C.QMimeDatabase) *QMimeDatabase { return &QMimeDatabase{h: h} } -func newQMimeDatabase_U(h unsafe.Pointer) *QMimeDatabase { +func UnsafeNewQMimeDatabase(h unsafe.Pointer) *QMimeDatabase { return newQMimeDatabase((*C.QMimeDatabase)(h)) } @@ -50,7 +58,7 @@ func NewQMimeDatabase() *QMimeDatabase { } func (this *QMimeDatabase) MimeTypeForName(nameOrAlias string) *QMimeType { - nameOrAlias_ms := miqt_strdupg(nameOrAlias) + nameOrAlias_ms := libmiqt.Strdupg(nameOrAlias) defer C.free(nameOrAlias_ms) _ret := C.QMimeDatabase_MimeTypeForName(this.h, (*C.struct_miqt_string)(nameOrAlias_ms)) _goptr := newQMimeType(_ret) @@ -59,7 +67,7 @@ func (this *QMimeDatabase) MimeTypeForName(nameOrAlias string) *QMimeType { } func (this *QMimeDatabase) MimeTypeForFile(fileName string) *QMimeType { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QMimeDatabase_MimeTypeForFile(this.h, (*C.struct_miqt_string)(fileName_ms)) _goptr := newQMimeType(_ret) @@ -75,7 +83,7 @@ func (this *QMimeDatabase) MimeTypeForFileWithFileInfo(fileInfo *QFileInfo) *QMi } func (this *QMimeDatabase) MimeTypesForFileName(fileName string) []QMimeType { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ma *C.struct_miqt_array = C.QMimeDatabase_MimeTypesForFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) _ret := make([]QMimeType, int(_ma.len)) @@ -112,7 +120,7 @@ func (this *QMimeDatabase) MimeTypeForUrl(url *QUrl) *QMimeType { } func (this *QMimeDatabase) MimeTypeForFileNameAndData(fileName string, device *QIODevice) *QMimeType { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QMimeDatabase_MimeTypeForFileNameAndData(this.h, (*C.struct_miqt_string)(fileName_ms), device.cPointer()) _goptr := newQMimeType(_ret) @@ -121,7 +129,7 @@ func (this *QMimeDatabase) MimeTypeForFileNameAndData(fileName string, device *Q } func (this *QMimeDatabase) MimeTypeForFileNameAndData2(fileName string, data *QByteArray) *QMimeType { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QMimeDatabase_MimeTypeForFileNameAndData2(this.h, (*C.struct_miqt_string)(fileName_ms), data.cPointer()) _goptr := newQMimeType(_ret) @@ -130,7 +138,7 @@ func (this *QMimeDatabase) MimeTypeForFileNameAndData2(fileName string, data *QB } func (this *QMimeDatabase) SuffixForFileName(fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QMimeDatabase_SuffixForFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -153,7 +161,7 @@ func (this *QMimeDatabase) AllMimeTypes() []QMimeType { } func (this *QMimeDatabase) MimeTypeForFile2(fileName string, mode QMimeDatabase__MatchMode) *QMimeType { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QMimeDatabase_MimeTypeForFile2(this.h, (*C.struct_miqt_string)(fileName_ms), (C.int)(mode)) _goptr := newQMimeType(_ret) diff --git a/qt/gen_qmimedatabase.h b/qt/gen_qmimedatabase.h index b3a4e574..97c85503 100644 --- a/qt/gen_qmimedatabase.h +++ b/qt/gen_qmimedatabase.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmimetype.cpp b/qt/gen_qmimetype.cpp index 6883be40..343848ce 100644 --- a/qt/gen_qmimetype.cpp +++ b/qt/gen_qmimetype.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qmimetype.h" +#include #include "gen_qmimetype.h" #include "_cgo_export.h" diff --git a/qt/gen_qmimetype.go b/qt/gen_qmimetype.go index 24b9292d..178d0085 100644 --- a/qt/gen_qmimetype.go +++ b/qt/gen_qmimetype.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QMimeType) cPointer() *C.QMimeType { return this.h } +func (this *QMimeType) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMimeType(h *C.QMimeType) *QMimeType { if h == nil { return nil @@ -31,7 +39,7 @@ func newQMimeType(h *C.QMimeType) *QMimeType { return &QMimeType{h: h} } -func newQMimeType_U(h unsafe.Pointer) *QMimeType { +func UnsafeNewQMimeType(h unsafe.Pointer) *QMimeType { return newQMimeType((*C.QMimeType)(h)) } @@ -177,7 +185,7 @@ func (this *QMimeType) PreferredSuffix() string { } func (this *QMimeType) Inherits(mimeTypeName string) bool { - mimeTypeName_ms := miqt_strdupg(mimeTypeName) + mimeTypeName_ms := libmiqt.Strdupg(mimeTypeName) defer C.free(mimeTypeName_ms) return (bool)(C.QMimeType_Inherits(this.h, (*C.struct_miqt_string)(mimeTypeName_ms))) } diff --git a/qt/gen_qmimetype.h b/qt/gen_qmimetype.h index 7100d33e..5b4c7d9f 100644 --- a/qt/gen_qmimetype.h +++ b/qt/gen_qmimetype.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmouseeventtransition.cpp b/qt/gen_qmouseeventtransition.cpp index 3e0d9e7c..5500f9e8 100644 --- a/qt/gen_qmouseeventtransition.cpp +++ b/qt/gen_qmouseeventtransition.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qmouseeventtransition.h" +#include #include "gen_qmouseeventtransition.h" #include "_cgo_export.h" diff --git a/qt/gen_qmouseeventtransition.go b/qt/gen_qmouseeventtransition.go index b5a518cb..1e524bef 100644 --- a/qt/gen_qmouseeventtransition.go +++ b/qt/gen_qmouseeventtransition.go @@ -25,14 +25,21 @@ func (this *QMouseEventTransition) cPointer() *C.QMouseEventTransition { return this.h } +func (this *QMouseEventTransition) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMouseEventTransition(h *C.QMouseEventTransition) *QMouseEventTransition { if h == nil { return nil } - return &QMouseEventTransition{h: h, QEventTransition: newQEventTransition_U(unsafe.Pointer(h))} + return &QMouseEventTransition{h: h, QEventTransition: UnsafeNewQEventTransition(unsafe.Pointer(h))} } -func newQMouseEventTransition_U(h unsafe.Pointer) *QMouseEventTransition { +func UnsafeNewQMouseEventTransition(h unsafe.Pointer) *QMouseEventTransition { return newQMouseEventTransition((*C.QMouseEventTransition)(h)) } @@ -61,7 +68,7 @@ func NewQMouseEventTransition4(object *QObject, typeVal QEvent__Type, button Mou } func (this *QMouseEventTransition) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMouseEventTransition_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMouseEventTransition_MetaObject(this.h))) } func (this *QMouseEventTransition) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qmouseeventtransition.h b/qt/gen_qmouseeventtransition.h index 4aab0fad..ec2927dc 100644 --- a/qt/gen_qmouseeventtransition.h +++ b/qt/gen_qmouseeventtransition.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmovie.cpp b/qt/gen_qmovie.cpp index a2cde5e9..dd338d45 100644 --- a/qt/gen_qmovie.cpp +++ b/qt/gen_qmovie.cpp @@ -12,7 +12,7 @@ #include #include #include -#include "qmovie.h" +#include #include "gen_qmovie.h" #include "_cgo_export.h" diff --git a/qt/gen_qmovie.go b/qt/gen_qmovie.go index 6e770092..ae8fdfb1 100644 --- a/qt/gen_qmovie.go +++ b/qt/gen_qmovie.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -41,14 +42,21 @@ func (this *QMovie) cPointer() *C.QMovie { return this.h } +func (this *QMovie) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMovie(h *C.QMovie) *QMovie { if h == nil { return nil } - return &QMovie{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QMovie{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQMovie_U(h unsafe.Pointer) *QMovie { +func UnsafeNewQMovie(h unsafe.Pointer) *QMovie { return newQMovie((*C.QMovie)(h)) } @@ -66,7 +74,7 @@ func NewQMovie2(device *QIODevice) *QMovie { // NewQMovie3 constructs a new QMovie object. func NewQMovie3(fileName string) *QMovie { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QMovie_new3((*C.struct_miqt_string)(fileName_ms)) return newQMovie(ret) @@ -92,7 +100,7 @@ func NewQMovie6(device *QIODevice, format *QByteArray, parent *QObject) *QMovie // NewQMovie7 constructs a new QMovie object. func NewQMovie7(fileName string, format *QByteArray) *QMovie { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QMovie_new7((*C.struct_miqt_string)(fileName_ms), format.cPointer()) return newQMovie(ret) @@ -100,14 +108,14 @@ func NewQMovie7(fileName string, format *QByteArray) *QMovie { // NewQMovie8 constructs a new QMovie object. func NewQMovie8(fileName string, format *QByteArray, parent *QObject) *QMovie { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QMovie_new8((*C.struct_miqt_string)(fileName_ms), format.cPointer(), parent.cPointer()) return newQMovie(ret) } func (this *QMovie) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMovie_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMovie_MetaObject(this.h))) } func (this *QMovie) Metacast(param1 string) unsafe.Pointer { @@ -153,11 +161,11 @@ func (this *QMovie) SetDevice(device *QIODevice) { } func (this *QMovie) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QMovie_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QMovie_Device(this.h))) } func (this *QMovie) SetFileName(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QMovie_SetFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -306,7 +314,7 @@ func miqt_exec_callback_QMovie_Resized(cb C.intptr_t, size *C.QSize) { } // Convert all CABI parameters to Go parameters - slotval1 := newQSize_U(unsafe.Pointer(size)) + slotval1 := UnsafeNewQSize(unsafe.Pointer(size)) gofunc(slotval1) } @@ -326,7 +334,7 @@ func miqt_exec_callback_QMovie_Updated(cb C.intptr_t, rect *C.QRect) { } // Convert all CABI parameters to Go parameters - slotval1 := newQRect_U(unsafe.Pointer(rect)) + slotval1 := UnsafeNewQRect(unsafe.Pointer(rect)) gofunc(slotval1) } diff --git a/qt/gen_qmovie.h b/qt/gen_qmovie.h index afe58436..87121879 100644 --- a/qt/gen_qmovie.h +++ b/qt/gen_qmovie.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qmutex.cpp b/qt/gen_qmutex.cpp index 3941dc3a..0bead860 100644 --- a/qt/gen_qmutex.cpp +++ b/qt/gen_qmutex.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qmutex.h" +#include #include "gen_qmutex.h" #include "_cgo_export.h" diff --git a/qt/gen_qmutex.go b/qt/gen_qmutex.go index 3da00608..a0037032 100644 --- a/qt/gen_qmutex.go +++ b/qt/gen_qmutex.go @@ -31,6 +31,13 @@ func (this *QBasicMutex) cPointer() *C.QBasicMutex { return this.h } +func (this *QBasicMutex) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQBasicMutex(h *C.QBasicMutex) *QBasicMutex { if h == nil { return nil @@ -38,7 +45,7 @@ func newQBasicMutex(h *C.QBasicMutex) *QBasicMutex { return &QBasicMutex{h: h} } -func newQBasicMutex_U(h unsafe.Pointer) *QBasicMutex { +func UnsafeNewQBasicMutex(h unsafe.Pointer) *QBasicMutex { return newQBasicMutex((*C.QBasicMutex)(h)) } @@ -98,14 +105,21 @@ func (this *QMutex) cPointer() *C.QMutex { return this.h } +func (this *QMutex) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMutex(h *C.QMutex) *QMutex { if h == nil { return nil } - return &QMutex{h: h, QBasicMutex: newQBasicMutex_U(unsafe.Pointer(h))} + return &QMutex{h: h, QBasicMutex: UnsafeNewQBasicMutex(unsafe.Pointer(h))} } -func newQMutex_U(h unsafe.Pointer) *QMutex { +func UnsafeNewQMutex(h unsafe.Pointer) *QMutex { return newQMutex((*C.QMutex)(h)) } @@ -170,6 +184,13 @@ func (this *QRecursiveMutex) cPointer() *C.QRecursiveMutex { return this.h } +func (this *QRecursiveMutex) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRecursiveMutex(h *C.QRecursiveMutex) *QRecursiveMutex { if h == nil { return nil @@ -177,7 +198,7 @@ func newQRecursiveMutex(h *C.QRecursiveMutex) *QRecursiveMutex { return &QRecursiveMutex{h: h} } -func newQRecursiveMutex_U(h unsafe.Pointer) *QRecursiveMutex { +func UnsafeNewQRecursiveMutex(h unsafe.Pointer) *QRecursiveMutex { return newQRecursiveMutex((*C.QRecursiveMutex)(h)) } @@ -212,6 +233,13 @@ func (this *QMutexLocker) cPointer() *C.QMutexLocker { return this.h } +func (this *QMutexLocker) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMutexLocker(h *C.QMutexLocker) *QMutexLocker { if h == nil { return nil @@ -219,7 +247,7 @@ func newQMutexLocker(h *C.QMutexLocker) *QMutexLocker { return &QMutexLocker{h: h} } -func newQMutexLocker_U(h unsafe.Pointer) *QMutexLocker { +func UnsafeNewQMutexLocker(h unsafe.Pointer) *QMutexLocker { return newQMutexLocker((*C.QMutexLocker)(h)) } @@ -244,7 +272,7 @@ func (this *QMutexLocker) Relock() { } func (this *QMutexLocker) Mutex() *QMutex { - return newQMutex_U(unsafe.Pointer(C.QMutexLocker_Mutex(this.h))) + return UnsafeNewQMutex(unsafe.Pointer(C.QMutexLocker_Mutex(this.h))) } // Delete this object from C++ memory. diff --git a/qt/gen_qmutex.h b/qt/gen_qmutex.h index 8990dc17..8b306d99 100644 --- a/qt/gen_qmutex.h +++ b/qt/gen_qmutex.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qnamespace.cpp b/qt/gen_qnamespace.cpp index 5a491cf6..c972e15c 100644 --- a/qt/gen_qnamespace.cpp +++ b/qt/gen_qnamespace.cpp @@ -1,5 +1,5 @@ #include -#include "qnamespace.h" +#include #include "gen_qnamespace.h" #include "_cgo_export.h" diff --git a/qt/gen_qnamespace.go b/qt/gen_qnamespace.go index 181a5fb9..f839b64c 100644 --- a/qt/gen_qnamespace.go +++ b/qt/gen_qnamespace.go @@ -1712,6 +1712,13 @@ func (this *QInternal) cPointer() *C.QInternal { return this.h } +func (this *QInternal) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQInternal(h *C.QInternal) *QInternal { if h == nil { return nil @@ -1719,7 +1726,7 @@ func newQInternal(h *C.QInternal) *QInternal { return &QInternal{h: h} } -func newQInternal_U(h unsafe.Pointer) *QInternal { +func UnsafeNewQInternal(h unsafe.Pointer) *QInternal { return newQInternal((*C.QInternal)(h)) } diff --git a/qt/gen_qnamespace.h b/qt/gen_qnamespace.h index acebe7ff..d5d277b6 100644 --- a/qt/gen_qnamespace.h +++ b/qt/gen_qnamespace.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qobject.cpp b/qt/gen_qobject.cpp index 8b745d6f..55654075 100644 --- a/qt/gen_qobject.cpp +++ b/qt/gen_qobject.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qobject.h" +#include #include "gen_qobject.h" #include "_cgo_export.h" diff --git a/qt/gen_qobject.go b/qt/gen_qobject.go index b1377666..4e9d9b1a 100644 --- a/qt/gen_qobject.go +++ b/qt/gen_qobject.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -31,6 +32,13 @@ func (this *QObjectData) cPointer() *C.QObjectData { return this.h } +func (this *QObjectData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQObjectData(h *C.QObjectData) *QObjectData { if h == nil { return nil @@ -38,12 +46,12 @@ func newQObjectData(h *C.QObjectData) *QObjectData { return &QObjectData{h: h} } -func newQObjectData_U(h unsafe.Pointer) *QObjectData { +func UnsafeNewQObjectData(h unsafe.Pointer) *QObjectData { return newQObjectData((*C.QObjectData)(h)) } func (this *QObjectData) DynamicMetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QObjectData_DynamicMetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QObjectData_DynamicMetaObject(this.h))) } // Delete this object from C++ memory. @@ -71,6 +79,13 @@ func (this *QObject) cPointer() *C.QObject { return this.h } +func (this *QObject) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQObject(h *C.QObject) *QObject { if h == nil { return nil @@ -78,7 +93,7 @@ func newQObject(h *C.QObject) *QObject { return &QObject{h: h} } -func newQObject_U(h unsafe.Pointer) *QObject { +func UnsafeNewQObject(h unsafe.Pointer) *QObject { return newQObject((*C.QObject)(h)) } @@ -95,7 +110,7 @@ func NewQObject2(parent *QObject) *QObject { } func (this *QObject) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QObject_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QObject_MetaObject(this.h))) } func (this *QObject) Metacast(param1 string) unsafe.Pointer { @@ -138,7 +153,7 @@ func (this *QObject) ObjectName() string { } func (this *QObject) SetObjectName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QObject_SetObjectName(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -160,7 +175,7 @@ func (this *QObject) BlockSignals(b bool) bool { } func (this *QObject) Thread() *QThread { - return newQThread_U(unsafe.Pointer(C.QObject_Thread(this.h))) + return UnsafeNewQThread(unsafe.Pointer(C.QObject_Thread(this.h))) } func (this *QObject) MoveToThread(thread *QThread) { @@ -180,7 +195,7 @@ func (this *QObject) Children() []*QObject { _ret := make([]*QObject, int(_ma.len)) _outCast := (*[0xffff]*C.QObject)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQObject_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQObject(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -278,7 +293,7 @@ func (this *QObject) SetUserData(id uint, data *QObjectUserData) { } func (this *QObject) UserData(id uint) *QObjectUserData { - return newQObjectUserData_U(unsafe.Pointer(C.QObject_UserData(this.h, (C.uint)(id)))) + return UnsafeNewQObjectUserData(unsafe.Pointer(C.QObject_UserData(this.h, (C.uint)(id)))) } func (this *QObject) Destroyed() { @@ -299,7 +314,7 @@ func miqt_exec_callback_QObject_Destroyed(cb C.intptr_t) { } func (this *QObject) Parent() *QObject { - return newQObject_U(unsafe.Pointer(C.QObject_Parent(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QObject_Parent(this.h))) } func (this *QObject) Inherits(classname string) bool { @@ -393,7 +408,7 @@ func miqt_exec_callback_QObject_Destroyed1(cb C.intptr_t, param1 *C.QObject) { } // Convert all CABI parameters to Go parameters - slotval1 := newQObject_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQObject(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -423,6 +438,13 @@ func (this *QObjectUserData) cPointer() *C.QObjectUserData { return this.h } +func (this *QObjectUserData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQObjectUserData(h *C.QObjectUserData) *QObjectUserData { if h == nil { return nil @@ -430,7 +452,7 @@ func newQObjectUserData(h *C.QObjectUserData) *QObjectUserData { return &QObjectUserData{h: h} } -func newQObjectUserData_U(h unsafe.Pointer) *QObjectUserData { +func UnsafeNewQObjectUserData(h unsafe.Pointer) *QObjectUserData { return newQObjectUserData((*C.QObjectUserData)(h)) } @@ -465,6 +487,13 @@ func (this *QSignalBlocker) cPointer() *C.QSignalBlocker { return this.h } +func (this *QSignalBlocker) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSignalBlocker(h *C.QSignalBlocker) *QSignalBlocker { if h == nil { return nil @@ -472,7 +501,7 @@ func newQSignalBlocker(h *C.QSignalBlocker) *QSignalBlocker { return &QSignalBlocker{h: h} } -func newQSignalBlocker_U(h unsafe.Pointer) *QSignalBlocker { +func UnsafeNewQSignalBlocker(h unsafe.Pointer) *QSignalBlocker { return newQSignalBlocker((*C.QSignalBlocker)(h)) } diff --git a/qt/gen_qobject.h b/qt/gen_qobject.h index 73cda44d..31b1fdec 100644 --- a/qt/gen_qobject.h +++ b/qt/gen_qobject.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qobjectcleanuphandler.cpp b/qt/gen_qobjectcleanuphandler.cpp index 5d9280e4..f557f08c 100644 --- a/qt/gen_qobjectcleanuphandler.cpp +++ b/qt/gen_qobjectcleanuphandler.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qobjectcleanuphandler.h" +#include #include "gen_qobjectcleanuphandler.h" #include "_cgo_export.h" diff --git a/qt/gen_qobjectcleanuphandler.go b/qt/gen_qobjectcleanuphandler.go index 82a4483d..9a78ea99 100644 --- a/qt/gen_qobjectcleanuphandler.go +++ b/qt/gen_qobjectcleanuphandler.go @@ -25,14 +25,21 @@ func (this *QObjectCleanupHandler) cPointer() *C.QObjectCleanupHandler { return this.h } +func (this *QObjectCleanupHandler) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQObjectCleanupHandler(h *C.QObjectCleanupHandler) *QObjectCleanupHandler { if h == nil { return nil } - return &QObjectCleanupHandler{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QObjectCleanupHandler{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQObjectCleanupHandler_U(h unsafe.Pointer) *QObjectCleanupHandler { +func UnsafeNewQObjectCleanupHandler(h unsafe.Pointer) *QObjectCleanupHandler { return newQObjectCleanupHandler((*C.QObjectCleanupHandler)(h)) } @@ -43,7 +50,7 @@ func NewQObjectCleanupHandler() *QObjectCleanupHandler { } func (this *QObjectCleanupHandler) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QObjectCleanupHandler_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QObjectCleanupHandler_MetaObject(this.h))) } func (this *QObjectCleanupHandler) Metacast(param1 string) unsafe.Pointer { @@ -71,7 +78,7 @@ func QObjectCleanupHandler_TrUtf8(s string) string { } func (this *QObjectCleanupHandler) Add(object *QObject) *QObject { - return newQObject_U(unsafe.Pointer(C.QObjectCleanupHandler_Add(this.h, object.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QObjectCleanupHandler_Add(this.h, object.cPointer()))) } func (this *QObjectCleanupHandler) Remove(object *QObject) { diff --git a/qt/gen_qobjectcleanuphandler.h b/qt/gen_qobjectcleanuphandler.h index 462d30fb..22853418 100644 --- a/qt/gen_qobjectcleanuphandler.h +++ b/qt/gen_qobjectcleanuphandler.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qobjectdefs.cpp b/qt/gen_qobjectdefs.cpp index af3ed779..a27ca360 100644 --- a/qt/gen_qobjectdefs.cpp +++ b/qt/gen_qobjectdefs.cpp @@ -12,7 +12,7 @@ #include #include #include -#include "qobjectdefs.h" +#include #include "gen_qobjectdefs.h" #include "_cgo_export.h" diff --git a/qt/gen_qobjectdefs.go b/qt/gen_qobjectdefs.go index f89b34a9..ca6a1c2b 100644 --- a/qt/gen_qobjectdefs.go +++ b/qt/gen_qobjectdefs.go @@ -42,6 +42,13 @@ func (this *QGenericArgument) cPointer() *C.QGenericArgument { return this.h } +func (this *QGenericArgument) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGenericArgument(h *C.QGenericArgument) *QGenericArgument { if h == nil { return nil @@ -49,7 +56,7 @@ func newQGenericArgument(h *C.QGenericArgument) *QGenericArgument { return &QGenericArgument{h: h} } -func newQGenericArgument_U(h unsafe.Pointer) *QGenericArgument { +func UnsafeNewQGenericArgument(h unsafe.Pointer) *QGenericArgument { return newQGenericArgument((*C.QGenericArgument)(h)) } @@ -116,14 +123,21 @@ func (this *QGenericReturnArgument) cPointer() *C.QGenericReturnArgument { return this.h } +func (this *QGenericReturnArgument) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQGenericReturnArgument(h *C.QGenericReturnArgument) *QGenericReturnArgument { if h == nil { return nil } - return &QGenericReturnArgument{h: h, QGenericArgument: newQGenericArgument_U(unsafe.Pointer(h))} + return &QGenericReturnArgument{h: h, QGenericArgument: UnsafeNewQGenericArgument(unsafe.Pointer(h))} } -func newQGenericReturnArgument_U(h unsafe.Pointer) *QGenericReturnArgument { +func UnsafeNewQGenericReturnArgument(h unsafe.Pointer) *QGenericReturnArgument { return newQGenericReturnArgument((*C.QGenericReturnArgument)(h)) } @@ -180,6 +194,13 @@ func (this *QMetaObject) cPointer() *C.QMetaObject { return this.h } +func (this *QMetaObject) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaObject(h *C.QMetaObject) *QMetaObject { if h == nil { return nil @@ -187,7 +208,7 @@ func newQMetaObject(h *C.QMetaObject) *QMetaObject { return &QMetaObject{h: h} } -func newQMetaObject_U(h unsafe.Pointer) *QMetaObject { +func UnsafeNewQMetaObject(h unsafe.Pointer) *QMetaObject { return newQMetaObject((*C.QMetaObject)(h)) } @@ -209,7 +230,7 @@ func (this *QMetaObject) ClassName() unsafe.Pointer { } func (this *QMetaObject) SuperClass() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaObject_SuperClass(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaObject_SuperClass(this.h))) } func (this *QMetaObject) Inherits(metaObject *QMetaObject) bool { @@ -217,11 +238,11 @@ func (this *QMetaObject) Inherits(metaObject *QMetaObject) bool { } func (this *QMetaObject) Cast(obj *QObject) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_Cast(this.h, obj.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_Cast(this.h, obj.cPointer()))) } func (this *QMetaObject) CastWithObj(obj *QObject) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_CastWithObj(this.h, obj.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_CastWithObj(this.h, obj.cPointer()))) } func (this *QMetaObject) Tr(s string, c string) string { @@ -429,7 +450,7 @@ func QMetaObject_InvokeMethod4(obj *QObject, member string) bool { } func (this *QMetaObject) NewInstance() *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance(this.h))) } func (this *QMetaObject) Tr3(s string, c string, n int) string { @@ -698,43 +719,43 @@ func QMetaObject_InvokeMethod124(obj *QObject, member string, val0 QGenericArgum } func (this *QMetaObject) NewInstance1(val0 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance1(this.h, val0.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance1(this.h, val0.cPointer()))) } func (this *QMetaObject) NewInstance2(val0 QGenericArgument, val1 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance2(this.h, val0.cPointer(), val1.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance2(this.h, val0.cPointer(), val1.cPointer()))) } func (this *QMetaObject) NewInstance3(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance3(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance3(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer()))) } func (this *QMetaObject) NewInstance4(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument, val3 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance4(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance4(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer()))) } func (this *QMetaObject) NewInstance5(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument, val3 QGenericArgument, val4 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance5(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance5(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer()))) } func (this *QMetaObject) NewInstance6(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument, val3 QGenericArgument, val4 QGenericArgument, val5 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance6(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance6(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer()))) } func (this *QMetaObject) NewInstance7(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument, val3 QGenericArgument, val4 QGenericArgument, val5 QGenericArgument, val6 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance7(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance7(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer()))) } func (this *QMetaObject) NewInstance8(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument, val3 QGenericArgument, val4 QGenericArgument, val5 QGenericArgument, val6 QGenericArgument, val7 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance8(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer(), val7.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance8(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer(), val7.cPointer()))) } func (this *QMetaObject) NewInstance9(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument, val3 QGenericArgument, val4 QGenericArgument, val5 QGenericArgument, val6 QGenericArgument, val7 QGenericArgument, val8 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance9(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer(), val7.cPointer(), val8.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance9(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer(), val7.cPointer(), val8.cPointer()))) } func (this *QMetaObject) NewInstance10(val0 QGenericArgument, val1 QGenericArgument, val2 QGenericArgument, val3 QGenericArgument, val4 QGenericArgument, val5 QGenericArgument, val6 QGenericArgument, val7 QGenericArgument, val8 QGenericArgument, val9 QGenericArgument) *QObject { - return newQObject_U(unsafe.Pointer(C.QMetaObject_NewInstance10(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer(), val7.cPointer(), val8.cPointer(), val9.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QMetaObject_NewInstance10(this.h, val0.cPointer(), val1.cPointer(), val2.cPointer(), val3.cPointer(), val4.cPointer(), val5.cPointer(), val6.cPointer(), val7.cPointer(), val8.cPointer(), val9.cPointer()))) } // Delete this object from C++ memory. @@ -762,6 +783,13 @@ func (this *QMetaObject__Connection) cPointer() *C.QMetaObject__Connection { return this.h } +func (this *QMetaObject__Connection) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaObject__Connection(h *C.QMetaObject__Connection) *QMetaObject__Connection { if h == nil { return nil @@ -769,7 +797,7 @@ func newQMetaObject__Connection(h *C.QMetaObject__Connection) *QMetaObject__Conn return &QMetaObject__Connection{h: h} } -func newQMetaObject__Connection_U(h unsafe.Pointer) *QMetaObject__Connection { +func UnsafeNewQMetaObject__Connection(h unsafe.Pointer) *QMetaObject__Connection { return newQMetaObject__Connection((*C.QMetaObject__Connection)(h)) } @@ -814,6 +842,13 @@ func (this *QMetaObject__SuperData) cPointer() *C.QMetaObject__SuperData { return this.h } +func (this *QMetaObject__SuperData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQMetaObject__SuperData(h *C.QMetaObject__SuperData) *QMetaObject__SuperData { if h == nil { return nil @@ -821,7 +856,7 @@ func newQMetaObject__SuperData(h *C.QMetaObject__SuperData) *QMetaObject__SuperD return &QMetaObject__SuperData{h: h} } -func newQMetaObject__SuperData_U(h unsafe.Pointer) *QMetaObject__SuperData { +func UnsafeNewQMetaObject__SuperData(h unsafe.Pointer) *QMetaObject__SuperData { return newQMetaObject__SuperData((*C.QMetaObject__SuperData)(h)) } @@ -844,7 +879,7 @@ func NewQMetaObject__SuperData3(param1 *QMetaObject__SuperData) *QMetaObject__Su } func (this *QMetaObject__SuperData) OperatorMinusGreater() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QMetaObject__SuperData_OperatorMinusGreater(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QMetaObject__SuperData_OperatorMinusGreater(this.h))) } func (this *QMetaObject__SuperData) OperatorAssign(param1 *QMetaObject__SuperData) { diff --git a/qt/gen_qobjectdefs.h b/qt/gen_qobjectdefs.h index 6ad06580..4c01bee7 100644 --- a/qt/gen_qobjectdefs.h +++ b/qt/gen_qobjectdefs.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qoffscreensurface.cpp b/qt/gen_qoffscreensurface.cpp index 8277d3e8..ff4314a9 100644 --- a/qt/gen_qoffscreensurface.cpp +++ b/qt/gen_qoffscreensurface.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qoffscreensurface.h" +#include #include "gen_qoffscreensurface.h" #include "_cgo_export.h" diff --git a/qt/gen_qoffscreensurface.go b/qt/gen_qoffscreensurface.go index 6dcd5ef2..97e4f7e6 100644 --- a/qt/gen_qoffscreensurface.go +++ b/qt/gen_qoffscreensurface.go @@ -27,14 +27,21 @@ func (this *QOffscreenSurface) cPointer() *C.QOffscreenSurface { return this.h } +func (this *QOffscreenSurface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQOffscreenSurface(h *C.QOffscreenSurface) *QOffscreenSurface { if h == nil { return nil } - return &QOffscreenSurface{h: h, QObject: newQObject_U(unsafe.Pointer(h)), QSurface: newQSurface_U(unsafe.Pointer(h))} + return &QOffscreenSurface{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h)), QSurface: UnsafeNewQSurface(unsafe.Pointer(h))} } -func newQOffscreenSurface_U(h unsafe.Pointer) *QOffscreenSurface { +func UnsafeNewQOffscreenSurface(h unsafe.Pointer) *QOffscreenSurface { return newQOffscreenSurface((*C.QOffscreenSurface)(h)) } @@ -57,7 +64,7 @@ func NewQOffscreenSurface3(screen *QScreen) *QOffscreenSurface { } func (this *QOffscreenSurface) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QOffscreenSurface_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QOffscreenSurface_MetaObject(this.h))) } func (this *QOffscreenSurface) Metacast(param1 string) unsafe.Pointer { @@ -126,7 +133,7 @@ func (this *QOffscreenSurface) Size() *QSize { } func (this *QOffscreenSurface) Screen() *QScreen { - return newQScreen_U(unsafe.Pointer(C.QOffscreenSurface_Screen(this.h))) + return UnsafeNewQScreen(unsafe.Pointer(C.QOffscreenSurface_Screen(this.h))) } func (this *QOffscreenSurface) SetScreen(screen *QScreen) { @@ -156,7 +163,7 @@ func miqt_exec_callback_QOffscreenSurface_ScreenChanged(cb C.intptr_t, screen *C } // Convert all CABI parameters to Go parameters - slotval1 := newQScreen_U(unsafe.Pointer(screen)) + slotval1 := UnsafeNewQScreen(unsafe.Pointer(screen)) gofunc(slotval1) } diff --git a/qt/gen_qoffscreensurface.h b/qt/gen_qoffscreensurface.h index 4f418c2e..c70cb2a3 100644 --- a/qt/gen_qoffscreensurface.h +++ b/qt/gen_qoffscreensurface.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qoperatingsystemversion.cpp b/qt/gen_qoperatingsystemversion.cpp index 66b5a870..d6200591 100644 --- a/qt/gen_qoperatingsystemversion.cpp +++ b/qt/gen_qoperatingsystemversion.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qoperatingsystemversion.h" +#include #include "gen_qoperatingsystemversion.h" #include "_cgo_export.h" diff --git a/qt/gen_qoperatingsystemversion.go b/qt/gen_qoperatingsystemversion.go index f256022f..48f99e81 100644 --- a/qt/gen_qoperatingsystemversion.go +++ b/qt/gen_qoperatingsystemversion.go @@ -36,6 +36,13 @@ func (this *QOperatingSystemVersion) cPointer() *C.QOperatingSystemVersion { return this.h } +func (this *QOperatingSystemVersion) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQOperatingSystemVersion(h *C.QOperatingSystemVersion) *QOperatingSystemVersion { if h == nil { return nil @@ -43,7 +50,7 @@ func newQOperatingSystemVersion(h *C.QOperatingSystemVersion) *QOperatingSystemV return &QOperatingSystemVersion{h: h} } -func newQOperatingSystemVersion_U(h unsafe.Pointer) *QOperatingSystemVersion { +func UnsafeNewQOperatingSystemVersion(h unsafe.Pointer) *QOperatingSystemVersion { return newQOperatingSystemVersion((*C.QOperatingSystemVersion)(h)) } diff --git a/qt/gen_qoperatingsystemversion.h b/qt/gen_qoperatingsystemversion.h index bb500b83..e3f951ca 100644 --- a/qt/gen_qoperatingsystemversion.h +++ b/qt/gen_qoperatingsystemversion.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpagedpaintdevice.cpp b/qt/gen_qpagedpaintdevice.cpp index 2a2e45e6..448dcf5e 100644 --- a/qt/gen_qpagedpaintdevice.cpp +++ b/qt/gen_qpagedpaintdevice.cpp @@ -4,7 +4,7 @@ #include #define WORKAROUND_INNER_CLASS_DEFINITION_QPagedPaintDevice__Margins #include -#include "qpagedpaintdevice.h" +#include #include "gen_qpagedpaintdevice.h" #include "_cgo_export.h" diff --git a/qt/gen_qpagedpaintdevice.go b/qt/gen_qpagedpaintdevice.go index c0cf856c..ff068418 100644 --- a/qt/gen_qpagedpaintdevice.go +++ b/qt/gen_qpagedpaintdevice.go @@ -165,14 +165,21 @@ func (this *QPagedPaintDevice) cPointer() *C.QPagedPaintDevice { return this.h } +func (this *QPagedPaintDevice) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPagedPaintDevice(h *C.QPagedPaintDevice) *QPagedPaintDevice { if h == nil { return nil } - return &QPagedPaintDevice{h: h, QPaintDevice: newQPaintDevice_U(unsafe.Pointer(h))} + return &QPagedPaintDevice{h: h, QPaintDevice: UnsafeNewQPaintDevice(unsafe.Pointer(h))} } -func newQPagedPaintDevice_U(h unsafe.Pointer) *QPagedPaintDevice { +func UnsafeNewQPagedPaintDevice(h unsafe.Pointer) *QPagedPaintDevice { return newQPagedPaintDevice((*C.QPagedPaintDevice)(h)) } @@ -262,6 +269,13 @@ func (this *QPagedPaintDevice__Margins) cPointer() *C.QPagedPaintDevice__Margins return this.h } +func (this *QPagedPaintDevice__Margins) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPagedPaintDevice__Margins(h *C.QPagedPaintDevice__Margins) *QPagedPaintDevice__Margins { if h == nil { return nil @@ -269,7 +283,7 @@ func newQPagedPaintDevice__Margins(h *C.QPagedPaintDevice__Margins) *QPagedPaint return &QPagedPaintDevice__Margins{h: h} } -func newQPagedPaintDevice__Margins_U(h unsafe.Pointer) *QPagedPaintDevice__Margins { +func UnsafeNewQPagedPaintDevice__Margins(h unsafe.Pointer) *QPagedPaintDevice__Margins { return newQPagedPaintDevice__Margins((*C.QPagedPaintDevice__Margins)(h)) } diff --git a/qt/gen_qpagedpaintdevice.h b/qt/gen_qpagedpaintdevice.h index bf94cfb4..2d578628 100644 --- a/qt/gen_qpagedpaintdevice.h +++ b/qt/gen_qpagedpaintdevice.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpagelayout.cpp b/qt/gen_qpagelayout.cpp index f2b1724a..bab98a32 100644 --- a/qt/gen_qpagelayout.cpp +++ b/qt/gen_qpagelayout.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qpagelayout.h" +#include #include "gen_qpagelayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qpagelayout.go b/qt/gen_qpagelayout.go index 6a0240d6..e18e96a9 100644 --- a/qt/gen_qpagelayout.go +++ b/qt/gen_qpagelayout.go @@ -49,6 +49,13 @@ func (this *QPageLayout) cPointer() *C.QPageLayout { return this.h } +func (this *QPageLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPageLayout(h *C.QPageLayout) *QPageLayout { if h == nil { return nil @@ -56,7 +63,7 @@ func newQPageLayout(h *C.QPageLayout) *QPageLayout { return &QPageLayout{h: h} } -func newQPageLayout_U(h unsafe.Pointer) *QPageLayout { +func UnsafeNewQPageLayout(h unsafe.Pointer) *QPageLayout { return newQPageLayout((*C.QPageLayout)(h)) } diff --git a/qt/gen_qpagelayout.h b/qt/gen_qpagelayout.h index 3fa2a7f3..4ec6026b 100644 --- a/qt/gen_qpagelayout.h +++ b/qt/gen_qpagelayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpagesize.cpp b/qt/gen_qpagesize.cpp index d33e8f9a..198a734e 100644 --- a/qt/gen_qpagesize.cpp +++ b/qt/gen_qpagesize.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qpagesize.h" +#include #include "gen_qpagesize.h" #include "_cgo_export.h" diff --git a/qt/gen_qpagesize.go b/qt/gen_qpagesize.go index bd968920..9db1a5b7 100644 --- a/qt/gen_qpagesize.go +++ b/qt/gen_qpagesize.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -175,6 +176,13 @@ func (this *QPageSize) cPointer() *C.QPageSize { return this.h } +func (this *QPageSize) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPageSize(h *C.QPageSize) *QPageSize { if h == nil { return nil @@ -182,7 +190,7 @@ func newQPageSize(h *C.QPageSize) *QPageSize { return &QPageSize{h: h} } -func newQPageSize_U(h unsafe.Pointer) *QPageSize { +func UnsafeNewQPageSize(h unsafe.Pointer) *QPageSize { return newQPageSize((*C.QPageSize)(h)) } @@ -218,7 +226,7 @@ func NewQPageSize5(other *QPageSize) *QPageSize { // NewQPageSize6 constructs a new QPageSize object. func NewQPageSize6(pointSize *QSize, name string) *QPageSize { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QPageSize_new6(pointSize.cPointer(), (*C.struct_miqt_string)(name_ms)) return newQPageSize(ret) @@ -226,7 +234,7 @@ func NewQPageSize6(pointSize *QSize, name string) *QPageSize { // NewQPageSize7 constructs a new QPageSize object. func NewQPageSize7(pointSize *QSize, name string, matchPolicy QPageSize__SizeMatchPolicy) *QPageSize { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QPageSize_new7(pointSize.cPointer(), (*C.struct_miqt_string)(name_ms), (C.int)(matchPolicy)) return newQPageSize(ret) @@ -234,7 +242,7 @@ func NewQPageSize7(pointSize *QSize, name string, matchPolicy QPageSize__SizeMat // NewQPageSize8 constructs a new QPageSize object. func NewQPageSize8(size *QSizeF, units QPageSize__Unit, name string) *QPageSize { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QPageSize_new8(size.cPointer(), (C.int)(units), (*C.struct_miqt_string)(name_ms)) return newQPageSize(ret) @@ -242,7 +250,7 @@ func NewQPageSize8(size *QSizeF, units QPageSize__Unit, name string) *QPageSize // NewQPageSize9 constructs a new QPageSize object. func NewQPageSize9(size *QSizeF, units QPageSize__Unit, name string, matchPolicy QPageSize__SizeMatchPolicy) *QPageSize { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QPageSize_new9(size.cPointer(), (C.int)(units), (*C.struct_miqt_string)(name_ms), (C.int)(matchPolicy)) return newQPageSize(ret) diff --git a/qt/gen_qpagesize.h b/qt/gen_qpagesize.h index 0ad82c54..aa3f9c33 100644 --- a/qt/gen_qpagesize.h +++ b/qt/gen_qpagesize.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpaintdevice.cpp b/qt/gen_qpaintdevice.cpp index db277c7e..63e99db7 100644 --- a/qt/gen_qpaintdevice.cpp +++ b/qt/gen_qpaintdevice.cpp @@ -1,6 +1,6 @@ #include #include -#include "qpaintdevice.h" +#include #include "gen_qpaintdevice.h" #include "_cgo_export.h" diff --git a/qt/gen_qpaintdevice.go b/qt/gen_qpaintdevice.go index 1b5c82fe..a0f8e96c 100644 --- a/qt/gen_qpaintdevice.go +++ b/qt/gen_qpaintdevice.go @@ -41,6 +41,13 @@ func (this *QPaintDevice) cPointer() *C.QPaintDevice { return this.h } +func (this *QPaintDevice) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPaintDevice(h *C.QPaintDevice) *QPaintDevice { if h == nil { return nil @@ -48,7 +55,7 @@ func newQPaintDevice(h *C.QPaintDevice) *QPaintDevice { return &QPaintDevice{h: h} } -func newQPaintDevice_U(h unsafe.Pointer) *QPaintDevice { +func UnsafeNewQPaintDevice(h unsafe.Pointer) *QPaintDevice { return newQPaintDevice((*C.QPaintDevice)(h)) } @@ -61,7 +68,7 @@ func (this *QPaintDevice) PaintingActive() bool { } func (this *QPaintDevice) PaintEngine() *QPaintEngine { - return newQPaintEngine_U(unsafe.Pointer(C.QPaintDevice_PaintEngine(this.h))) + return UnsafeNewQPaintEngine(unsafe.Pointer(C.QPaintDevice_PaintEngine(this.h))) } func (this *QPaintDevice) Width() int { diff --git a/qt/gen_qpaintdevice.h b/qt/gen_qpaintdevice.h index d4f34c7a..31f93d76 100644 --- a/qt/gen_qpaintdevice.h +++ b/qt/gen_qpaintdevice.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpaintdevicewindow.cpp b/qt/gen_qpaintdevicewindow.cpp index e390f3dc..655233cb 100644 --- a/qt/gen_qpaintdevicewindow.cpp +++ b/qt/gen_qpaintdevicewindow.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qpaintdevicewindow.h" +#include #include "gen_qpaintdevicewindow.h" #include "_cgo_export.h" diff --git a/qt/gen_qpaintdevicewindow.go b/qt/gen_qpaintdevicewindow.go index 9a70560c..2fd6e81d 100644 --- a/qt/gen_qpaintdevicewindow.go +++ b/qt/gen_qpaintdevicewindow.go @@ -26,19 +26,26 @@ func (this *QPaintDeviceWindow) cPointer() *C.QPaintDeviceWindow { return this.h } +func (this *QPaintDeviceWindow) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPaintDeviceWindow(h *C.QPaintDeviceWindow) *QPaintDeviceWindow { if h == nil { return nil } - return &QPaintDeviceWindow{h: h, QWindow: newQWindow_U(unsafe.Pointer(h)), QPaintDevice: newQPaintDevice_U(unsafe.Pointer(h))} + return &QPaintDeviceWindow{h: h, QWindow: UnsafeNewQWindow(unsafe.Pointer(h)), QPaintDevice: UnsafeNewQPaintDevice(unsafe.Pointer(h))} } -func newQPaintDeviceWindow_U(h unsafe.Pointer) *QPaintDeviceWindow { +func UnsafeNewQPaintDeviceWindow(h unsafe.Pointer) *QPaintDeviceWindow { return newQPaintDeviceWindow((*C.QPaintDeviceWindow)(h)) } func (this *QPaintDeviceWindow) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPaintDeviceWindow_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPaintDeviceWindow_MetaObject(this.h))) } func (this *QPaintDeviceWindow) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qpaintdevicewindow.h b/qt/gen_qpaintdevicewindow.h index 841d122d..6edef6ff 100644 --- a/qt/gen_qpaintdevicewindow.h +++ b/qt/gen_qpaintdevicewindow.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpaintengine.cpp b/qt/gen_qpaintengine.cpp index 91a1f8d4..4e8dfdd0 100644 --- a/qt/gen_qpaintengine.cpp +++ b/qt/gen_qpaintengine.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "qpaintengine.h" +#include #include "gen_qpaintengine.h" #include "_cgo_export.h" diff --git a/qt/gen_qpaintengine.go b/qt/gen_qpaintengine.go index f8e760b2..877567a9 100644 --- a/qt/gen_qpaintengine.go +++ b/qt/gen_qpaintengine.go @@ -112,6 +112,13 @@ func (this *QTextItem) cPointer() *C.QTextItem { return this.h } +func (this *QTextItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextItem(h *C.QTextItem) *QTextItem { if h == nil { return nil @@ -119,7 +126,7 @@ func newQTextItem(h *C.QTextItem) *QTextItem { return &QTextItem{h: h} } -func newQTextItem_U(h unsafe.Pointer) *QTextItem { +func UnsafeNewQTextItem(h unsafe.Pointer) *QTextItem { return newQTextItem((*C.QTextItem)(h)) } @@ -178,6 +185,13 @@ func (this *QPaintEngine) cPointer() *C.QPaintEngine { return this.h } +func (this *QPaintEngine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPaintEngine(h *C.QPaintEngine) *QPaintEngine { if h == nil { return nil @@ -185,7 +199,7 @@ func newQPaintEngine(h *C.QPaintEngine) *QPaintEngine { return &QPaintEngine{h: h} } -func newQPaintEngine_U(h unsafe.Pointer) *QPaintEngine { +func UnsafeNewQPaintEngine(h unsafe.Pointer) *QPaintEngine { return newQPaintEngine((*C.QPaintEngine)(h)) } @@ -274,7 +288,7 @@ func (this *QPaintEngine) SetPaintDevice(device *QPaintDevice) { } func (this *QPaintEngine) PaintDevice() *QPaintDevice { - return newQPaintDevice_U(unsafe.Pointer(C.QPaintEngine_PaintDevice(this.h))) + return UnsafeNewQPaintDevice(unsafe.Pointer(C.QPaintEngine_PaintDevice(this.h))) } func (this *QPaintEngine) SetSystemClip(baseClip *QRegion) { @@ -331,7 +345,7 @@ func (this *QPaintEngine) HasFeature(feature QPaintEngine__PaintEngineFeature) b } func (this *QPaintEngine) Painter() *QPainter { - return newQPainter_U(unsafe.Pointer(C.QPaintEngine_Painter(this.h))) + return UnsafeNewQPainter(unsafe.Pointer(C.QPaintEngine_Painter(this.h))) } func (this *QPaintEngine) SyncState() { @@ -371,6 +385,13 @@ func (this *QPaintEngineState) cPointer() *C.QPaintEngineState { return this.h } +func (this *QPaintEngineState) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPaintEngineState(h *C.QPaintEngineState) *QPaintEngineState { if h == nil { return nil @@ -378,7 +399,7 @@ func newQPaintEngineState(h *C.QPaintEngineState) *QPaintEngineState { return &QPaintEngineState{h: h} } -func newQPaintEngineState_U(h unsafe.Pointer) *QPaintEngineState { +func UnsafeNewQPaintEngineState(h unsafe.Pointer) *QPaintEngineState { return newQPaintEngineState((*C.QPaintEngineState)(h)) } @@ -474,7 +495,7 @@ func (this *QPaintEngineState) Opacity() float64 { } func (this *QPaintEngineState) Painter() *QPainter { - return newQPainter_U(unsafe.Pointer(C.QPaintEngineState_Painter(this.h))) + return UnsafeNewQPainter(unsafe.Pointer(C.QPaintEngineState_Painter(this.h))) } func (this *QPaintEngineState) BrushNeedsResolving() bool { diff --git a/qt/gen_qpaintengine.h b/qt/gen_qpaintengine.h index 40264bc1..73fbf2b5 100644 --- a/qt/gen_qpaintengine.h +++ b/qt/gen_qpaintengine.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpainter.cpp b/qt/gen_qpainter.cpp index 159b5292..b4e18d79 100644 --- a/qt/gen_qpainter.cpp +++ b/qt/gen_qpainter.cpp @@ -29,7 +29,7 @@ #include #include #include -#include "qpainter.h" +#include #include "gen_qpainter.h" #include "_cgo_export.h" diff --git a/qt/gen_qpainter.go b/qt/gen_qpainter.go index 5868f5da..8756ac14 100644 --- a/qt/gen_qpainter.go +++ b/qt/gen_qpainter.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -85,6 +86,13 @@ func (this *QPainter) cPointer() *C.QPainter { return this.h } +func (this *QPainter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPainter(h *C.QPainter) *QPainter { if h == nil { return nil @@ -92,7 +100,7 @@ func newQPainter(h *C.QPainter) *QPainter { return &QPainter{h: h} } -func newQPainter_U(h unsafe.Pointer) *QPainter { +func UnsafeNewQPainter(h unsafe.Pointer) *QPainter { return newQPainter((*C.QPainter)(h)) } @@ -109,7 +117,7 @@ func NewQPainter2(param1 *QPaintDevice) *QPainter { } func (this *QPainter) Device() *QPaintDevice { - return newQPaintDevice_U(unsafe.Pointer(C.QPainter_Device(this.h))) + return UnsafeNewQPaintDevice(unsafe.Pointer(C.QPainter_Device(this.h))) } func (this *QPainter) Begin(param1 *QPaintDevice) bool { @@ -137,7 +145,7 @@ func (this *QPainter) CompositionMode() QPainter__CompositionMode { } func (this *QPainter) Font() *QFont { - return newQFont_U(unsafe.Pointer(C.QPainter_Font(this.h))) + return UnsafeNewQFont(unsafe.Pointer(C.QPainter_Font(this.h))) } func (this *QPainter) SetFont(f *QFont) { @@ -171,7 +179,7 @@ func (this *QPainter) SetPenWithStyle(style PenStyle) { } func (this *QPainter) Pen() *QPen { - return newQPen_U(unsafe.Pointer(C.QPainter_Pen(this.h))) + return UnsafeNewQPen(unsafe.Pointer(C.QPainter_Pen(this.h))) } func (this *QPainter) SetBrush(brush *QBrush) { @@ -183,7 +191,7 @@ func (this *QPainter) SetBrushWithStyle(style BrushStyle) { } func (this *QPainter) Brush() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPainter_Brush(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPainter_Brush(this.h))) } func (this *QPainter) SetBackgroundMode(mode BGMode) { @@ -218,7 +226,7 @@ func (this *QPainter) SetBackground(bg *QBrush) { } func (this *QPainter) Background() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPainter_Background(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPainter_Background(this.h))) } func (this *QPainter) Opacity() float64 { @@ -291,11 +299,11 @@ func (this *QPainter) SetMatrix(matrix *QMatrix) { } func (this *QPainter) Matrix() *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QPainter_Matrix(this.h))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QPainter_Matrix(this.h))) } func (this *QPainter) DeviceMatrix() *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QPainter_DeviceMatrix(this.h))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QPainter_DeviceMatrix(this.h))) } func (this *QPainter) ResetMatrix() { @@ -307,11 +315,11 @@ func (this *QPainter) SetTransform(transform *QTransform) { } func (this *QPainter) Transform() *QTransform { - return newQTransform_U(unsafe.Pointer(C.QPainter_Transform(this.h))) + return UnsafeNewQTransform(unsafe.Pointer(C.QPainter_Transform(this.h))) } func (this *QPainter) DeviceTransform() *QTransform { - return newQTransform_U(unsafe.Pointer(C.QPainter_DeviceTransform(this.h))) + return UnsafeNewQTransform(unsafe.Pointer(C.QPainter_DeviceTransform(this.h))) } func (this *QPainter) ResetTransform() { @@ -323,7 +331,7 @@ func (this *QPainter) SetWorldMatrix(matrix *QMatrix) { } func (this *QPainter) WorldMatrix() *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QPainter_WorldMatrix(this.h))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QPainter_WorldMatrix(this.h))) } func (this *QPainter) CombinedMatrix() *QMatrix { @@ -346,7 +354,7 @@ func (this *QPainter) SetWorldTransform(matrix *QTransform) { } func (this *QPainter) WorldTransform() *QTransform { - return newQTransform_U(unsafe.Pointer(C.QPainter_WorldTransform(this.h))) + return UnsafeNewQTransform(unsafe.Pointer(C.QPainter_WorldTransform(this.h))) } func (this *QPainter) CombinedTransform() *QTransform { @@ -823,55 +831,55 @@ func (this *QPainter) DrawStaticText3(left int, top int, staticText *QStaticText } func (this *QPainter) DrawText(p *QPointF, s string) { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) C.QPainter_DrawText(this.h, p.cPointer(), (*C.struct_miqt_string)(s_ms)) } func (this *QPainter) DrawText2(p *QPoint, s string) { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) C.QPainter_DrawText2(this.h, p.cPointer(), (*C.struct_miqt_string)(s_ms)) } func (this *QPainter) DrawText3(x int, y int, s string) { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) C.QPainter_DrawText3(this.h, (C.int)(x), (C.int)(y), (*C.struct_miqt_string)(s_ms)) } func (this *QPainter) DrawText4(p *QPointF, str string, tf int, justificationPadding int) { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) C.QPainter_DrawText4(this.h, p.cPointer(), (*C.struct_miqt_string)(str_ms), (C.int)(tf), (C.int)(justificationPadding)) } func (this *QPainter) DrawText5(r *QRectF, flags int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText5(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) } func (this *QPainter) DrawText6(r *QRect, flags int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText6(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) } func (this *QPainter) DrawText7(x int, y int, w int, h int, flags int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText7(this.h, (C.int)(x), (C.int)(y), (C.int)(w), (C.int)(h), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) } func (this *QPainter) DrawText8(r *QRectF, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText8(this.h, r.cPointer(), (*C.struct_miqt_string)(text_ms)) } func (this *QPainter) BoundingRect(rect *QRectF, flags int, text string) *QRectF { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QPainter_BoundingRect(this.h, rect.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) _goptr := newQRectF(_ret) @@ -880,7 +888,7 @@ func (this *QPainter) BoundingRect(rect *QRectF, flags int, text string) *QRectF } func (this *QPainter) BoundingRect2(rect *QRect, flags int, text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QPainter_BoundingRect2(this.h, rect.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -889,7 +897,7 @@ func (this *QPainter) BoundingRect2(rect *QRect, flags int, text string) *QRect } func (this *QPainter) BoundingRect3(x int, y int, w int, h int, flags int, text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QPainter_BoundingRect3(this.h, (C.int)(x), (C.int)(y), (C.int)(w), (C.int)(h), (C.int)(flags), (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -898,7 +906,7 @@ func (this *QPainter) BoundingRect3(x int, y int, w int, h int, flags int, text } func (this *QPainter) BoundingRect4(rect *QRectF, text string) *QRectF { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QPainter_BoundingRect4(this.h, rect.cPointer(), (*C.struct_miqt_string)(text_ms)) _goptr := newQRectF(_ret) @@ -1007,7 +1015,7 @@ func (this *QPainter) TestRenderHint(hint QPainter__RenderHint) bool { } func (this *QPainter) PaintEngine() *QPaintEngine { - return newQPaintEngine_U(unsafe.Pointer(C.QPainter_PaintEngine(this.h))) + return UnsafeNewQPaintEngine(unsafe.Pointer(C.QPainter_PaintEngine(this.h))) } func QPainter_SetRedirected(device *QPaintDevice, replacement *QPaintDevice) { @@ -1015,7 +1023,7 @@ func QPainter_SetRedirected(device *QPaintDevice, replacement *QPaintDevice) { } func QPainter_Redirected(device *QPaintDevice) *QPaintDevice { - return newQPaintDevice_U(unsafe.Pointer(C.QPainter_Redirected(device.cPointer()))) + return UnsafeNewQPaintDevice(unsafe.Pointer(C.QPainter_Redirected(device.cPointer()))) } func QPainter_RestoreRedirected(device *QPaintDevice) { @@ -1167,31 +1175,31 @@ func (this *QPainter) DrawImage82(x int, y int, image *QImage, sx int, sy int, s } func (this *QPainter) DrawText42(r *QRectF, flags int, text string, br *QRectF) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText42(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms), br.cPointer()) } func (this *QPainter) DrawText43(r *QRect, flags int, text string, br *QRect) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText43(this.h, r.cPointer(), (C.int)(flags), (*C.struct_miqt_string)(text_ms), br.cPointer()) } func (this *QPainter) DrawText72(x int, y int, w int, h int, flags int, text string, br *QRect) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText72(this.h, (C.int)(x), (C.int)(y), (C.int)(w), (C.int)(h), (C.int)(flags), (*C.struct_miqt_string)(text_ms), br.cPointer()) } func (this *QPainter) DrawText32(r *QRectF, text string, o *QTextOption) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainter_DrawText32(this.h, r.cPointer(), (*C.struct_miqt_string)(text_ms), o.cPointer()) } func (this *QPainter) BoundingRect32(rect *QRectF, text string, o *QTextOption) *QRectF { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QPainter_BoundingRect32(this.h, rect.cPointer(), (*C.struct_miqt_string)(text_ms), o.cPointer()) _goptr := newQRectF(_ret) @@ -1212,7 +1220,7 @@ func QPainter_SetRedirected3(device *QPaintDevice, replacement *QPaintDevice, of } func QPainter_Redirected2(device *QPaintDevice, offset *QPoint) *QPaintDevice { - return newQPaintDevice_U(unsafe.Pointer(C.QPainter_Redirected2(device.cPointer(), offset.cPointer()))) + return UnsafeNewQPaintDevice(unsafe.Pointer(C.QPainter_Redirected2(device.cPointer(), offset.cPointer()))) } // Delete this object from C++ memory. @@ -1240,6 +1248,13 @@ func (this *QPainter__PixmapFragment) cPointer() *C.QPainter__PixmapFragment { return this.h } +func (this *QPainter__PixmapFragment) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPainter__PixmapFragment(h *C.QPainter__PixmapFragment) *QPainter__PixmapFragment { if h == nil { return nil @@ -1247,7 +1262,7 @@ func newQPainter__PixmapFragment(h *C.QPainter__PixmapFragment) *QPainter__Pixma return &QPainter__PixmapFragment{h: h} } -func newQPainter__PixmapFragment_U(h unsafe.Pointer) *QPainter__PixmapFragment { +func UnsafeNewQPainter__PixmapFragment(h unsafe.Pointer) *QPainter__PixmapFragment { return newQPainter__PixmapFragment((*C.QPainter__PixmapFragment)(h)) } diff --git a/qt/gen_qpainter.h b/qt/gen_qpainter.h index b510b165..91d2be7c 100644 --- a/qt/gen_qpainter.h +++ b/qt/gen_qpainter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpainterpath.cpp b/qt/gen_qpainterpath.cpp index ffd6d1ab..3581173d 100644 --- a/qt/gen_qpainterpath.cpp +++ b/qt/gen_qpainterpath.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qpainterpath.h" +#include #include "gen_qpainterpath.h" #include "_cgo_export.h" @@ -399,7 +399,7 @@ void QPainterPathStroker_SetDashPattern(QPainterPathStroker* self, int dashPatte } void QPainterPathStroker_SetDashPatternWithDashPattern(QPainterPathStroker* self, struct miqt_array* /* of double */ dashPattern) { - QVector dashPattern_QList; + QVector dashPattern_QList; dashPattern_QList.reserve(dashPattern->len); double* dashPattern_arr = static_cast(dashPattern->data); for(size_t i = 0; i < dashPattern->len; ++i) { diff --git a/qt/gen_qpainterpath.go b/qt/gen_qpainterpath.go index 0b483cb9..f6727456 100644 --- a/qt/gen_qpainterpath.go +++ b/qt/gen_qpainterpath.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -33,6 +34,13 @@ func (this *QPainterPath) cPointer() *C.QPainterPath { return this.h } +func (this *QPainterPath) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPainterPath(h *C.QPainterPath) *QPainterPath { if h == nil { return nil @@ -40,7 +48,7 @@ func newQPainterPath(h *C.QPainterPath) *QPainterPath { return &QPainterPath{h: h} } -func newQPainterPath_U(h unsafe.Pointer) *QPainterPath { +func UnsafeNewQPainterPath(h unsafe.Pointer) *QPainterPath { return newQPainterPath((*C.QPainterPath)(h)) } @@ -162,13 +170,13 @@ func (this *QPainterPath) AddEllipse3(center *QPointF, rx float64, ry float64) { } func (this *QPainterPath) AddText(point *QPointF, f *QFont, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainterPath_AddText(this.h, point.cPointer(), f.cPointer(), (*C.struct_miqt_string)(text_ms)) } func (this *QPainterPath) AddText2(x float64, y float64, f *QFont, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPainterPath_AddText2(this.h, (C.double)(x), (C.double)(y), f.cPointer(), (*C.struct_miqt_string)(text_ms)) } @@ -402,11 +410,11 @@ func (this *QPainterPath) OperatorBitwiseOrAssign(other *QPainterPath) { } func (this *QPainterPath) OperatorPlusAssign(other *QPainterPath) *QPainterPath { - return newQPainterPath_U(unsafe.Pointer(C.QPainterPath_OperatorPlusAssign(this.h, other.cPointer()))) + return UnsafeNewQPainterPath(unsafe.Pointer(C.QPainterPath_OperatorPlusAssign(this.h, other.cPointer()))) } func (this *QPainterPath) OperatorMinusAssign(other *QPainterPath) *QPainterPath { - return newQPainterPath_U(unsafe.Pointer(C.QPainterPath_OperatorMinusAssign(this.h, other.cPointer()))) + return UnsafeNewQPainterPath(unsafe.Pointer(C.QPainterPath_OperatorMinusAssign(this.h, other.cPointer()))) } func (this *QPainterPath) AddRoundedRect4(rect *QRectF, xRadius float64, yRadius float64, mode SizeMode) { @@ -442,6 +450,13 @@ func (this *QPainterPathStroker) cPointer() *C.QPainterPathStroker { return this.h } +func (this *QPainterPathStroker) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPainterPathStroker(h *C.QPainterPathStroker) *QPainterPathStroker { if h == nil { return nil @@ -449,7 +464,7 @@ func newQPainterPathStroker(h *C.QPainterPathStroker) *QPainterPathStroker { return &QPainterPathStroker{h: h} } -func newQPainterPathStroker_U(h unsafe.Pointer) *QPainterPathStroker { +func UnsafeNewQPainterPathStroker(h unsafe.Pointer) *QPainterPathStroker { return newQPainterPathStroker((*C.QPainterPathStroker)(h)) } @@ -572,6 +587,13 @@ func (this *QPainterPath__Element) cPointer() *C.QPainterPath__Element { return this.h } +func (this *QPainterPath__Element) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPainterPath__Element(h *C.QPainterPath__Element) *QPainterPath__Element { if h == nil { return nil @@ -579,7 +601,7 @@ func newQPainterPath__Element(h *C.QPainterPath__Element) *QPainterPath__Element return &QPainterPath__Element{h: h} } -func newQPainterPath__Element_U(h unsafe.Pointer) *QPainterPath__Element { +func UnsafeNewQPainterPath__Element(h unsafe.Pointer) *QPainterPath__Element { return newQPainterPath__Element((*C.QPainterPath__Element)(h)) } diff --git a/qt/gen_qpainterpath.h b/qt/gen_qpainterpath.h index 7b46c583..112490ba 100644 --- a/qt/gen_qpainterpath.h +++ b/qt/gen_qpainterpath.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpalette.cpp b/qt/gen_qpalette.cpp index 9ac6a34b..c3e7c91e 100644 --- a/qt/gen_qpalette.cpp +++ b/qt/gen_qpalette.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qpalette.h" +#include #include "gen_qpalette.h" #include "_cgo_export.h" diff --git a/qt/gen_qpalette.go b/qt/gen_qpalette.go index 38f0b7db..b904411c 100644 --- a/qt/gen_qpalette.go +++ b/qt/gen_qpalette.go @@ -65,6 +65,13 @@ func (this *QPalette) cPointer() *C.QPalette { return this.h } +func (this *QPalette) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPalette(h *C.QPalette) *QPalette { if h == nil { return nil @@ -72,7 +79,7 @@ func newQPalette(h *C.QPalette) *QPalette { return &QPalette{h: h} } -func newQPalette_U(h unsafe.Pointer) *QPalette { +func UnsafeNewQPalette(h unsafe.Pointer) *QPalette { return newQPalette((*C.QPalette)(h)) } @@ -135,11 +142,11 @@ func (this *QPalette) SetCurrentColorGroup(cg QPalette__ColorGroup) { } func (this *QPalette) Color(cg QPalette__ColorGroup, cr QPalette__ColorRole) *QColor { - return newQColor_U(unsafe.Pointer(C.QPalette_Color(this.h, (C.int)(cg), (C.int)(cr)))) + return UnsafeNewQColor(unsafe.Pointer(C.QPalette_Color(this.h, (C.int)(cg), (C.int)(cr)))) } func (this *QPalette) Brush(cg QPalette__ColorGroup, cr QPalette__ColorRole) *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Brush(this.h, (C.int)(cg), (C.int)(cr)))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Brush(this.h, (C.int)(cg), (C.int)(cr)))) } func (this *QPalette) SetColor(cg QPalette__ColorGroup, cr QPalette__ColorRole, color *QColor) { @@ -171,99 +178,99 @@ func (this *QPalette) IsEqual(cr1 QPalette__ColorGroup, cr2 QPalette__ColorGroup } func (this *QPalette) ColorWithCr(cr QPalette__ColorRole) *QColor { - return newQColor_U(unsafe.Pointer(C.QPalette_ColorWithCr(this.h, (C.int)(cr)))) + return UnsafeNewQColor(unsafe.Pointer(C.QPalette_ColorWithCr(this.h, (C.int)(cr)))) } func (this *QPalette) BrushWithCr(cr QPalette__ColorRole) *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_BrushWithCr(this.h, (C.int)(cr)))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_BrushWithCr(this.h, (C.int)(cr)))) } func (this *QPalette) WindowText() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_WindowText(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_WindowText(this.h))) } func (this *QPalette) Button() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Button(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Button(this.h))) } func (this *QPalette) Light() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Light(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Light(this.h))) } func (this *QPalette) Dark() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Dark(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Dark(this.h))) } func (this *QPalette) Mid() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Mid(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Mid(this.h))) } func (this *QPalette) Text() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Text(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Text(this.h))) } func (this *QPalette) Base() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Base(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Base(this.h))) } func (this *QPalette) AlternateBase() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_AlternateBase(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_AlternateBase(this.h))) } func (this *QPalette) ToolTipBase() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_ToolTipBase(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_ToolTipBase(this.h))) } func (this *QPalette) ToolTipText() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_ToolTipText(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_ToolTipText(this.h))) } func (this *QPalette) Window() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Window(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Window(this.h))) } func (this *QPalette) Midlight() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Midlight(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Midlight(this.h))) } func (this *QPalette) BrightText() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_BrightText(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_BrightText(this.h))) } func (this *QPalette) ButtonText() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_ButtonText(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_ButtonText(this.h))) } func (this *QPalette) Shadow() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Shadow(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Shadow(this.h))) } func (this *QPalette) Highlight() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Highlight(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Highlight(this.h))) } func (this *QPalette) HighlightedText() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_HighlightedText(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_HighlightedText(this.h))) } func (this *QPalette) Link() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Link(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Link(this.h))) } func (this *QPalette) LinkVisited() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_LinkVisited(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_LinkVisited(this.h))) } func (this *QPalette) PlaceholderText() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_PlaceholderText(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_PlaceholderText(this.h))) } func (this *QPalette) Foreground() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Foreground(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Foreground(this.h))) } func (this *QPalette) Background() *QBrush { - return newQBrush_U(unsafe.Pointer(C.QPalette_Background(this.h))) + return UnsafeNewQBrush(unsafe.Pointer(C.QPalette_Background(this.h))) } func (this *QPalette) OperatorEqual(p *QPalette) bool { diff --git a/qt/gen_qpalette.h b/qt/gen_qpalette.h index 0486308f..307b20f0 100644 --- a/qt/gen_qpalette.h +++ b/qt/gen_qpalette.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qparallelanimationgroup.cpp b/qt/gen_qparallelanimationgroup.cpp index 8360e1b6..21aeed49 100644 --- a/qt/gen_qparallelanimationgroup.cpp +++ b/qt/gen_qparallelanimationgroup.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qparallelanimationgroup.h" +#include #include "gen_qparallelanimationgroup.h" #include "_cgo_export.h" diff --git a/qt/gen_qparallelanimationgroup.go b/qt/gen_qparallelanimationgroup.go index f7470e72..1e01975c 100644 --- a/qt/gen_qparallelanimationgroup.go +++ b/qt/gen_qparallelanimationgroup.go @@ -25,14 +25,21 @@ func (this *QParallelAnimationGroup) cPointer() *C.QParallelAnimationGroup { return this.h } +func (this *QParallelAnimationGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQParallelAnimationGroup(h *C.QParallelAnimationGroup) *QParallelAnimationGroup { if h == nil { return nil } - return &QParallelAnimationGroup{h: h, QAnimationGroup: newQAnimationGroup_U(unsafe.Pointer(h))} + return &QParallelAnimationGroup{h: h, QAnimationGroup: UnsafeNewQAnimationGroup(unsafe.Pointer(h))} } -func newQParallelAnimationGroup_U(h unsafe.Pointer) *QParallelAnimationGroup { +func UnsafeNewQParallelAnimationGroup(h unsafe.Pointer) *QParallelAnimationGroup { return newQParallelAnimationGroup((*C.QParallelAnimationGroup)(h)) } @@ -49,7 +56,7 @@ func NewQParallelAnimationGroup2(parent *QObject) *QParallelAnimationGroup { } func (this *QParallelAnimationGroup) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QParallelAnimationGroup_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QParallelAnimationGroup_MetaObject(this.h))) } func (this *QParallelAnimationGroup) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qparallelanimationgroup.h b/qt/gen_qparallelanimationgroup.h index cee576ec..6490cdf1 100644 --- a/qt/gen_qparallelanimationgroup.h +++ b/qt/gen_qparallelanimationgroup.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpauseanimation.cpp b/qt/gen_qpauseanimation.cpp index 07b0eec4..94e1b66e 100644 --- a/qt/gen_qpauseanimation.cpp +++ b/qt/gen_qpauseanimation.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qpauseanimation.h" +#include #include "gen_qpauseanimation.h" #include "_cgo_export.h" diff --git a/qt/gen_qpauseanimation.go b/qt/gen_qpauseanimation.go index d0b6d8e3..93a2ab05 100644 --- a/qt/gen_qpauseanimation.go +++ b/qt/gen_qpauseanimation.go @@ -25,14 +25,21 @@ func (this *QPauseAnimation) cPointer() *C.QPauseAnimation { return this.h } +func (this *QPauseAnimation) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPauseAnimation(h *C.QPauseAnimation) *QPauseAnimation { if h == nil { return nil } - return &QPauseAnimation{h: h, QAbstractAnimation: newQAbstractAnimation_U(unsafe.Pointer(h))} + return &QPauseAnimation{h: h, QAbstractAnimation: UnsafeNewQAbstractAnimation(unsafe.Pointer(h))} } -func newQPauseAnimation_U(h unsafe.Pointer) *QPauseAnimation { +func UnsafeNewQPauseAnimation(h unsafe.Pointer) *QPauseAnimation { return newQPauseAnimation((*C.QPauseAnimation)(h)) } @@ -61,7 +68,7 @@ func NewQPauseAnimation4(msecs int, parent *QObject) *QPauseAnimation { } func (this *QPauseAnimation) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPauseAnimation_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPauseAnimation_MetaObject(this.h))) } func (this *QPauseAnimation) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qpauseanimation.h b/qt/gen_qpauseanimation.h index 05cf4424..cd1ad0f3 100644 --- a/qt/gen_qpauseanimation.h +++ b/qt/gen_qpauseanimation.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpdfwriter.cpp b/qt/gen_qpdfwriter.cpp index c842c0d9..cd277433 100644 --- a/qt/gen_qpdfwriter.cpp +++ b/qt/gen_qpdfwriter.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qpdfwriter.h" +#include #include "gen_qpdfwriter.h" #include "_cgo_export.h" diff --git a/qt/gen_qpdfwriter.go b/qt/gen_qpdfwriter.go index 1e29c232..41acce34 100644 --- a/qt/gen_qpdfwriter.go +++ b/qt/gen_qpdfwriter.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -26,20 +27,27 @@ func (this *QPdfWriter) cPointer() *C.QPdfWriter { return this.h } +func (this *QPdfWriter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPdfWriter(h *C.QPdfWriter) *QPdfWriter { if h == nil { return nil } - return &QPdfWriter{h: h, QObject: newQObject_U(unsafe.Pointer(h)), QPagedPaintDevice: newQPagedPaintDevice_U(unsafe.Pointer(h))} + return &QPdfWriter{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h)), QPagedPaintDevice: UnsafeNewQPagedPaintDevice(unsafe.Pointer(h))} } -func newQPdfWriter_U(h unsafe.Pointer) *QPdfWriter { +func UnsafeNewQPdfWriter(h unsafe.Pointer) *QPdfWriter { return newQPdfWriter((*C.QPdfWriter)(h)) } // NewQPdfWriter constructs a new QPdfWriter object. func NewQPdfWriter(filename string) *QPdfWriter { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) ret := C.QPdfWriter_new((*C.struct_miqt_string)(filename_ms)) return newQPdfWriter(ret) @@ -52,7 +60,7 @@ func NewQPdfWriter2(device *QIODevice) *QPdfWriter { } func (this *QPdfWriter) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPdfWriter_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPdfWriter_MetaObject(this.h))) } func (this *QPdfWriter) Metacast(param1 string) unsafe.Pointer { @@ -95,7 +103,7 @@ func (this *QPdfWriter) Title() string { } func (this *QPdfWriter) SetTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QPdfWriter_SetTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -108,7 +116,7 @@ func (this *QPdfWriter) Creator() string { } func (this *QPdfWriter) SetCreator(creator string) { - creator_ms := miqt_strdupg(creator) + creator_ms := libmiqt.Strdupg(creator) defer C.free(creator_ms) C.QPdfWriter_SetCreator(this.h, (*C.struct_miqt_string)(creator_ms)) } @@ -137,7 +145,7 @@ func (this *QPdfWriter) DocumentXmpMetadata() *QByteArray { } func (this *QPdfWriter) AddFileAttachment(fileName string, data *QByteArray) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QPdfWriter_AddFileAttachment(this.h, (*C.struct_miqt_string)(fileName_ms), data.cPointer()) } @@ -199,9 +207,9 @@ func QPdfWriter_TrUtf83(s string, c string, n int) string { } func (this *QPdfWriter) AddFileAttachment3(fileName string, data *QByteArray, mimeType string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) - mimeType_ms := miqt_strdupg(mimeType) + mimeType_ms := libmiqt.Strdupg(mimeType) defer C.free(mimeType_ms) C.QPdfWriter_AddFileAttachment3(this.h, (*C.struct_miqt_string)(fileName_ms), data.cPointer(), (*C.struct_miqt_string)(mimeType_ms)) } diff --git a/qt/gen_qpdfwriter.h b/qt/gen_qpdfwriter.h index 90559595..8684dd00 100644 --- a/qt/gen_qpdfwriter.h +++ b/qt/gen_qpdfwriter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpen.cpp b/qt/gen_qpen.cpp index 46c4750c..21abbb97 100644 --- a/qt/gen_qpen.cpp +++ b/qt/gen_qpen.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qpen.h" +#include #include "gen_qpen.h" #include "_cgo_export.h" @@ -69,7 +69,7 @@ struct miqt_array* QPen_DashPattern(const QPen* self) { } void QPen_SetDashPattern(QPen* self, struct miqt_array* /* of double */ pattern) { - QVector pattern_QList; + QVector pattern_QList; pattern_QList.reserve(pattern->len); double* pattern_arr = static_cast(pattern->data); for(size_t i = 0; i < pattern->len; ++i) { diff --git a/qt/gen_qpen.go b/qt/gen_qpen.go index 0e6fa08b..a81be865 100644 --- a/qt/gen_qpen.go +++ b/qt/gen_qpen.go @@ -24,6 +24,13 @@ func (this *QPen) cPointer() *C.QPen { return this.h } +func (this *QPen) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPen(h *C.QPen) *QPen { if h == nil { return nil @@ -31,7 +38,7 @@ func newQPen(h *C.QPen) *QPen { return &QPen{h: h} } -func newQPen_U(h unsafe.Pointer) *QPen { +func UnsafeNewQPen(h unsafe.Pointer) *QPen { return newQPen((*C.QPen)(h)) } diff --git a/qt/gen_qpen.h b/qt/gen_qpen.h index e0af9c40..4d0b6b1d 100644 --- a/qt/gen_qpen.h +++ b/qt/gen_qpen.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpicture.cpp b/qt/gen_qpicture.cpp index d2a060a9..3e818386 100644 --- a/qt/gen_qpicture.cpp +++ b/qt/gen_qpicture.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qpicture.h" +#include #include "gen_qpicture.h" #include "_cgo_export.h" diff --git a/qt/gen_qpicture.go b/qt/gen_qpicture.go index 77c113b5..fa1c73ea 100644 --- a/qt/gen_qpicture.go +++ b/qt/gen_qpicture.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QPicture) cPointer() *C.QPicture { return this.h } +func (this *QPicture) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPicture(h *C.QPicture) *QPicture { if h == nil { return nil } - return &QPicture{h: h, QPaintDevice: newQPaintDevice_U(unsafe.Pointer(h))} + return &QPicture{h: h, QPaintDevice: UnsafeNewQPaintDevice(unsafe.Pointer(h))} } -func newQPicture_U(h unsafe.Pointer) *QPicture { +func UnsafeNewQPicture(h unsafe.Pointer) *QPicture { return newQPicture((*C.QPicture)(h)) } @@ -86,7 +94,7 @@ func (this *QPicture) Load(dev *QIODevice) bool { } func (this *QPicture) LoadWithFileName(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QPicture_LoadWithFileName(this.h, (*C.struct_miqt_string)(fileName_ms))) } @@ -96,7 +104,7 @@ func (this *QPicture) Save(dev *QIODevice) bool { } func (this *QPicture) SaveWithFileName(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QPicture_SaveWithFileName(this.h, (*C.struct_miqt_string)(fileName_ms))) } @@ -129,7 +137,7 @@ func (this *QPicture) IsDetached() bool { } func QPicture_PictureFormat(fileName string) unsafe.Pointer { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QPicture_PictureFormat((*C.struct_miqt_string)(fileName_ms)) return (unsafe.Pointer)(_ret) @@ -192,7 +200,7 @@ func QPicture_OutputFormatList() []string { } func (this *QPicture) PaintEngine() *QPaintEngine { - return newQPaintEngine_U(unsafe.Pointer(C.QPicture_PaintEngine(this.h))) + return UnsafeNewQPaintEngine(unsafe.Pointer(C.QPicture_PaintEngine(this.h))) } func (this *QPicture) Load2(dev *QIODevice, format string) bool { @@ -202,7 +210,7 @@ func (this *QPicture) Load2(dev *QIODevice, format string) bool { } func (this *QPicture) Load22(fileName string, format string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -216,7 +224,7 @@ func (this *QPicture) Save2(dev *QIODevice, format string) bool { } func (this *QPicture) Save22(fileName string, format string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -248,6 +256,13 @@ func (this *QPictureIO) cPointer() *C.QPictureIO { return this.h } +func (this *QPictureIO) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPictureIO(h *C.QPictureIO) *QPictureIO { if h == nil { return nil @@ -255,7 +270,7 @@ func newQPictureIO(h *C.QPictureIO) *QPictureIO { return &QPictureIO{h: h} } -func newQPictureIO_U(h unsafe.Pointer) *QPictureIO { +func UnsafeNewQPictureIO(h unsafe.Pointer) *QPictureIO { return newQPictureIO((*C.QPictureIO)(h)) } @@ -275,7 +290,7 @@ func NewQPictureIO2(ioDevice *QIODevice, format string) *QPictureIO { // NewQPictureIO3 constructs a new QPictureIO object. func NewQPictureIO3(fileName string, format string) *QPictureIO { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -284,7 +299,7 @@ func NewQPictureIO3(fileName string, format string) *QPictureIO { } func (this *QPictureIO) Picture() *QPicture { - return newQPicture_U(unsafe.Pointer(C.QPictureIO_Picture(this.h))) + return UnsafeNewQPicture(unsafe.Pointer(C.QPictureIO_Picture(this.h))) } func (this *QPictureIO) Status() int { @@ -297,7 +312,7 @@ func (this *QPictureIO) Format() unsafe.Pointer { } func (this *QPictureIO) IoDevice() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QPictureIO_IoDevice(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QPictureIO_IoDevice(this.h))) } func (this *QPictureIO) FileName() string { @@ -346,7 +361,7 @@ func (this *QPictureIO) SetIODevice(iODevice *QIODevice) { } func (this *QPictureIO) SetFileName(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QPictureIO_SetFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -356,7 +371,7 @@ func (this *QPictureIO) SetQuality(quality int) { } func (this *QPictureIO) SetDescription(description string) { - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) C.QPictureIO_SetDescription(this.h, (*C.struct_miqt_string)(description_ms)) } @@ -380,7 +395,7 @@ func (this *QPictureIO) Write() bool { } func QPictureIO_PictureFormat(fileName string) *QByteArray { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) _ret := C.QPictureIO_PictureFormat((*C.struct_miqt_string)(fileName_ms)) _goptr := newQByteArray(_ret) diff --git a/qt/gen_qpicture.h b/qt/gen_qpicture.h index 593a7614..f1664f79 100644 --- a/qt/gen_qpicture.h +++ b/qt/gen_qpicture.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpictureformatplugin.cpp b/qt/gen_qpictureformatplugin.cpp index 62b96342..02c48cc1 100644 --- a/qt/gen_qpictureformatplugin.cpp +++ b/qt/gen_qpictureformatplugin.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qpictureformatplugin.h" +#include #include "gen_qpictureformatplugin.h" #include "_cgo_export.h" diff --git a/qt/gen_qpictureformatplugin.go b/qt/gen_qpictureformatplugin.go index d1d8a686..fbaad83b 100644 --- a/qt/gen_qpictureformatplugin.go +++ b/qt/gen_qpictureformatplugin.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,19 +26,26 @@ func (this *QPictureFormatPlugin) cPointer() *C.QPictureFormatPlugin { return this.h } +func (this *QPictureFormatPlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPictureFormatPlugin(h *C.QPictureFormatPlugin) *QPictureFormatPlugin { if h == nil { return nil } - return &QPictureFormatPlugin{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QPictureFormatPlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQPictureFormatPlugin_U(h unsafe.Pointer) *QPictureFormatPlugin { +func UnsafeNewQPictureFormatPlugin(h unsafe.Pointer) *QPictureFormatPlugin { return newQPictureFormatPlugin((*C.QPictureFormatPlugin)(h)) } func (this *QPictureFormatPlugin) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPictureFormatPlugin_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPictureFormatPlugin_MetaObject(this.h))) } func (this *QPictureFormatPlugin) Metacast(param1 string) unsafe.Pointer { @@ -65,23 +73,23 @@ func QPictureFormatPlugin_TrUtf8(s string) string { } func (this *QPictureFormatPlugin) LoadPicture(format string, filename string, pic *QPicture) bool { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) return (bool)(C.QPictureFormatPlugin_LoadPicture(this.h, (*C.struct_miqt_string)(format_ms), (*C.struct_miqt_string)(filename_ms), pic.cPointer())) } func (this *QPictureFormatPlugin) SavePicture(format string, filename string, pic *QPicture) bool { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) return (bool)(C.QPictureFormatPlugin_SavePicture(this.h, (*C.struct_miqt_string)(format_ms), (*C.struct_miqt_string)(filename_ms), pic.cPointer())) } func (this *QPictureFormatPlugin) InstallIOHandler(format string) bool { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) return (bool)(C.QPictureFormatPlugin_InstallIOHandler(this.h, (*C.struct_miqt_string)(format_ms))) } diff --git a/qt/gen_qpictureformatplugin.h b/qt/gen_qpictureformatplugin.h index 7c6f9755..70215040 100644 --- a/qt/gen_qpictureformatplugin.h +++ b/qt/gen_qpictureformatplugin.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpixelformat.cpp b/qt/gen_qpixelformat.cpp index 64e8c9b6..a12eea47 100644 --- a/qt/gen_qpixelformat.cpp +++ b/qt/gen_qpixelformat.cpp @@ -1,5 +1,5 @@ #include -#include "qpixelformat.h" +#include #include "gen_qpixelformat.h" #include "_cgo_export.h" diff --git a/qt/gen_qpixelformat.go b/qt/gen_qpixelformat.go index a75d61cb..1743dfda 100644 --- a/qt/gen_qpixelformat.go +++ b/qt/gen_qpixelformat.go @@ -97,6 +97,13 @@ func (this *QPixelFormat) cPointer() *C.QPixelFormat { return this.h } +func (this *QPixelFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPixelFormat(h *C.QPixelFormat) *QPixelFormat { if h == nil { return nil @@ -104,7 +111,7 @@ func newQPixelFormat(h *C.QPixelFormat) *QPixelFormat { return &QPixelFormat{h: h} } -func newQPixelFormat_U(h unsafe.Pointer) *QPixelFormat { +func UnsafeNewQPixelFormat(h unsafe.Pointer) *QPixelFormat { return newQPixelFormat((*C.QPixelFormat)(h)) } diff --git a/qt/gen_qpixelformat.h b/qt/gen_qpixelformat.h index fe8cfb6a..43d957f2 100644 --- a/qt/gen_qpixelformat.h +++ b/qt/gen_qpixelformat.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpixmap.cpp b/qt/gen_qpixmap.cpp index b02d9092..07c6127b 100644 --- a/qt/gen_qpixmap.cpp +++ b/qt/gen_qpixmap.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "qpixmap.h" +#include #include "gen_qpixmap.h" #include "_cgo_export.h" diff --git a/qt/gen_qpixmap.go b/qt/gen_qpixmap.go index cad087fb..43082bed 100644 --- a/qt/gen_qpixmap.go +++ b/qt/gen_qpixmap.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QPixmap) cPointer() *C.QPixmap { return this.h } +func (this *QPixmap) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPixmap(h *C.QPixmap) *QPixmap { if h == nil { return nil } - return &QPixmap{h: h, QPaintDevice: newQPaintDevice_U(unsafe.Pointer(h))} + return &QPixmap{h: h, QPaintDevice: UnsafeNewQPaintDevice(unsafe.Pointer(h))} } -func newQPixmap_U(h unsafe.Pointer) *QPixmap { +func UnsafeNewQPixmap(h unsafe.Pointer) *QPixmap { return newQPixmap((*C.QPixmap)(h)) } @@ -56,7 +64,7 @@ func NewQPixmap3(param1 *QSize) *QPixmap { // NewQPixmap4 constructs a new QPixmap object. func NewQPixmap4(fileName string) *QPixmap { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QPixmap_new4((*C.struct_miqt_string)(fileName_ms)) return newQPixmap(ret) @@ -70,7 +78,7 @@ func NewQPixmap5(param1 *QPixmap) *QPixmap { // NewQPixmap6 constructs a new QPixmap object. func NewQPixmap6(fileName string, format string) *QPixmap { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -80,7 +88,7 @@ func NewQPixmap6(fileName string, format string) *QPixmap { // NewQPixmap7 constructs a new QPixmap object. func NewQPixmap7(fileName string, format string, flags ImageConversionFlag) *QPixmap { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -286,7 +294,7 @@ func QPixmap_FromImageReader(imageReader *QImageReader) *QPixmap { } func (this *QPixmap) Load(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QPixmap_Load(this.h, (*C.struct_miqt_string)(fileName_ms))) } @@ -300,7 +308,7 @@ func (this *QPixmap) LoadFromDataWithData(data *QByteArray) bool { } func (this *QPixmap) Save(fileName string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) return (bool)(C.QPixmap_Save(this.h, (*C.struct_miqt_string)(fileName_ms))) } @@ -352,7 +360,7 @@ func (this *QPixmap) IsQBitmap() bool { } func (this *QPixmap) PaintEngine() *QPaintEngine { - return newQPaintEngine_U(unsafe.Pointer(C.QPixmap_PaintEngine(this.h))) + return UnsafeNewQPaintEngine(unsafe.Pointer(C.QPixmap_PaintEngine(this.h))) } func (this *QPixmap) OperatorNot() bool { @@ -504,7 +512,7 @@ func QPixmap_FromImageReader2(imageReader *QImageReader, flags ImageConversionFl } func (this *QPixmap) Load2(fileName string, format string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -512,7 +520,7 @@ func (this *QPixmap) Load2(fileName string, format string) bool { } func (this *QPixmap) Load3(fileName string, format string, flags ImageConversionFlag) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -544,7 +552,7 @@ func (this *QPixmap) LoadFromData32(data *QByteArray, format string, flags Image } func (this *QPixmap) Save2(fileName string, format string) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) @@ -552,7 +560,7 @@ func (this *QPixmap) Save2(fileName string, format string) bool { } func (this *QPixmap) Save3(fileName string, format string, quality int) bool { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) format_Cstring := C.CString(format) defer C.free(unsafe.Pointer(format_Cstring)) diff --git a/qt/gen_qpixmap.h b/qt/gen_qpixmap.h index 60d5bb61..874f9fbf 100644 --- a/qt/gen_qpixmap.h +++ b/qt/gen_qpixmap.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpixmapcache.cpp b/qt/gen_qpixmapcache.cpp index 3b8eaa9f..64054d98 100644 --- a/qt/gen_qpixmapcache.cpp +++ b/qt/gen_qpixmapcache.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qpixmapcache.h" +#include #include "gen_qpixmapcache.h" #include "_cgo_export.h" diff --git a/qt/gen_qpixmapcache.go b/qt/gen_qpixmapcache.go index d42425fe..db309d36 100644 --- a/qt/gen_qpixmapcache.go +++ b/qt/gen_qpixmapcache.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QPixmapCache) cPointer() *C.QPixmapCache { return this.h } +func (this *QPixmapCache) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPixmapCache(h *C.QPixmapCache) *QPixmapCache { if h == nil { return nil @@ -31,7 +39,7 @@ func newQPixmapCache(h *C.QPixmapCache) *QPixmapCache { return &QPixmapCache{h: h} } -func newQPixmapCache_U(h unsafe.Pointer) *QPixmapCache { +func UnsafeNewQPixmapCache(h unsafe.Pointer) *QPixmapCache { return newQPixmapCache((*C.QPixmapCache)(h)) } @@ -44,19 +52,19 @@ func QPixmapCache_SetCacheLimit(cacheLimit int) { } func QPixmapCache_Find(key string) *QPixmap { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) - return newQPixmap_U(unsafe.Pointer(C.QPixmapCache_Find((*C.struct_miqt_string)(key_ms)))) + return UnsafeNewQPixmap(unsafe.Pointer(C.QPixmapCache_Find((*C.struct_miqt_string)(key_ms)))) } func QPixmapCache_Find2(key string, pixmap *QPixmap) bool { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) return (bool)(C.QPixmapCache_Find2((*C.struct_miqt_string)(key_ms), pixmap.cPointer())) } func QPixmapCache_Find3(key string, pixmap *QPixmap) bool { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) return (bool)(C.QPixmapCache_Find3((*C.struct_miqt_string)(key_ms), pixmap.cPointer())) } @@ -66,7 +74,7 @@ func QPixmapCache_Find4(key *QPixmapCache__Key, pixmap *QPixmap) bool { } func QPixmapCache_Insert(key string, pixmap *QPixmap) bool { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) return (bool)(C.QPixmapCache_Insert((*C.struct_miqt_string)(key_ms), pixmap.cPointer())) } @@ -83,7 +91,7 @@ func QPixmapCache_Replace(key *QPixmapCache__Key, pixmap *QPixmap) bool { } func QPixmapCache_Remove(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QPixmapCache_Remove((*C.struct_miqt_string)(key_ms)) } @@ -121,6 +129,13 @@ func (this *QPixmapCache__Key) cPointer() *C.QPixmapCache__Key { return this.h } +func (this *QPixmapCache__Key) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPixmapCache__Key(h *C.QPixmapCache__Key) *QPixmapCache__Key { if h == nil { return nil @@ -128,7 +143,7 @@ func newQPixmapCache__Key(h *C.QPixmapCache__Key) *QPixmapCache__Key { return &QPixmapCache__Key{h: h} } -func newQPixmapCache__Key_U(h unsafe.Pointer) *QPixmapCache__Key { +func UnsafeNewQPixmapCache__Key(h unsafe.Pointer) *QPixmapCache__Key { return newQPixmapCache__Key((*C.QPixmapCache__Key)(h)) } diff --git a/qt/gen_qpixmapcache.h b/qt/gen_qpixmapcache.h index 4f303f07..8b9e2e34 100644 --- a/qt/gen_qpixmapcache.h +++ b/qt/gen_qpixmapcache.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qplaintextedit.cpp b/qt/gen_qplaintextedit.cpp index 41eae869..a163c022 100644 --- a/qt/gen_qplaintextedit.cpp +++ b/qt/gen_qplaintextedit.cpp @@ -25,7 +25,7 @@ #include #include #include -#include "qplaintextedit.h" +#include #include "gen_qplaintextedit.h" #include "_cgo_export.h" diff --git a/qt/gen_qplaintextedit.go b/qt/gen_qplaintextedit.go index a74aa104..8f740967 100644 --- a/qt/gen_qplaintextedit.go +++ b/qt/gen_qplaintextedit.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -33,14 +34,21 @@ func (this *QPlainTextEdit) cPointer() *C.QPlainTextEdit { return this.h } +func (this *QPlainTextEdit) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPlainTextEdit(h *C.QPlainTextEdit) *QPlainTextEdit { if h == nil { return nil } - return &QPlainTextEdit{h: h, QAbstractScrollArea: newQAbstractScrollArea_U(unsafe.Pointer(h))} + return &QPlainTextEdit{h: h, QAbstractScrollArea: UnsafeNewQAbstractScrollArea(unsafe.Pointer(h))} } -func newQPlainTextEdit_U(h unsafe.Pointer) *QPlainTextEdit { +func UnsafeNewQPlainTextEdit(h unsafe.Pointer) *QPlainTextEdit { return newQPlainTextEdit((*C.QPlainTextEdit)(h)) } @@ -52,7 +60,7 @@ func NewQPlainTextEdit() *QPlainTextEdit { // NewQPlainTextEdit2 constructs a new QPlainTextEdit object. func NewQPlainTextEdit2(text string) *QPlainTextEdit { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QPlainTextEdit_new2((*C.struct_miqt_string)(text_ms)) return newQPlainTextEdit(ret) @@ -66,14 +74,14 @@ func NewQPlainTextEdit3(parent *QWidget) *QPlainTextEdit { // NewQPlainTextEdit4 constructs a new QPlainTextEdit object. func NewQPlainTextEdit4(text string, parent *QWidget) *QPlainTextEdit { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QPlainTextEdit_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQPlainTextEdit(ret) } func (this *QPlainTextEdit) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPlainTextEdit_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPlainTextEdit_MetaObject(this.h))) } func (this *QPlainTextEdit) Metacast(param1 string) unsafe.Pointer { @@ -105,11 +113,11 @@ func (this *QPlainTextEdit) SetDocument(document *QTextDocument) { } func (this *QPlainTextEdit) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QPlainTextEdit_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QPlainTextEdit_Document(this.h))) } func (this *QPlainTextEdit) SetPlaceholderText(placeholderText string) { - placeholderText_ms := miqt_strdupg(placeholderText) + placeholderText_ms := libmiqt.Strdupg(placeholderText) defer C.free(placeholderText_ms) C.QPlainTextEdit_SetPlaceholderText(this.h, (*C.struct_miqt_string)(placeholderText_ms)) } @@ -172,7 +180,7 @@ func (this *QPlainTextEdit) SetTabChangesFocus(b bool) { } func (this *QPlainTextEdit) SetDocumentTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QPlainTextEdit_SetDocumentTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -233,7 +241,7 @@ func (this *QPlainTextEdit) CenterOnScroll() bool { } func (this *QPlainTextEdit) Find(exp string) bool { - exp_ms := miqt_strdupg(exp) + exp_ms := libmiqt.Strdupg(exp) defer C.free(exp_ms) return (bool)(C.QPlainTextEdit_Find(this.h, (*C.struct_miqt_string)(exp_ms))) } @@ -265,11 +273,11 @@ func (this *QPlainTextEdit) LoadResource(typeVal int, name *QUrl) *QVariant { } func (this *QPlainTextEdit) CreateStandardContextMenu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QPlainTextEdit_CreateStandardContextMenu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QPlainTextEdit_CreateStandardContextMenu(this.h))) } func (this *QPlainTextEdit) CreateStandardContextMenuWithPosition(position *QPoint) *QMenu { - return newQMenu_U(unsafe.Pointer(C.QPlainTextEdit_CreateStandardContextMenuWithPosition(this.h, position.cPointer()))) + return UnsafeNewQMenu(unsafe.Pointer(C.QPlainTextEdit_CreateStandardContextMenuWithPosition(this.h, position.cPointer()))) } func (this *QPlainTextEdit) CursorForPosition(pos *QPoint) *QTextCursor { @@ -389,7 +397,7 @@ func (this *QPlainTextEdit) InputMethodQuery2(query InputMethodQuery, argument Q } func (this *QPlainTextEdit) SetPlainText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPlainTextEdit_SetPlainText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -423,19 +431,19 @@ func (this *QPlainTextEdit) SelectAll() { } func (this *QPlainTextEdit) InsertPlainText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPlainTextEdit_InsertPlainText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QPlainTextEdit) AppendPlainText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QPlainTextEdit_AppendPlainText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QPlainTextEdit) AppendHtml(html string) { - html_ms := miqt_strdupg(html) + html_ms := libmiqt.Strdupg(html) defer C.free(html_ms) C.QPlainTextEdit_AppendHtml(this.h, (*C.struct_miqt_string)(html_ms)) } @@ -578,7 +586,7 @@ func miqt_exec_callback_QPlainTextEdit_UpdateRequest(cb C.intptr_t, rect *C.QRec } // Convert all CABI parameters to Go parameters - slotval1 := newQRect_U(unsafe.Pointer(rect)) + slotval1 := UnsafeNewQRect(unsafe.Pointer(rect)) slotval2 := (int)(dy) gofunc(slotval1, slotval2) @@ -669,7 +677,7 @@ func QPlainTextEdit_TrUtf83(s string, c string, n int) string { } func (this *QPlainTextEdit) Find22(exp string, options QTextDocument__FindFlag) bool { - exp_ms := miqt_strdupg(exp) + exp_ms := libmiqt.Strdupg(exp) defer C.free(exp_ms) return (bool)(C.QPlainTextEdit_Find22(this.h, (*C.struct_miqt_string)(exp_ms), (C.int)(options))) } @@ -720,14 +728,21 @@ func (this *QPlainTextDocumentLayout) cPointer() *C.QPlainTextDocumentLayout { return this.h } +func (this *QPlainTextDocumentLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPlainTextDocumentLayout(h *C.QPlainTextDocumentLayout) *QPlainTextDocumentLayout { if h == nil { return nil } - return &QPlainTextDocumentLayout{h: h, QAbstractTextDocumentLayout: newQAbstractTextDocumentLayout_U(unsafe.Pointer(h))} + return &QPlainTextDocumentLayout{h: h, QAbstractTextDocumentLayout: UnsafeNewQAbstractTextDocumentLayout(unsafe.Pointer(h))} } -func newQPlainTextDocumentLayout_U(h unsafe.Pointer) *QPlainTextDocumentLayout { +func UnsafeNewQPlainTextDocumentLayout(h unsafe.Pointer) *QPlainTextDocumentLayout { return newQPlainTextDocumentLayout((*C.QPlainTextDocumentLayout)(h)) } @@ -738,7 +753,7 @@ func NewQPlainTextDocumentLayout(document *QTextDocument) *QPlainTextDocumentLay } func (this *QPlainTextDocumentLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPlainTextDocumentLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPlainTextDocumentLayout_MetaObject(this.h))) } func (this *QPlainTextDocumentLayout) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qplaintextedit.h b/qt/gen_qplaintextedit.h index 98728046..5612e168 100644 --- a/qt/gen_qplaintextedit.h +++ b/qt/gen_qplaintextedit.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qplugin.cpp b/qt/gen_qplugin.cpp index eb34748a..ccfdc274 100644 --- a/qt/gen_qplugin.cpp +++ b/qt/gen_qplugin.cpp @@ -1,6 +1,6 @@ #include #include -#include "qplugin.h" +#include #include "gen_qplugin.h" #include "_cgo_export.h" diff --git a/qt/gen_qplugin.go b/qt/gen_qplugin.go index abf67eb4..a073a19a 100644 --- a/qt/gen_qplugin.go +++ b/qt/gen_qplugin.go @@ -24,6 +24,13 @@ func (this *QStaticPlugin) cPointer() *C.QStaticPlugin { return this.h } +func (this *QStaticPlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStaticPlugin(h *C.QStaticPlugin) *QStaticPlugin { if h == nil { return nil @@ -31,7 +38,7 @@ func newQStaticPlugin(h *C.QStaticPlugin) *QStaticPlugin { return &QStaticPlugin{h: h} } -func newQStaticPlugin_U(h unsafe.Pointer) *QStaticPlugin { +func UnsafeNewQStaticPlugin(h unsafe.Pointer) *QStaticPlugin { return newQStaticPlugin((*C.QStaticPlugin)(h)) } diff --git a/qt/gen_qplugin.h b/qt/gen_qplugin.h index 89cbf38e..2e552521 100644 --- a/qt/gen_qplugin.h +++ b/qt/gen_qplugin.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpluginloader.cpp b/qt/gen_qpluginloader.cpp index b1a438a6..01df2667 100644 --- a/qt/gen_qpluginloader.cpp +++ b/qt/gen_qpluginloader.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qpluginloader.h" +#include #include "gen_qpluginloader.h" #include "_cgo_export.h" diff --git a/qt/gen_qpluginloader.go b/qt/gen_qpluginloader.go index 409e3714..c576fc56 100644 --- a/qt/gen_qpluginloader.go +++ b/qt/gen_qpluginloader.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QPluginLoader) cPointer() *C.QPluginLoader { return this.h } +func (this *QPluginLoader) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPluginLoader(h *C.QPluginLoader) *QPluginLoader { if h == nil { return nil } - return &QPluginLoader{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QPluginLoader{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQPluginLoader_U(h unsafe.Pointer) *QPluginLoader { +func UnsafeNewQPluginLoader(h unsafe.Pointer) *QPluginLoader { return newQPluginLoader((*C.QPluginLoader)(h)) } @@ -44,7 +52,7 @@ func NewQPluginLoader() *QPluginLoader { // NewQPluginLoader2 constructs a new QPluginLoader object. func NewQPluginLoader2(fileName string) *QPluginLoader { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QPluginLoader_new2((*C.struct_miqt_string)(fileName_ms)) return newQPluginLoader(ret) @@ -58,14 +66,14 @@ func NewQPluginLoader3(parent *QObject) *QPluginLoader { // NewQPluginLoader4 constructs a new QPluginLoader object. func NewQPluginLoader4(fileName string, parent *QObject) *QPluginLoader { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QPluginLoader_new4((*C.struct_miqt_string)(fileName_ms), parent.cPointer()) return newQPluginLoader(ret) } func (this *QPluginLoader) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPluginLoader_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPluginLoader_MetaObject(this.h))) } func (this *QPluginLoader) Metacast(param1 string) unsafe.Pointer { @@ -93,7 +101,7 @@ func QPluginLoader_TrUtf8(s string) string { } func (this *QPluginLoader) Instance() *QObject { - return newQObject_U(unsafe.Pointer(C.QPluginLoader_Instance(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QPluginLoader_Instance(this.h))) } func (this *QPluginLoader) MetaData() *QJsonObject { @@ -108,7 +116,7 @@ func QPluginLoader_StaticInstances() []*QObject { _ret := make([]*QObject, int(_ma.len)) _outCast := (*[0xffff]*C.QObject)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQObject_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQObject(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -141,7 +149,7 @@ func (this *QPluginLoader) IsLoaded() bool { } func (this *QPluginLoader) SetFileName(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QPluginLoader_SetFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) } diff --git a/qt/gen_qpluginloader.h b/qt/gen_qpluginloader.h index 4b8e3fc2..c5613fbc 100644 --- a/qt/gen_qpluginloader.h +++ b/qt/gen_qpluginloader.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpoint.cpp b/qt/gen_qpoint.cpp index 3ceaab50..3f8e65c2 100644 --- a/qt/gen_qpoint.cpp +++ b/qt/gen_qpoint.cpp @@ -1,6 +1,6 @@ #include #include -#include "qpoint.h" +#include #include "gen_qpoint.h" #include "_cgo_export.h" diff --git a/qt/gen_qpoint.go b/qt/gen_qpoint.go index 5696edfc..a1626797 100644 --- a/qt/gen_qpoint.go +++ b/qt/gen_qpoint.go @@ -24,6 +24,13 @@ func (this *QPoint) cPointer() *C.QPoint { return this.h } +func (this *QPoint) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPoint(h *C.QPoint) *QPoint { if h == nil { return nil @@ -31,7 +38,7 @@ func newQPoint(h *C.QPoint) *QPoint { return &QPoint{h: h} } -func newQPoint_U(h unsafe.Pointer) *QPoint { +func UnsafeNewQPoint(h unsafe.Pointer) *QPoint { return newQPoint((*C.QPoint)(h)) } @@ -85,27 +92,27 @@ func (this *QPoint) Transposed() *QPoint { } func (this *QPoint) OperatorPlusAssign(p *QPoint) *QPoint { - return newQPoint_U(unsafe.Pointer(C.QPoint_OperatorPlusAssign(this.h, p.cPointer()))) + return UnsafeNewQPoint(unsafe.Pointer(C.QPoint_OperatorPlusAssign(this.h, p.cPointer()))) } func (this *QPoint) OperatorMinusAssign(p *QPoint) *QPoint { - return newQPoint_U(unsafe.Pointer(C.QPoint_OperatorMinusAssign(this.h, p.cPointer()))) + return UnsafeNewQPoint(unsafe.Pointer(C.QPoint_OperatorMinusAssign(this.h, p.cPointer()))) } func (this *QPoint) OperatorMultiplyAssign(factor float32) *QPoint { - return newQPoint_U(unsafe.Pointer(C.QPoint_OperatorMultiplyAssign(this.h, (C.float)(factor)))) + return UnsafeNewQPoint(unsafe.Pointer(C.QPoint_OperatorMultiplyAssign(this.h, (C.float)(factor)))) } func (this *QPoint) OperatorMultiplyAssignWithFactor(factor float64) *QPoint { - return newQPoint_U(unsafe.Pointer(C.QPoint_OperatorMultiplyAssignWithFactor(this.h, (C.double)(factor)))) + return UnsafeNewQPoint(unsafe.Pointer(C.QPoint_OperatorMultiplyAssignWithFactor(this.h, (C.double)(factor)))) } func (this *QPoint) OperatorMultiplyAssign2(factor int) *QPoint { - return newQPoint_U(unsafe.Pointer(C.QPoint_OperatorMultiplyAssign2(this.h, (C.int)(factor)))) + return UnsafeNewQPoint(unsafe.Pointer(C.QPoint_OperatorMultiplyAssign2(this.h, (C.int)(factor)))) } func (this *QPoint) OperatorDivideAssign(divisor float64) *QPoint { - return newQPoint_U(unsafe.Pointer(C.QPoint_OperatorDivideAssign(this.h, (C.double)(divisor)))) + return UnsafeNewQPoint(unsafe.Pointer(C.QPoint_OperatorDivideAssign(this.h, (C.double)(divisor)))) } func QPoint_DotProduct(p1 *QPoint, p2 *QPoint) int { @@ -137,6 +144,13 @@ func (this *QPointF) cPointer() *C.QPointF { return this.h } +func (this *QPointF) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPointF(h *C.QPointF) *QPointF { if h == nil { return nil @@ -144,7 +158,7 @@ func newQPointF(h *C.QPointF) *QPointF { return &QPointF{h: h} } -func newQPointF_U(h unsafe.Pointer) *QPointF { +func UnsafeNewQPointF(h unsafe.Pointer) *QPointF { return newQPointF((*C.QPointF)(h)) } @@ -204,19 +218,19 @@ func (this *QPointF) Transposed() *QPointF { } func (this *QPointF) OperatorPlusAssign(p *QPointF) *QPointF { - return newQPointF_U(unsafe.Pointer(C.QPointF_OperatorPlusAssign(this.h, p.cPointer()))) + return UnsafeNewQPointF(unsafe.Pointer(C.QPointF_OperatorPlusAssign(this.h, p.cPointer()))) } func (this *QPointF) OperatorMinusAssign(p *QPointF) *QPointF { - return newQPointF_U(unsafe.Pointer(C.QPointF_OperatorMinusAssign(this.h, p.cPointer()))) + return UnsafeNewQPointF(unsafe.Pointer(C.QPointF_OperatorMinusAssign(this.h, p.cPointer()))) } func (this *QPointF) OperatorMultiplyAssign(c float64) *QPointF { - return newQPointF_U(unsafe.Pointer(C.QPointF_OperatorMultiplyAssign(this.h, (C.double)(c)))) + return UnsafeNewQPointF(unsafe.Pointer(C.QPointF_OperatorMultiplyAssign(this.h, (C.double)(c)))) } func (this *QPointF) OperatorDivideAssign(c float64) *QPointF { - return newQPointF_U(unsafe.Pointer(C.QPointF_OperatorDivideAssign(this.h, (C.double)(c)))) + return UnsafeNewQPointF(unsafe.Pointer(C.QPointF_OperatorDivideAssign(this.h, (C.double)(c)))) } func QPointF_DotProduct(p1 *QPointF, p2 *QPointF) float64 { diff --git a/qt/gen_qpoint.h b/qt/gen_qpoint.h index 80e140ba..cd3a378e 100644 --- a/qt/gen_qpoint.h +++ b/qt/gen_qpoint.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qprocess.cpp b/qt/gen_qprocess.cpp index 6a925f1f..fd580c63 100644 --- a/qt/gen_qprocess.cpp +++ b/qt/gen_qprocess.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qprocess.h" +#include #include "gen_qprocess.h" #include "_cgo_export.h" @@ -152,7 +152,7 @@ struct miqt_string* QProcess_TrUtf8(const char* s) { void QProcess_Start(QProcess* self, struct miqt_string* program, struct miqt_array* /* of struct miqt_string* */ arguments) { QString program_QString = QString::fromUtf8(&program->data, program->len); - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { @@ -208,7 +208,7 @@ struct miqt_array* QProcess_Arguments(const QProcess* self) { } void QProcess_SetArguments(QProcess* self, struct miqt_array* /* of struct miqt_string* */ arguments) { - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { @@ -294,7 +294,7 @@ void QProcess_SetWorkingDirectory(QProcess* self, struct miqt_string* dir) { } void QProcess_SetEnvironment(QProcess* self, struct miqt_array* /* of struct miqt_string* */ environment) { - QList environment_QList; + QStringList environment_QList; environment_QList.reserve(environment->len); struct miqt_string** environment_arr = static_cast(environment->data); for(size_t i = 0; i < environment->len; ++i) { @@ -414,7 +414,7 @@ bool QProcess_AtEnd(const QProcess* self) { int QProcess_Execute(struct miqt_string* program, struct miqt_array* /* of struct miqt_string* */ arguments) { QString program_QString = QString::fromUtf8(&program->data, program->len); - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { @@ -431,7 +431,7 @@ int QProcess_ExecuteWithCommand(struct miqt_string* command) { bool QProcess_StartDetached2(struct miqt_string* program, struct miqt_array* /* of struct miqt_string* */ arguments, struct miqt_string* workingDirectory) { QString program_QString = QString::fromUtf8(&program->data, program->len); - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { @@ -444,7 +444,7 @@ bool QProcess_StartDetached2(struct miqt_string* program, struct miqt_array* /* bool QProcess_StartDetached3(struct miqt_string* program, struct miqt_array* /* of struct miqt_string* */ arguments) { QString program_QString = QString::fromUtf8(&program->data, program->len); - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { @@ -568,7 +568,7 @@ struct miqt_string* QProcess_TrUtf83(const char* s, const char* c, int n) { void QProcess_Start3(QProcess* self, struct miqt_string* program, struct miqt_array* /* of struct miqt_string* */ arguments, int mode) { QString program_QString = QString::fromUtf8(&program->data, program->len); - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { @@ -623,7 +623,7 @@ bool QProcess_WaitForFinished1(QProcess* self, int msecs) { bool QProcess_StartDetached4(struct miqt_string* program, struct miqt_array* /* of struct miqt_string* */ arguments, struct miqt_string* workingDirectory, long long* pid) { QString program_QString = QString::fromUtf8(&program->data, program->len); - QList arguments_QList; + QStringList arguments_QList; arguments_QList.reserve(arguments->len); struct miqt_string** arguments_arr = static_cast(arguments->data); for(size_t i = 0; i < arguments->len; ++i) { diff --git a/qt/gen_qprocess.go b/qt/gen_qprocess.go index 40c0fae9..651ffce2 100644 --- a/qt/gen_qprocess.go +++ b/qt/gen_qprocess.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -75,6 +76,13 @@ func (this *QProcessEnvironment) cPointer() *C.QProcessEnvironment { return this.h } +func (this *QProcessEnvironment) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQProcessEnvironment(h *C.QProcessEnvironment) *QProcessEnvironment { if h == nil { return nil @@ -82,7 +90,7 @@ func newQProcessEnvironment(h *C.QProcessEnvironment) *QProcessEnvironment { return &QProcessEnvironment{h: h} } -func newQProcessEnvironment_U(h unsafe.Pointer) *QProcessEnvironment { +func UnsafeNewQProcessEnvironment(h unsafe.Pointer) *QProcessEnvironment { return newQProcessEnvironment((*C.QProcessEnvironment)(h)) } @@ -123,27 +131,27 @@ func (this *QProcessEnvironment) Clear() { } func (this *QProcessEnvironment) Contains(name string) bool { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (bool)(C.QProcessEnvironment_Contains(this.h, (*C.struct_miqt_string)(name_ms))) } func (this *QProcessEnvironment) Insert(name string, value string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) C.QProcessEnvironment_Insert(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(value_ms)) } func (this *QProcessEnvironment) Remove(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QProcessEnvironment_Remove(this.h, (*C.struct_miqt_string)(name_ms)) } func (this *QProcessEnvironment) Value(name string) string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) var _ms *C.struct_miqt_string = C.QProcessEnvironment_Value(this.h, (*C.struct_miqt_string)(name_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -191,9 +199,9 @@ func QProcessEnvironment_SystemEnvironment() *QProcessEnvironment { } func (this *QProcessEnvironment) Value2(name string, defaultValue string) string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - defaultValue_ms := miqt_strdupg(defaultValue) + defaultValue_ms := libmiqt.Strdupg(defaultValue) defer C.free(defaultValue_ms) var _ms *C.struct_miqt_string = C.QProcessEnvironment_Value2(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(defaultValue_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -227,14 +235,21 @@ func (this *QProcess) cPointer() *C.QProcess { return this.h } +func (this *QProcess) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQProcess(h *C.QProcess) *QProcess { if h == nil { return nil } - return &QProcess{h: h, QIODevice: newQIODevice_U(unsafe.Pointer(h))} + return &QProcess{h: h, QIODevice: UnsafeNewQIODevice(unsafe.Pointer(h))} } -func newQProcess_U(h unsafe.Pointer) *QProcess { +func UnsafeNewQProcess(h unsafe.Pointer) *QProcess { return newQProcess((*C.QProcess)(h)) } @@ -251,7 +266,7 @@ func NewQProcess2(parent *QObject) *QProcess { } func (this *QProcess) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QProcess_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QProcess_MetaObject(this.h))) } func (this *QProcess) Metacast(param1 string) unsafe.Pointer { @@ -279,13 +294,13 @@ func QProcess_TrUtf8(s string) string { } func (this *QProcess) Start(program string, arguments []string) { - program_ms := miqt_strdupg(program) + program_ms := libmiqt.Strdupg(program) defer C.free(program_ms) // For the C ABI, malloc a C array of raw pointers arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } @@ -295,7 +310,7 @@ func (this *QProcess) Start(program string, arguments []string) { } func (this *QProcess) StartWithCommand(command string) { - command_ms := miqt_strdupg(command) + command_ms := libmiqt.Strdupg(command) defer C.free(command_ms) C.QProcess_StartWithCommand(this.h, (*C.struct_miqt_string)(command_ms)) } @@ -320,7 +335,7 @@ func (this *QProcess) Program() string { } func (this *QProcess) SetProgram(program string) { - program_ms := miqt_strdupg(program) + program_ms := libmiqt.Strdupg(program) defer C.free(program_ms) C.QProcess_SetProgram(this.h, (*C.struct_miqt_string)(program_ms)) } @@ -344,7 +359,7 @@ func (this *QProcess) SetArguments(arguments []string) { arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } @@ -394,19 +409,19 @@ func (this *QProcess) CloseWriteChannel() { } func (this *QProcess) SetStandardInputFile(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QProcess_SetStandardInputFile(this.h, (*C.struct_miqt_string)(fileName_ms)) } func (this *QProcess) SetStandardOutputFile(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QProcess_SetStandardOutputFile(this.h, (*C.struct_miqt_string)(fileName_ms)) } func (this *QProcess) SetStandardErrorFile(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QProcess_SetStandardErrorFile(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -423,7 +438,7 @@ func (this *QProcess) WorkingDirectory() string { } func (this *QProcess) SetWorkingDirectory(dir string) { - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) C.QProcess_SetWorkingDirectory(this.h, (*C.struct_miqt_string)(dir_ms)) } @@ -433,7 +448,7 @@ func (this *QProcess) SetEnvironment(environment []string) { environment_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(environment)))) defer C.free(unsafe.Pointer(environment_CArray)) for i := range environment { - environment_i_ms := miqt_strdupg(environment[i]) + environment_i_ms := libmiqt.Strdupg(environment[i]) defer C.free(environment_i_ms) environment_CArray[i] = (*C.struct_miqt_string)(environment_i_ms) } @@ -550,13 +565,13 @@ func (this *QProcess) AtEnd() bool { } func QProcess_Execute(program string, arguments []string) int { - program_ms := miqt_strdupg(program) + program_ms := libmiqt.Strdupg(program) defer C.free(program_ms) // For the C ABI, malloc a C array of raw pointers arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } @@ -566,37 +581,37 @@ func QProcess_Execute(program string, arguments []string) int { } func QProcess_ExecuteWithCommand(command string) int { - command_ms := miqt_strdupg(command) + command_ms := libmiqt.Strdupg(command) defer C.free(command_ms) return (int)(C.QProcess_ExecuteWithCommand((*C.struct_miqt_string)(command_ms))) } func QProcess_StartDetached2(program string, arguments []string, workingDirectory string) bool { - program_ms := miqt_strdupg(program) + program_ms := libmiqt.Strdupg(program) defer C.free(program_ms) // For the C ABI, malloc a C array of raw pointers arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } arguments_ma := &C.struct_miqt_array{len: C.size_t(len(arguments)), data: unsafe.Pointer(arguments_CArray)} defer runtime.KeepAlive(unsafe.Pointer(arguments_ma)) - workingDirectory_ms := miqt_strdupg(workingDirectory) + workingDirectory_ms := libmiqt.Strdupg(workingDirectory) defer C.free(workingDirectory_ms) return (bool)(C.QProcess_StartDetached2((*C.struct_miqt_string)(program_ms), arguments_ma, (*C.struct_miqt_string)(workingDirectory_ms))) } func QProcess_StartDetached3(program string, arguments []string) bool { - program_ms := miqt_strdupg(program) + program_ms := libmiqt.Strdupg(program) defer C.free(program_ms) // For the C ABI, malloc a C array of raw pointers arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } @@ -606,7 +621,7 @@ func QProcess_StartDetached3(program string, arguments []string) bool { } func QProcess_StartDetachedWithCommand(command string) bool { - command_ms := miqt_strdupg(command) + command_ms := libmiqt.Strdupg(command) defer C.free(command_ms) return (bool)(C.QProcess_StartDetachedWithCommand((*C.struct_miqt_string)(command_ms))) } @@ -767,13 +782,13 @@ func QProcess_TrUtf83(s string, c string, n int) string { } func (this *QProcess) Start3(program string, arguments []string, mode QIODevice__OpenModeFlag) { - program_ms := miqt_strdupg(program) + program_ms := libmiqt.Strdupg(program) defer C.free(program_ms) // For the C ABI, malloc a C array of raw pointers arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } @@ -783,7 +798,7 @@ func (this *QProcess) Start3(program string, arguments []string, mode QIODevice_ } func (this *QProcess) Start22(command string, mode QIODevice__OpenModeFlag) { - command_ms := miqt_strdupg(command) + command_ms := libmiqt.Strdupg(command) defer C.free(command_ms) C.QProcess_Start22(this.h, (*C.struct_miqt_string)(command_ms), (C.int)(mode)) } @@ -801,13 +816,13 @@ func (this *QProcess) Open1(mode QIODevice__OpenModeFlag) bool { } func (this *QProcess) SetStandardOutputFile2(fileName string, mode QIODevice__OpenModeFlag) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QProcess_SetStandardOutputFile2(this.h, (*C.struct_miqt_string)(fileName_ms), (C.int)(mode)) } func (this *QProcess) SetStandardErrorFile2(fileName string, mode QIODevice__OpenModeFlag) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QProcess_SetStandardErrorFile2(this.h, (*C.struct_miqt_string)(fileName_ms), (C.int)(mode)) } @@ -829,19 +844,19 @@ func (this *QProcess) WaitForFinished1(msecs int) bool { } func QProcess_StartDetached4(program string, arguments []string, workingDirectory string, pid *int64) bool { - program_ms := miqt_strdupg(program) + program_ms := libmiqt.Strdupg(program) defer C.free(program_ms) // For the C ABI, malloc a C array of raw pointers arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments)))) defer C.free(unsafe.Pointer(arguments_CArray)) for i := range arguments { - arguments_i_ms := miqt_strdupg(arguments[i]) + arguments_i_ms := libmiqt.Strdupg(arguments[i]) defer C.free(arguments_i_ms) arguments_CArray[i] = (*C.struct_miqt_string)(arguments_i_ms) } arguments_ma := &C.struct_miqt_array{len: C.size_t(len(arguments)), data: unsafe.Pointer(arguments_CArray)} defer runtime.KeepAlive(unsafe.Pointer(arguments_ma)) - workingDirectory_ms := miqt_strdupg(workingDirectory) + workingDirectory_ms := libmiqt.Strdupg(workingDirectory) defer C.free(workingDirectory_ms) return (bool)(C.QProcess_StartDetached4((*C.struct_miqt_string)(program_ms), arguments_ma, (*C.struct_miqt_string)(workingDirectory_ms), (*C.longlong)(unsafe.Pointer(pid)))) } diff --git a/qt/gen_qprocess.h b/qt/gen_qprocess.h index 2e589218..960f4583 100644 --- a/qt/gen_qprocess.h +++ b/qt/gen_qprocess.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qprogressbar.cpp b/qt/gen_qprogressbar.cpp index d936619a..ad400d4d 100644 --- a/qt/gen_qprogressbar.cpp +++ b/qt/gen_qprogressbar.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qprogressbar.h" +#include #include "gen_qprogressbar.h" #include "_cgo_export.h" diff --git a/qt/gen_qprogressbar.go b/qt/gen_qprogressbar.go index 2069ef8a..b69a300c 100644 --- a/qt/gen_qprogressbar.go +++ b/qt/gen_qprogressbar.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -33,14 +34,21 @@ func (this *QProgressBar) cPointer() *C.QProgressBar { return this.h } +func (this *QProgressBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQProgressBar(h *C.QProgressBar) *QProgressBar { if h == nil { return nil } - return &QProgressBar{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QProgressBar{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQProgressBar_U(h unsafe.Pointer) *QProgressBar { +func UnsafeNewQProgressBar(h unsafe.Pointer) *QProgressBar { return newQProgressBar((*C.QProgressBar)(h)) } @@ -57,7 +65,7 @@ func NewQProgressBar2(parent *QWidget) *QProgressBar { } func (this *QProgressBar) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QProgressBar_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QProgressBar_MetaObject(this.h))) } func (this *QProgressBar) Metacast(param1 string) unsafe.Pointer { @@ -154,7 +162,7 @@ func (this *QProgressBar) TextDirection() QProgressBar__Direction { } func (this *QProgressBar) SetFormat(format string) { - format_ms := miqt_strdupg(format) + format_ms := libmiqt.Strdupg(format) defer C.free(format_ms) C.QProgressBar_SetFormat(this.h, (*C.struct_miqt_string)(format_ms)) } diff --git a/qt/gen_qprogressbar.h b/qt/gen_qprogressbar.h index a7ed01d7..a450f25d 100644 --- a/qt/gen_qprogressbar.h +++ b/qt/gen_qprogressbar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qprogressdialog.cpp b/qt/gen_qprogressdialog.cpp index e4b9d1f0..4f4cd245 100644 --- a/qt/gen_qprogressdialog.cpp +++ b/qt/gen_qprogressdialog.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qprogressdialog.h" +#include #include "gen_qprogressdialog.h" #include "_cgo_export.h" diff --git a/qt/gen_qprogressdialog.go b/qt/gen_qprogressdialog.go index 9b8598c9..1fdc049a 100644 --- a/qt/gen_qprogressdialog.go +++ b/qt/gen_qprogressdialog.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QProgressDialog) cPointer() *C.QProgressDialog { return this.h } +func (this *QProgressDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQProgressDialog(h *C.QProgressDialog) *QProgressDialog { if h == nil { return nil } - return &QProgressDialog{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QProgressDialog{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQProgressDialog_U(h unsafe.Pointer) *QProgressDialog { +func UnsafeNewQProgressDialog(h unsafe.Pointer) *QProgressDialog { return newQProgressDialog((*C.QProgressDialog)(h)) } @@ -45,9 +53,9 @@ func NewQProgressDialog() *QProgressDialog { // NewQProgressDialog2 constructs a new QProgressDialog object. func NewQProgressDialog2(labelText string, cancelButtonText string, minimum int, maximum int) *QProgressDialog { - labelText_ms := miqt_strdupg(labelText) + labelText_ms := libmiqt.Strdupg(labelText) defer C.free(labelText_ms) - cancelButtonText_ms := miqt_strdupg(cancelButtonText) + cancelButtonText_ms := libmiqt.Strdupg(cancelButtonText) defer C.free(cancelButtonText_ms) ret := C.QProgressDialog_new2((*C.struct_miqt_string)(labelText_ms), (*C.struct_miqt_string)(cancelButtonText_ms), (C.int)(minimum), (C.int)(maximum)) return newQProgressDialog(ret) @@ -67,9 +75,9 @@ func NewQProgressDialog4(parent *QWidget, flags WindowType) *QProgressDialog { // NewQProgressDialog5 constructs a new QProgressDialog object. func NewQProgressDialog5(labelText string, cancelButtonText string, minimum int, maximum int, parent *QWidget) *QProgressDialog { - labelText_ms := miqt_strdupg(labelText) + labelText_ms := libmiqt.Strdupg(labelText) defer C.free(labelText_ms) - cancelButtonText_ms := miqt_strdupg(cancelButtonText) + cancelButtonText_ms := libmiqt.Strdupg(cancelButtonText) defer C.free(cancelButtonText_ms) ret := C.QProgressDialog_new5((*C.struct_miqt_string)(labelText_ms), (*C.struct_miqt_string)(cancelButtonText_ms), (C.int)(minimum), (C.int)(maximum), parent.cPointer()) return newQProgressDialog(ret) @@ -77,16 +85,16 @@ func NewQProgressDialog5(labelText string, cancelButtonText string, minimum int, // NewQProgressDialog6 constructs a new QProgressDialog object. func NewQProgressDialog6(labelText string, cancelButtonText string, minimum int, maximum int, parent *QWidget, flags WindowType) *QProgressDialog { - labelText_ms := miqt_strdupg(labelText) + labelText_ms := libmiqt.Strdupg(labelText) defer C.free(labelText_ms) - cancelButtonText_ms := miqt_strdupg(cancelButtonText) + cancelButtonText_ms := libmiqt.Strdupg(cancelButtonText) defer C.free(cancelButtonText_ms) ret := C.QProgressDialog_new6((*C.struct_miqt_string)(labelText_ms), (*C.struct_miqt_string)(cancelButtonText_ms), (C.int)(minimum), (C.int)(maximum), parent.cPointer(), (C.int)(flags)) return newQProgressDialog(ret) } func (this *QProgressDialog) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QProgressDialog_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QProgressDialog_MetaObject(this.h))) } func (this *QProgressDialog) Metacast(param1 string) unsafe.Pointer { @@ -200,13 +208,13 @@ func (this *QProgressDialog) SetValue(progress int) { } func (this *QProgressDialog) SetLabelText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QProgressDialog_SetLabelText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QProgressDialog) SetCancelButtonText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QProgressDialog_SetCancelButtonText(this.h, (*C.struct_miqt_string)(text_ms)) } diff --git a/qt/gen_qprogressdialog.h b/qt/gen_qprogressdialog.h index 2010f0ec..77894b8c 100644 --- a/qt/gen_qprogressdialog.h +++ b/qt/gen_qprogressdialog.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpropertyanimation.cpp b/qt/gen_qpropertyanimation.cpp index 49a78250..68cf2a66 100644 --- a/qt/gen_qpropertyanimation.cpp +++ b/qt/gen_qpropertyanimation.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qpropertyanimation.h" +#include #include "gen_qpropertyanimation.h" #include "_cgo_export.h" diff --git a/qt/gen_qpropertyanimation.go b/qt/gen_qpropertyanimation.go index 03fc7db6..404b5ac8 100644 --- a/qt/gen_qpropertyanimation.go +++ b/qt/gen_qpropertyanimation.go @@ -25,14 +25,21 @@ func (this *QPropertyAnimation) cPointer() *C.QPropertyAnimation { return this.h } +func (this *QPropertyAnimation) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPropertyAnimation(h *C.QPropertyAnimation) *QPropertyAnimation { if h == nil { return nil } - return &QPropertyAnimation{h: h, QVariantAnimation: newQVariantAnimation_U(unsafe.Pointer(h))} + return &QPropertyAnimation{h: h, QVariantAnimation: UnsafeNewQVariantAnimation(unsafe.Pointer(h))} } -func newQPropertyAnimation_U(h unsafe.Pointer) *QPropertyAnimation { +func UnsafeNewQPropertyAnimation(h unsafe.Pointer) *QPropertyAnimation { return newQPropertyAnimation((*C.QPropertyAnimation)(h)) } @@ -61,7 +68,7 @@ func NewQPropertyAnimation4(target *QObject, propertyName *QByteArray, parent *Q } func (this *QPropertyAnimation) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPropertyAnimation_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPropertyAnimation_MetaObject(this.h))) } func (this *QPropertyAnimation) Metacast(param1 string) unsafe.Pointer { @@ -89,7 +96,7 @@ func QPropertyAnimation_TrUtf8(s string) string { } func (this *QPropertyAnimation) TargetObject() *QObject { - return newQObject_U(unsafe.Pointer(C.QPropertyAnimation_TargetObject(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QPropertyAnimation_TargetObject(this.h))) } func (this *QPropertyAnimation) SetTargetObject(target *QObject) { diff --git a/qt/gen_qpropertyanimation.h b/qt/gen_qpropertyanimation.h index c4d1aed8..edb99eb9 100644 --- a/qt/gen_qpropertyanimation.h +++ b/qt/gen_qpropertyanimation.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qproxystyle.cpp b/qt/gen_qproxystyle.cpp index 04036505..e3dd9772 100644 --- a/qt/gen_qproxystyle.cpp +++ b/qt/gen_qproxystyle.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "qproxystyle.h" +#include #include "gen_qproxystyle.h" #include "_cgo_export.h" diff --git a/qt/gen_qproxystyle.go b/qt/gen_qproxystyle.go index 3c345a1a..dd18bcde 100644 --- a/qt/gen_qproxystyle.go +++ b/qt/gen_qproxystyle.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QProxyStyle) cPointer() *C.QProxyStyle { return this.h } +func (this *QProxyStyle) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQProxyStyle(h *C.QProxyStyle) *QProxyStyle { if h == nil { return nil } - return &QProxyStyle{h: h, QCommonStyle: newQCommonStyle_U(unsafe.Pointer(h))} + return &QProxyStyle{h: h, QCommonStyle: UnsafeNewQCommonStyle(unsafe.Pointer(h))} } -func newQProxyStyle_U(h unsafe.Pointer) *QProxyStyle { +func UnsafeNewQProxyStyle(h unsafe.Pointer) *QProxyStyle { return newQProxyStyle((*C.QProxyStyle)(h)) } @@ -44,7 +52,7 @@ func NewQProxyStyle() *QProxyStyle { // NewQProxyStyle2 constructs a new QProxyStyle object. func NewQProxyStyle2(key string) *QProxyStyle { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QProxyStyle_new2((*C.struct_miqt_string)(key_ms)) return newQProxyStyle(ret) @@ -57,7 +65,7 @@ func NewQProxyStyle3(style *QStyle) *QProxyStyle { } func (this *QProxyStyle) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QProxyStyle_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QProxyStyle_MetaObject(this.h))) } func (this *QProxyStyle) Metacast(param1 string) unsafe.Pointer { @@ -85,7 +93,7 @@ func QProxyStyle_TrUtf8(s string) string { } func (this *QProxyStyle) BaseStyle() *QStyle { - return newQStyle_U(unsafe.Pointer(C.QProxyStyle_BaseStyle(this.h))) + return UnsafeNewQStyle(unsafe.Pointer(C.QProxyStyle_BaseStyle(this.h))) } func (this *QProxyStyle) SetBaseStyle(style *QStyle) { @@ -105,7 +113,7 @@ func (this *QProxyStyle) DrawComplexControl(control QStyle__ComplexControl, opti } func (this *QProxyStyle) DrawItemText(painter *QPainter, rect *QRect, flags int, pal *QPalette, enabled bool, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QProxyStyle_DrawItemText(this.h, painter.cPointer(), rect.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms)) } @@ -136,7 +144,7 @@ func (this *QProxyStyle) SubControlRect(cc QStyle__ComplexControl, opt *QStyleOp } func (this *QProxyStyle) ItemTextRect(fm *QFontMetrics, r *QRect, flags int, enabled bool, text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QProxyStyle_ItemTextRect(this.h, fm.cPointer(), r.cPointer(), (C.int)(flags), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -272,7 +280,7 @@ func (this *QProxyStyle) DrawComplexControl4(control QStyle__ComplexControl, opt } func (this *QProxyStyle) DrawItemText7(painter *QPainter, rect *QRect, flags int, pal *QPalette, enabled bool, text string, textRole QPalette__ColorRole) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QProxyStyle_DrawItemText7(this.h, painter.cPointer(), rect.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms), (C.int)(textRole)) } diff --git a/qt/gen_qproxystyle.h b/qt/gen_qproxystyle.h index 6a3a35e4..f7541d69 100644 --- a/qt/gen_qproxystyle.h +++ b/qt/gen_qproxystyle.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qpushbutton.cpp b/qt/gen_qpushbutton.cpp index 2fa0ff33..6d95cac6 100644 --- a/qt/gen_qpushbutton.cpp +++ b/qt/gen_qpushbutton.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qpushbutton.h" +#include #include "gen_qpushbutton.h" #include "_cgo_export.h" diff --git a/qt/gen_qpushbutton.go b/qt/gen_qpushbutton.go index 548eb425..2d9adef6 100644 --- a/qt/gen_qpushbutton.go +++ b/qt/gen_qpushbutton.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QPushButton) cPointer() *C.QPushButton { return this.h } +func (this *QPushButton) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQPushButton(h *C.QPushButton) *QPushButton { if h == nil { return nil } - return &QPushButton{h: h, QAbstractButton: newQAbstractButton_U(unsafe.Pointer(h))} + return &QPushButton{h: h, QAbstractButton: UnsafeNewQAbstractButton(unsafe.Pointer(h))} } -func newQPushButton_U(h unsafe.Pointer) *QPushButton { +func UnsafeNewQPushButton(h unsafe.Pointer) *QPushButton { return newQPushButton((*C.QPushButton)(h)) } @@ -44,7 +52,7 @@ func NewQPushButton() *QPushButton { // NewQPushButton2 constructs a new QPushButton object. func NewQPushButton2(text string) *QPushButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QPushButton_new2((*C.struct_miqt_string)(text_ms)) return newQPushButton(ret) @@ -52,7 +60,7 @@ func NewQPushButton2(text string) *QPushButton { // NewQPushButton3 constructs a new QPushButton object. func NewQPushButton3(icon *QIcon, text string) *QPushButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QPushButton_new3(icon.cPointer(), (*C.struct_miqt_string)(text_ms)) return newQPushButton(ret) @@ -66,7 +74,7 @@ func NewQPushButton4(parent *QWidget) *QPushButton { // NewQPushButton5 constructs a new QPushButton object. func NewQPushButton5(text string, parent *QWidget) *QPushButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QPushButton_new5((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQPushButton(ret) @@ -74,14 +82,14 @@ func NewQPushButton5(text string, parent *QWidget) *QPushButton { // NewQPushButton6 constructs a new QPushButton object. func NewQPushButton6(icon *QIcon, text string, parent *QWidget) *QPushButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QPushButton_new6(icon.cPointer(), (*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQPushButton(ret) } func (this *QPushButton) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QPushButton_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QPushButton_MetaObject(this.h))) } func (this *QPushButton) Metacast(param1 string) unsafe.Pointer { @@ -143,7 +151,7 @@ func (this *QPushButton) SetMenu(menu *QMenu) { } func (this *QPushButton) Menu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QPushButton_Menu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QPushButton_Menu(this.h))) } func (this *QPushButton) SetFlat(flat bool) { diff --git a/qt/gen_qpushbutton.h b/qt/gen_qpushbutton.h index 62521c3c..83867f7d 100644 --- a/qt/gen_qpushbutton.h +++ b/qt/gen_qpushbutton.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qquaternion.cpp b/qt/gen_qquaternion.cpp index 63536328..902d1db3 100644 --- a/qt/gen_qquaternion.cpp +++ b/qt/gen_qquaternion.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qquaternion.h" +#include #include "gen_qquaternion.h" #include "_cgo_export.h" diff --git a/qt/gen_qquaternion.go b/qt/gen_qquaternion.go index 5df9cdad..49cb53c4 100644 --- a/qt/gen_qquaternion.go +++ b/qt/gen_qquaternion.go @@ -24,6 +24,13 @@ func (this *QQuaternion) cPointer() *C.QQuaternion { return this.h } +func (this *QQuaternion) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQQuaternion(h *C.QQuaternion) *QQuaternion { if h == nil { return nil @@ -31,7 +38,7 @@ func newQQuaternion(h *C.QQuaternion) *QQuaternion { return &QQuaternion{h: h} } -func newQQuaternion_U(h unsafe.Pointer) *QQuaternion { +func UnsafeNewQQuaternion(h unsafe.Pointer) *QQuaternion { return newQQuaternion((*C.QQuaternion)(h)) } @@ -178,23 +185,23 @@ func (this *QQuaternion) RotatedVector(vector *QVector3D) *QVector3D { } func (this *QQuaternion) OperatorPlusAssign(quaternion *QQuaternion) *QQuaternion { - return newQQuaternion_U(unsafe.Pointer(C.QQuaternion_OperatorPlusAssign(this.h, quaternion.cPointer()))) + return UnsafeNewQQuaternion(unsafe.Pointer(C.QQuaternion_OperatorPlusAssign(this.h, quaternion.cPointer()))) } func (this *QQuaternion) OperatorMinusAssign(quaternion *QQuaternion) *QQuaternion { - return newQQuaternion_U(unsafe.Pointer(C.QQuaternion_OperatorMinusAssign(this.h, quaternion.cPointer()))) + return UnsafeNewQQuaternion(unsafe.Pointer(C.QQuaternion_OperatorMinusAssign(this.h, quaternion.cPointer()))) } func (this *QQuaternion) OperatorMultiplyAssign(factor float32) *QQuaternion { - return newQQuaternion_U(unsafe.Pointer(C.QQuaternion_OperatorMultiplyAssign(this.h, (C.float)(factor)))) + return UnsafeNewQQuaternion(unsafe.Pointer(C.QQuaternion_OperatorMultiplyAssign(this.h, (C.float)(factor)))) } func (this *QQuaternion) OperatorMultiplyAssignWithQuaternion(quaternion *QQuaternion) *QQuaternion { - return newQQuaternion_U(unsafe.Pointer(C.QQuaternion_OperatorMultiplyAssignWithQuaternion(this.h, quaternion.cPointer()))) + return UnsafeNewQQuaternion(unsafe.Pointer(C.QQuaternion_OperatorMultiplyAssignWithQuaternion(this.h, quaternion.cPointer()))) } func (this *QQuaternion) OperatorDivideAssign(divisor float32) *QQuaternion { - return newQQuaternion_U(unsafe.Pointer(C.QQuaternion_OperatorDivideAssign(this.h, (C.float)(divisor)))) + return UnsafeNewQQuaternion(unsafe.Pointer(C.QQuaternion_OperatorDivideAssign(this.h, (C.float)(divisor)))) } func (this *QQuaternion) ToVector4D() *QVector4D { diff --git a/qt/gen_qquaternion.h b/qt/gen_qquaternion.h index b3146c00..bbe6dd13 100644 --- a/qt/gen_qquaternion.h +++ b/qt/gen_qquaternion.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qradiobutton.cpp b/qt/gen_qradiobutton.cpp index 305fc078..be80b43e 100644 --- a/qt/gen_qradiobutton.cpp +++ b/qt/gen_qradiobutton.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qradiobutton.h" +#include #include "gen_qradiobutton.h" #include "_cgo_export.h" diff --git a/qt/gen_qradiobutton.go b/qt/gen_qradiobutton.go index 3a0888a1..cdc31f48 100644 --- a/qt/gen_qradiobutton.go +++ b/qt/gen_qradiobutton.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QRadioButton) cPointer() *C.QRadioButton { return this.h } +func (this *QRadioButton) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRadioButton(h *C.QRadioButton) *QRadioButton { if h == nil { return nil } - return &QRadioButton{h: h, QAbstractButton: newQAbstractButton_U(unsafe.Pointer(h))} + return &QRadioButton{h: h, QAbstractButton: UnsafeNewQAbstractButton(unsafe.Pointer(h))} } -func newQRadioButton_U(h unsafe.Pointer) *QRadioButton { +func UnsafeNewQRadioButton(h unsafe.Pointer) *QRadioButton { return newQRadioButton((*C.QRadioButton)(h)) } @@ -44,7 +52,7 @@ func NewQRadioButton() *QRadioButton { // NewQRadioButton2 constructs a new QRadioButton object. func NewQRadioButton2(text string) *QRadioButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QRadioButton_new2((*C.struct_miqt_string)(text_ms)) return newQRadioButton(ret) @@ -58,14 +66,14 @@ func NewQRadioButton3(parent *QWidget) *QRadioButton { // NewQRadioButton4 constructs a new QRadioButton object. func NewQRadioButton4(text string, parent *QWidget) *QRadioButton { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QRadioButton_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQRadioButton(ret) } func (this *QRadioButton) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QRadioButton_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QRadioButton_MetaObject(this.h))) } func (this *QRadioButton) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qradiobutton.h b/qt/gen_qradiobutton.h index 5de2b8ec..1fbb3826 100644 --- a/qt/gen_qradiobutton.h +++ b/qt/gen_qradiobutton.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrandom.cpp b/qt/gen_qrandom.cpp index e17fa12e..5c07b35d 100644 --- a/qt/gen_qrandom.cpp +++ b/qt/gen_qrandom.cpp @@ -1,6 +1,6 @@ #include #include -#include "qrandom.h" +#include #include "gen_qrandom.h" #include "_cgo_export.h" diff --git a/qt/gen_qrandom.go b/qt/gen_qrandom.go index bf3524f2..0bd27417 100644 --- a/qt/gen_qrandom.go +++ b/qt/gen_qrandom.go @@ -24,6 +24,13 @@ func (this *QRandomGenerator) cPointer() *C.QRandomGenerator { return this.h } +func (this *QRandomGenerator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRandomGenerator(h *C.QRandomGenerator) *QRandomGenerator { if h == nil { return nil @@ -31,7 +38,7 @@ func newQRandomGenerator(h *C.QRandomGenerator) *QRandomGenerator { return &QRandomGenerator{h: h} } -func newQRandomGenerator_U(h unsafe.Pointer) *QRandomGenerator { +func UnsafeNewQRandomGenerator(h unsafe.Pointer) *QRandomGenerator { return newQRandomGenerator((*C.QRandomGenerator)(h)) } @@ -126,11 +133,11 @@ func QRandomGenerator_Max() uint { } func QRandomGenerator_System() *QRandomGenerator { - return newQRandomGenerator_U(unsafe.Pointer(C.QRandomGenerator_System())) + return UnsafeNewQRandomGenerator(unsafe.Pointer(C.QRandomGenerator_System())) } func QRandomGenerator_Global() *QRandomGenerator { - return newQRandomGenerator_U(unsafe.Pointer(C.QRandomGenerator_Global())) + return UnsafeNewQRandomGenerator(unsafe.Pointer(C.QRandomGenerator_Global())) } func QRandomGenerator_SecurelySeeded() *QRandomGenerator { @@ -170,14 +177,21 @@ func (this *QRandomGenerator64) cPointer() *C.QRandomGenerator64 { return this.h } +func (this *QRandomGenerator64) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRandomGenerator64(h *C.QRandomGenerator64) *QRandomGenerator64 { if h == nil { return nil } - return &QRandomGenerator64{h: h, QRandomGenerator: newQRandomGenerator_U(unsafe.Pointer(h))} + return &QRandomGenerator64{h: h, QRandomGenerator: UnsafeNewQRandomGenerator(unsafe.Pointer(h))} } -func newQRandomGenerator64_U(h unsafe.Pointer) *QRandomGenerator64 { +func UnsafeNewQRandomGenerator64(h unsafe.Pointer) *QRandomGenerator64 { return newQRandomGenerator64((*C.QRandomGenerator64)(h)) } @@ -238,11 +252,11 @@ func QRandomGenerator64_Max() uint64 { } func QRandomGenerator64_System() *QRandomGenerator64 { - return newQRandomGenerator64_U(unsafe.Pointer(C.QRandomGenerator64_System())) + return UnsafeNewQRandomGenerator64(unsafe.Pointer(C.QRandomGenerator64_System())) } func QRandomGenerator64_Global() *QRandomGenerator64 { - return newQRandomGenerator64_U(unsafe.Pointer(C.QRandomGenerator64_Global())) + return UnsafeNewQRandomGenerator64(unsafe.Pointer(C.QRandomGenerator64_Global())) } func QRandomGenerator64_SecurelySeeded() *QRandomGenerator64 { diff --git a/qt/gen_qrandom.h b/qt/gen_qrandom.h index 9928844e..bba02a29 100644 --- a/qt/gen_qrandom.h +++ b/qt/gen_qrandom.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrasterwindow.cpp b/qt/gen_qrasterwindow.cpp index ce482ec1..8b5184ce 100644 --- a/qt/gen_qrasterwindow.cpp +++ b/qt/gen_qrasterwindow.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qrasterwindow.h" +#include #include "gen_qrasterwindow.h" #include "_cgo_export.h" diff --git a/qt/gen_qrasterwindow.go b/qt/gen_qrasterwindow.go index 17368e2e..9d8eea3e 100644 --- a/qt/gen_qrasterwindow.go +++ b/qt/gen_qrasterwindow.go @@ -25,14 +25,21 @@ func (this *QRasterWindow) cPointer() *C.QRasterWindow { return this.h } +func (this *QRasterWindow) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRasterWindow(h *C.QRasterWindow) *QRasterWindow { if h == nil { return nil } - return &QRasterWindow{h: h, QPaintDeviceWindow: newQPaintDeviceWindow_U(unsafe.Pointer(h))} + return &QRasterWindow{h: h, QPaintDeviceWindow: UnsafeNewQPaintDeviceWindow(unsafe.Pointer(h))} } -func newQRasterWindow_U(h unsafe.Pointer) *QRasterWindow { +func UnsafeNewQRasterWindow(h unsafe.Pointer) *QRasterWindow { return newQRasterWindow((*C.QRasterWindow)(h)) } @@ -49,7 +56,7 @@ func NewQRasterWindow2(parent *QWindow) *QRasterWindow { } func (this *QRasterWindow) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QRasterWindow_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QRasterWindow_MetaObject(this.h))) } func (this *QRasterWindow) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qrasterwindow.h b/qt/gen_qrasterwindow.h index 716968a0..86c8c655 100644 --- a/qt/gen_qrasterwindow.h +++ b/qt/gen_qrasterwindow.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrawfont.cpp b/qt/gen_qrawfont.cpp index d703bbcd..46822057 100644 --- a/qt/gen_qrawfont.cpp +++ b/qt/gen_qrawfont.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qrawfont.h" +#include #include "gen_qrawfont.h" #include "_cgo_export.h" @@ -99,7 +99,7 @@ struct miqt_array* QRawFont_GlyphIndexesForString(const QRawFont* self, struct m } struct miqt_array* QRawFont_AdvancesForGlyphIndexes(const QRawFont* self, struct miqt_array* /* of unsigned int */ glyphIndexes) { - QVector glyphIndexes_QList; + QVector glyphIndexes_QList; glyphIndexes_QList.reserve(glyphIndexes->len); unsigned int* glyphIndexes_arr = static_cast(glyphIndexes->data); for(size_t i = 0; i < glyphIndexes->len; ++i) { @@ -118,7 +118,7 @@ struct miqt_array* QRawFont_AdvancesForGlyphIndexes(const QRawFont* self, struct } struct miqt_array* QRawFont_AdvancesForGlyphIndexes2(const QRawFont* self, struct miqt_array* /* of unsigned int */ glyphIndexes, int layoutFlags) { - QVector glyphIndexes_QList; + QVector glyphIndexes_QList; glyphIndexes_QList.reserve(glyphIndexes->len); unsigned int* glyphIndexes_arr = static_cast(glyphIndexes->data); for(size_t i = 0; i < glyphIndexes->len; ++i) { diff --git a/qt/gen_qrawfont.go b/qt/gen_qrawfont.go index d1850329..184737d9 100644 --- a/qt/gen_qrawfont.go +++ b/qt/gen_qrawfont.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -39,6 +40,13 @@ func (this *QRawFont) cPointer() *C.QRawFont { return this.h } +func (this *QRawFont) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRawFont(h *C.QRawFont) *QRawFont { if h == nil { return nil @@ -46,7 +54,7 @@ func newQRawFont(h *C.QRawFont) *QRawFont { return &QRawFont{h: h} } -func newQRawFont_U(h unsafe.Pointer) *QRawFont { +func UnsafeNewQRawFont(h unsafe.Pointer) *QRawFont { return newQRawFont((*C.QRawFont)(h)) } @@ -58,7 +66,7 @@ func NewQRawFont() *QRawFont { // NewQRawFont2 constructs a new QRawFont object. func NewQRawFont2(fileName string, pixelSize float64) *QRawFont { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QRawFont_new2((*C.struct_miqt_string)(fileName_ms), (C.double)(pixelSize)) return newQRawFont(ret) @@ -78,7 +86,7 @@ func NewQRawFont4(other *QRawFont) *QRawFont { // NewQRawFont5 constructs a new QRawFont object. func NewQRawFont5(fileName string, pixelSize float64, hintingPreference QFont__HintingPreference) *QRawFont { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QRawFont_new5((*C.struct_miqt_string)(fileName_ms), (C.double)(pixelSize), (C.int)(hintingPreference)) return newQRawFont(ret) @@ -133,7 +141,7 @@ func (this *QRawFont) Weight() int { } func (this *QRawFont) GlyphIndexesForString(text string) []uint { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QRawFont_GlyphIndexesForString(this.h, (*C.struct_miqt_string)(text_ms)) _ret := make([]uint, int(_ma.len)) @@ -275,7 +283,7 @@ func (this *QRawFont) UnitsPerEm() float64 { } func (this *QRawFont) LoadFromFile(fileName string, pixelSize float64, hintingPreference QFont__HintingPreference) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QRawFont_LoadFromFile(this.h, (*C.struct_miqt_string)(fileName_ms), (C.double)(pixelSize), (C.int)(hintingPreference)) } diff --git a/qt/gen_qrawfont.h b/qt/gen_qrawfont.h index 8101e90c..110db832 100644 --- a/qt/gen_qrawfont.h +++ b/qt/gen_qrawfont.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qreadwritelock.cpp b/qt/gen_qreadwritelock.cpp index 162faa64..735ddb26 100644 --- a/qt/gen_qreadwritelock.cpp +++ b/qt/gen_qreadwritelock.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qreadwritelock.h" +#include #include "gen_qreadwritelock.h" #include "_cgo_export.h" diff --git a/qt/gen_qreadwritelock.go b/qt/gen_qreadwritelock.go index 2169f9d1..2de02df9 100644 --- a/qt/gen_qreadwritelock.go +++ b/qt/gen_qreadwritelock.go @@ -31,6 +31,13 @@ func (this *QReadWriteLock) cPointer() *C.QReadWriteLock { return this.h } +func (this *QReadWriteLock) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQReadWriteLock(h *C.QReadWriteLock) *QReadWriteLock { if h == nil { return nil @@ -38,7 +45,7 @@ func newQReadWriteLock(h *C.QReadWriteLock) *QReadWriteLock { return &QReadWriteLock{h: h} } -func newQReadWriteLock_U(h unsafe.Pointer) *QReadWriteLock { +func UnsafeNewQReadWriteLock(h unsafe.Pointer) *QReadWriteLock { return newQReadWriteLock((*C.QReadWriteLock)(h)) } @@ -107,6 +114,13 @@ func (this *QReadLocker) cPointer() *C.QReadLocker { return this.h } +func (this *QReadLocker) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQReadLocker(h *C.QReadLocker) *QReadLocker { if h == nil { return nil @@ -114,7 +128,7 @@ func newQReadLocker(h *C.QReadLocker) *QReadLocker { return &QReadLocker{h: h} } -func newQReadLocker_U(h unsafe.Pointer) *QReadLocker { +func UnsafeNewQReadLocker(h unsafe.Pointer) *QReadLocker { return newQReadLocker((*C.QReadLocker)(h)) } @@ -133,7 +147,7 @@ func (this *QReadLocker) Relock() { } func (this *QReadLocker) ReadWriteLock() *QReadWriteLock { - return newQReadWriteLock_U(unsafe.Pointer(C.QReadLocker_ReadWriteLock(this.h))) + return UnsafeNewQReadWriteLock(unsafe.Pointer(C.QReadLocker_ReadWriteLock(this.h))) } // Delete this object from C++ memory. @@ -161,6 +175,13 @@ func (this *QWriteLocker) cPointer() *C.QWriteLocker { return this.h } +func (this *QWriteLocker) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWriteLocker(h *C.QWriteLocker) *QWriteLocker { if h == nil { return nil @@ -168,7 +189,7 @@ func newQWriteLocker(h *C.QWriteLocker) *QWriteLocker { return &QWriteLocker{h: h} } -func newQWriteLocker_U(h unsafe.Pointer) *QWriteLocker { +func UnsafeNewQWriteLocker(h unsafe.Pointer) *QWriteLocker { return newQWriteLocker((*C.QWriteLocker)(h)) } @@ -187,7 +208,7 @@ func (this *QWriteLocker) Relock() { } func (this *QWriteLocker) ReadWriteLock() *QReadWriteLock { - return newQReadWriteLock_U(unsafe.Pointer(C.QWriteLocker_ReadWriteLock(this.h))) + return UnsafeNewQReadWriteLock(unsafe.Pointer(C.QWriteLocker_ReadWriteLock(this.h))) } // Delete this object from C++ memory. diff --git a/qt/gen_qreadwritelock.h b/qt/gen_qreadwritelock.h index 8db9528c..913b96b0 100644 --- a/qt/gen_qreadwritelock.h +++ b/qt/gen_qreadwritelock.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrect.cpp b/qt/gen_qrect.cpp index e0f21f15..3d466a1a 100644 --- a/qt/gen_qrect.cpp +++ b/qt/gen_qrect.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qrect.h" +#include #include "gen_qrect.h" #include "_cgo_export.h" diff --git a/qt/gen_qrect.go b/qt/gen_qrect.go index 9ae2a2ac..0c6d695a 100644 --- a/qt/gen_qrect.go +++ b/qt/gen_qrect.go @@ -24,6 +24,13 @@ func (this *QRect) cPointer() *C.QRect { return this.h } +func (this *QRect) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRect(h *C.QRect) *QRect { if h == nil { return nil @@ -31,7 +38,7 @@ func newQRect(h *C.QRect) *QRect { return &QRect{h: h} } -func newQRect_U(h unsafe.Pointer) *QRect { +func UnsafeNewQRect(h unsafe.Pointer) *QRect { return newQRect((*C.QRect)(h)) } @@ -381,11 +388,11 @@ func (this *QRect) MarginsRemoved(margins *QMargins) *QRect { } func (this *QRect) OperatorPlusAssign(margins *QMargins) *QRect { - return newQRect_U(unsafe.Pointer(C.QRect_OperatorPlusAssign(this.h, margins.cPointer()))) + return UnsafeNewQRect(unsafe.Pointer(C.QRect_OperatorPlusAssign(this.h, margins.cPointer()))) } func (this *QRect) OperatorMinusAssign(margins *QMargins) *QRect { - return newQRect_U(unsafe.Pointer(C.QRect_OperatorMinusAssign(this.h, margins.cPointer()))) + return UnsafeNewQRect(unsafe.Pointer(C.QRect_OperatorMinusAssign(this.h, margins.cPointer()))) } func (this *QRect) Contains22(r *QRect, proper bool) bool { @@ -421,6 +428,13 @@ func (this *QRectF) cPointer() *C.QRectF { return this.h } +func (this *QRectF) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRectF(h *C.QRectF) *QRectF { if h == nil { return nil @@ -428,7 +442,7 @@ func newQRectF(h *C.QRectF) *QRectF { return &QRectF{h: h} } -func newQRectF_U(h unsafe.Pointer) *QRectF { +func UnsafeNewQRectF(h unsafe.Pointer) *QRectF { return newQRectF((*C.QRectF)(h)) } @@ -780,11 +794,11 @@ func (this *QRectF) MarginsRemoved(margins *QMarginsF) *QRectF { } func (this *QRectF) OperatorPlusAssign(margins *QMarginsF) *QRectF { - return newQRectF_U(unsafe.Pointer(C.QRectF_OperatorPlusAssign(this.h, margins.cPointer()))) + return UnsafeNewQRectF(unsafe.Pointer(C.QRectF_OperatorPlusAssign(this.h, margins.cPointer()))) } func (this *QRectF) OperatorMinusAssign(margins *QMarginsF) *QRectF { - return newQRectF_U(unsafe.Pointer(C.QRectF_OperatorMinusAssign(this.h, margins.cPointer()))) + return UnsafeNewQRectF(unsafe.Pointer(C.QRectF_OperatorMinusAssign(this.h, margins.cPointer()))) } func (this *QRectF) ToRect() *QRect { diff --git a/qt/gen_qrect.h b/qt/gen_qrect.h index 829b5418..1b9d8d9c 100644 --- a/qt/gen_qrect.h +++ b/qt/gen_qrect.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrefcount.cpp b/qt/gen_qrefcount.cpp index d5e637e8..a8fe9ac6 100644 --- a/qt/gen_qrefcount.cpp +++ b/qt/gen_qrefcount.cpp @@ -1,5 +1,5 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__RefCount -#include "qrefcount.h" +#include #include "gen_qrefcount.h" #include "_cgo_export.h" diff --git a/qt/gen_qrefcount.go b/qt/gen_qrefcount.go index 5586cae5..42816c6e 100644 --- a/qt/gen_qrefcount.go +++ b/qt/gen_qrefcount.go @@ -24,6 +24,13 @@ func (this *QtPrivate__RefCount) cPointer() *C.QtPrivate__RefCount { return this.h } +func (this *QtPrivate__RefCount) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__RefCount(h *C.QtPrivate__RefCount) *QtPrivate__RefCount { if h == nil { return nil @@ -31,7 +38,7 @@ func newQtPrivate__RefCount(h *C.QtPrivate__RefCount) *QtPrivate__RefCount { return &QtPrivate__RefCount{h: h} } -func newQtPrivate__RefCount_U(h unsafe.Pointer) *QtPrivate__RefCount { +func UnsafeNewQtPrivate__RefCount(h unsafe.Pointer) *QtPrivate__RefCount { return newQtPrivate__RefCount((*C.QtPrivate__RefCount)(h)) } diff --git a/qt/gen_qrefcount.h b/qt/gen_qrefcount.h index 4f0d6f71..c245c7da 100644 --- a/qt/gen_qrefcount.h +++ b/qt/gen_qrefcount.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qregexp.cpp b/qt/gen_qregexp.cpp index 5988b8a0..910a80d3 100644 --- a/qt/gen_qregexp.cpp +++ b/qt/gen_qregexp.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qregexp.h" +#include #include "gen_qregexp.h" #include "_cgo_export.h" diff --git a/qt/gen_qregexp.go b/qt/gen_qregexp.go index 5ef7945f..801057b1 100644 --- a/qt/gen_qregexp.go +++ b/qt/gen_qregexp.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -43,6 +44,13 @@ func (this *QRegExp) cPointer() *C.QRegExp { return this.h } +func (this *QRegExp) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRegExp(h *C.QRegExp) *QRegExp { if h == nil { return nil @@ -50,7 +58,7 @@ func newQRegExp(h *C.QRegExp) *QRegExp { return &QRegExp{h: h} } -func newQRegExp_U(h unsafe.Pointer) *QRegExp { +func UnsafeNewQRegExp(h unsafe.Pointer) *QRegExp { return newQRegExp((*C.QRegExp)(h)) } @@ -62,7 +70,7 @@ func NewQRegExp() *QRegExp { // NewQRegExp2 constructs a new QRegExp object. func NewQRegExp2(pattern string) *QRegExp { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) ret := C.QRegExp_new2((*C.struct_miqt_string)(pattern_ms)) return newQRegExp(ret) @@ -76,7 +84,7 @@ func NewQRegExp3(rx *QRegExp) *QRegExp { // NewQRegExp4 constructs a new QRegExp object. func NewQRegExp4(pattern string, cs CaseSensitivity) *QRegExp { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) ret := C.QRegExp_new4((*C.struct_miqt_string)(pattern_ms), (C.int)(cs)) return newQRegExp(ret) @@ -84,7 +92,7 @@ func NewQRegExp4(pattern string, cs CaseSensitivity) *QRegExp { // NewQRegExp5 constructs a new QRegExp object. func NewQRegExp5(pattern string, cs CaseSensitivity, syntax QRegExp__PatternSyntax) *QRegExp { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) ret := C.QRegExp_new5((*C.struct_miqt_string)(pattern_ms), (C.int)(cs), (C.int)(syntax)) return newQRegExp(ret) @@ -122,7 +130,7 @@ func (this *QRegExp) Pattern() string { } func (this *QRegExp) SetPattern(pattern string) { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) C.QRegExp_SetPattern(this.h, (*C.struct_miqt_string)(pattern_ms)) } @@ -152,19 +160,19 @@ func (this *QRegExp) SetMinimal(minimal bool) { } func (this *QRegExp) ExactMatch(str string) bool { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (bool)(C.QRegExp_ExactMatch(this.h, (*C.struct_miqt_string)(str_ms))) } func (this *QRegExp) IndexIn(str string) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QRegExp_IndexIn(this.h, (*C.struct_miqt_string)(str_ms))) } func (this *QRegExp) LastIndexIn(str string) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QRegExp_LastIndexIn(this.h, (*C.struct_miqt_string)(str_ms))) } @@ -242,7 +250,7 @@ func (this *QRegExp) ErrorString2() string { } func QRegExp_Escape(str string) string { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ms *C.struct_miqt_string = C.QRegExp_Escape((*C.struct_miqt_string)(str_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -251,25 +259,25 @@ func QRegExp_Escape(str string) string { } func (this *QRegExp) IndexIn2(str string, offset int) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QRegExp_IndexIn2(this.h, (*C.struct_miqt_string)(str_ms), (C.int)(offset))) } func (this *QRegExp) IndexIn3(str string, offset int, caretMode QRegExp__CaretMode) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QRegExp_IndexIn3(this.h, (*C.struct_miqt_string)(str_ms), (C.int)(offset), (C.int)(caretMode))) } func (this *QRegExp) LastIndexIn2(str string, offset int) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QRegExp_LastIndexIn2(this.h, (*C.struct_miqt_string)(str_ms), (C.int)(offset))) } func (this *QRegExp) LastIndexIn3(str string, offset int, caretMode QRegExp__CaretMode) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QRegExp_LastIndexIn3(this.h, (*C.struct_miqt_string)(str_ms), (C.int)(offset), (C.int)(caretMode))) } diff --git a/qt/gen_qregexp.h b/qt/gen_qregexp.h index 7bf4872a..6881777c 100644 --- a/qt/gen_qregexp.h +++ b/qt/gen_qregexp.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qregion.cpp b/qt/gen_qregion.cpp index ff1e4a08..e270240a 100644 --- a/qt/gen_qregion.cpp +++ b/qt/gen_qregion.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qregion.h" +#include #include "gen_qregion.h" #include "_cgo_export.h" diff --git a/qt/gen_qregion.go b/qt/gen_qregion.go index a4f2015e..73ea6198 100644 --- a/qt/gen_qregion.go +++ b/qt/gen_qregion.go @@ -31,6 +31,13 @@ func (this *QRegion) cPointer() *C.QRegion { return this.h } +func (this *QRegion) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRegion(h *C.QRegion) *QRegion { if h == nil { return nil @@ -38,7 +45,7 @@ func newQRegion(h *C.QRegion) *QRegion { return &QRegion{h: h} } -func newQRegion_U(h unsafe.Pointer) *QRegion { +func UnsafeNewQRegion(h unsafe.Pointer) *QRegion { return newQRegion((*C.QRegion)(h)) } @@ -101,19 +108,19 @@ func (this *QRegion) IsNull() bool { } func (this *QRegion) Begin() *QRect { - return newQRect_U(unsafe.Pointer(C.QRegion_Begin(this.h))) + return UnsafeNewQRect(unsafe.Pointer(C.QRegion_Begin(this.h))) } func (this *QRegion) Cbegin() *QRect { - return newQRect_U(unsafe.Pointer(C.QRegion_Cbegin(this.h))) + return UnsafeNewQRect(unsafe.Pointer(C.QRegion_Cbegin(this.h))) } func (this *QRegion) End() *QRect { - return newQRect_U(unsafe.Pointer(C.QRegion_End(this.h))) + return UnsafeNewQRect(unsafe.Pointer(C.QRegion_End(this.h))) } func (this *QRegion) Cend() *QRect { - return newQRect_U(unsafe.Pointer(C.QRegion_Cend(this.h))) + return UnsafeNewQRect(unsafe.Pointer(C.QRegion_Cend(this.h))) } func (this *QRegion) Contains(p *QPoint) bool { @@ -279,11 +286,11 @@ func (this *QRegion) OperatorBitwiseOrAssign(r *QRegion) { } func (this *QRegion) OperatorPlusAssign(r *QRegion) *QRegion { - return newQRegion_U(unsafe.Pointer(C.QRegion_OperatorPlusAssign(this.h, r.cPointer()))) + return UnsafeNewQRegion(unsafe.Pointer(C.QRegion_OperatorPlusAssign(this.h, r.cPointer()))) } func (this *QRegion) OperatorPlusAssignWithQRect(r *QRect) *QRegion { - return newQRegion_U(unsafe.Pointer(C.QRegion_OperatorPlusAssignWithQRect(this.h, r.cPointer()))) + return UnsafeNewQRegion(unsafe.Pointer(C.QRegion_OperatorPlusAssignWithQRect(this.h, r.cPointer()))) } func (this *QRegion) OperatorBitwiseAndAssign(r *QRegion) { @@ -295,7 +302,7 @@ func (this *QRegion) OperatorBitwiseAndAssignWithQRect(r *QRect) { } func (this *QRegion) OperatorMinusAssign(r *QRegion) *QRegion { - return newQRegion_U(unsafe.Pointer(C.QRegion_OperatorMinusAssign(this.h, r.cPointer()))) + return UnsafeNewQRegion(unsafe.Pointer(C.QRegion_OperatorMinusAssign(this.h, r.cPointer()))) } func (this *QRegion) OperatorBitwiseNotAssign(r *QRegion) { diff --git a/qt/gen_qregion.h b/qt/gen_qregion.h index 7d2ecd52..4a6e25c7 100644 --- a/qt/gen_qregion.h +++ b/qt/gen_qregion.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qregularexpression.cpp b/qt/gen_qregularexpression.cpp index 59ac612c..20b09786 100644 --- a/qt/gen_qregularexpression.cpp +++ b/qt/gen_qregularexpression.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qregularexpression.h" +#include #include "gen_qregularexpression.h" #include "_cgo_export.h" diff --git a/qt/gen_qregularexpression.go b/qt/gen_qregularexpression.go index 9d6c5ac0..61902e0a 100644 --- a/qt/gen_qregularexpression.go +++ b/qt/gen_qregularexpression.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -56,6 +57,13 @@ func (this *QRegularExpression) cPointer() *C.QRegularExpression { return this.h } +func (this *QRegularExpression) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRegularExpression(h *C.QRegularExpression) *QRegularExpression { if h == nil { return nil @@ -63,7 +71,7 @@ func newQRegularExpression(h *C.QRegularExpression) *QRegularExpression { return &QRegularExpression{h: h} } -func newQRegularExpression_U(h unsafe.Pointer) *QRegularExpression { +func UnsafeNewQRegularExpression(h unsafe.Pointer) *QRegularExpression { return newQRegularExpression((*C.QRegularExpression)(h)) } @@ -75,7 +83,7 @@ func NewQRegularExpression() *QRegularExpression { // NewQRegularExpression2 constructs a new QRegularExpression object. func NewQRegularExpression2(pattern string) *QRegularExpression { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) ret := C.QRegularExpression_new2((*C.struct_miqt_string)(pattern_ms)) return newQRegularExpression(ret) @@ -89,7 +97,7 @@ func NewQRegularExpression3(re *QRegularExpression) *QRegularExpression { // NewQRegularExpression4 constructs a new QRegularExpression object. func NewQRegularExpression4(pattern string, options QRegularExpression__PatternOption) *QRegularExpression { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) ret := C.QRegularExpression_new4((*C.struct_miqt_string)(pattern_ms), (C.int)(options)) return newQRegularExpression(ret) @@ -119,7 +127,7 @@ func (this *QRegularExpression) Pattern() string { } func (this *QRegularExpression) SetPattern(pattern string) { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) C.QRegularExpression_SetPattern(this.h, (*C.struct_miqt_string)(pattern_ms)) } @@ -158,7 +166,7 @@ func (this *QRegularExpression) NamedCaptureGroups() []string { } func (this *QRegularExpression) Match(subject string) *QRegularExpressionMatch { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_Match(this.h, (*C.struct_miqt_string)(subject_ms)) _goptr := newQRegularExpressionMatch(_ret) @@ -167,7 +175,7 @@ func (this *QRegularExpression) Match(subject string) *QRegularExpressionMatch { } func (this *QRegularExpression) GlobalMatch(subject string) *QRegularExpressionMatchIterator { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_GlobalMatch(this.h, (*C.struct_miqt_string)(subject_ms)) _goptr := newQRegularExpressionMatchIterator(_ret) @@ -180,7 +188,7 @@ func (this *QRegularExpression) Optimize() { } func QRegularExpression_Escape(str string) string { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ms *C.struct_miqt_string = C.QRegularExpression_Escape((*C.struct_miqt_string)(str_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -189,7 +197,7 @@ func QRegularExpression_Escape(str string) string { } func QRegularExpression_WildcardToRegularExpression(str string) string { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) var _ms *C.struct_miqt_string = C.QRegularExpression_WildcardToRegularExpression((*C.struct_miqt_string)(str_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -198,7 +206,7 @@ func QRegularExpression_WildcardToRegularExpression(str string) string { } func QRegularExpression_AnchoredPattern(expression string) string { - expression_ms := miqt_strdupg(expression) + expression_ms := libmiqt.Strdupg(expression) defer C.free(expression_ms) var _ms *C.struct_miqt_string = C.QRegularExpression_AnchoredPattern((*C.struct_miqt_string)(expression_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -215,7 +223,7 @@ func (this *QRegularExpression) OperatorNotEqual(re *QRegularExpression) bool { } func (this *QRegularExpression) Match2(subject string, offset int) *QRegularExpressionMatch { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_Match2(this.h, (*C.struct_miqt_string)(subject_ms), (C.int)(offset)) _goptr := newQRegularExpressionMatch(_ret) @@ -224,7 +232,7 @@ func (this *QRegularExpression) Match2(subject string, offset int) *QRegularExpr } func (this *QRegularExpression) Match3(subject string, offset int, matchType QRegularExpression__MatchType) *QRegularExpressionMatch { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_Match3(this.h, (*C.struct_miqt_string)(subject_ms), (C.int)(offset), (C.int)(matchType)) _goptr := newQRegularExpressionMatch(_ret) @@ -233,7 +241,7 @@ func (this *QRegularExpression) Match3(subject string, offset int, matchType QRe } func (this *QRegularExpression) Match4(subject string, offset int, matchType QRegularExpression__MatchType, matchOptions QRegularExpression__MatchOption) *QRegularExpressionMatch { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_Match4(this.h, (*C.struct_miqt_string)(subject_ms), (C.int)(offset), (C.int)(matchType), (C.int)(matchOptions)) _goptr := newQRegularExpressionMatch(_ret) @@ -242,7 +250,7 @@ func (this *QRegularExpression) Match4(subject string, offset int, matchType QRe } func (this *QRegularExpression) GlobalMatch2(subject string, offset int) *QRegularExpressionMatchIterator { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_GlobalMatch2(this.h, (*C.struct_miqt_string)(subject_ms), (C.int)(offset)) _goptr := newQRegularExpressionMatchIterator(_ret) @@ -251,7 +259,7 @@ func (this *QRegularExpression) GlobalMatch2(subject string, offset int) *QRegul } func (this *QRegularExpression) GlobalMatch3(subject string, offset int, matchType QRegularExpression__MatchType) *QRegularExpressionMatchIterator { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_GlobalMatch3(this.h, (*C.struct_miqt_string)(subject_ms), (C.int)(offset), (C.int)(matchType)) _goptr := newQRegularExpressionMatchIterator(_ret) @@ -260,7 +268,7 @@ func (this *QRegularExpression) GlobalMatch3(subject string, offset int, matchTy } func (this *QRegularExpression) GlobalMatch4(subject string, offset int, matchType QRegularExpression__MatchType, matchOptions QRegularExpression__MatchOption) *QRegularExpressionMatchIterator { - subject_ms := miqt_strdupg(subject) + subject_ms := libmiqt.Strdupg(subject) defer C.free(subject_ms) _ret := C.QRegularExpression_GlobalMatch4(this.h, (*C.struct_miqt_string)(subject_ms), (C.int)(offset), (C.int)(matchType), (C.int)(matchOptions)) _goptr := newQRegularExpressionMatchIterator(_ret) @@ -293,6 +301,13 @@ func (this *QRegularExpressionMatch) cPointer() *C.QRegularExpressionMatch { return this.h } +func (this *QRegularExpressionMatch) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRegularExpressionMatch(h *C.QRegularExpressionMatch) *QRegularExpressionMatch { if h == nil { return nil @@ -300,7 +315,7 @@ func newQRegularExpressionMatch(h *C.QRegularExpressionMatch) *QRegularExpressio return &QRegularExpressionMatch{h: h} } -func newQRegularExpressionMatch_U(h unsafe.Pointer) *QRegularExpressionMatch { +func UnsafeNewQRegularExpressionMatch(h unsafe.Pointer) *QRegularExpressionMatch { return newQRegularExpressionMatch((*C.QRegularExpressionMatch)(h)) } @@ -363,7 +378,7 @@ func (this *QRegularExpressionMatch) Captured() string { } func (this *QRegularExpressionMatch) CapturedWithName(name string) string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) var _ms *C.struct_miqt_string = C.QRegularExpressionMatch_CapturedWithName(this.h, (*C.struct_miqt_string)(name_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -398,19 +413,19 @@ func (this *QRegularExpressionMatch) CapturedEnd() int { } func (this *QRegularExpressionMatch) CapturedStartWithName(name string) int { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (int)(C.QRegularExpressionMatch_CapturedStartWithName(this.h, (*C.struct_miqt_string)(name_ms))) } func (this *QRegularExpressionMatch) CapturedLengthWithName(name string) int { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (int)(C.QRegularExpressionMatch_CapturedLengthWithName(this.h, (*C.struct_miqt_string)(name_ms))) } func (this *QRegularExpressionMatch) CapturedEndWithName(name string) int { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) return (int)(C.QRegularExpressionMatch_CapturedEndWithName(this.h, (*C.struct_miqt_string)(name_ms))) } @@ -459,6 +474,13 @@ func (this *QRegularExpressionMatchIterator) cPointer() *C.QRegularExpressionMat return this.h } +func (this *QRegularExpressionMatchIterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRegularExpressionMatchIterator(h *C.QRegularExpressionMatchIterator) *QRegularExpressionMatchIterator { if h == nil { return nil @@ -466,7 +488,7 @@ func newQRegularExpressionMatchIterator(h *C.QRegularExpressionMatchIterator) *Q return &QRegularExpressionMatchIterator{h: h} } -func newQRegularExpressionMatchIterator_U(h unsafe.Pointer) *QRegularExpressionMatchIterator { +func UnsafeNewQRegularExpressionMatchIterator(h unsafe.Pointer) *QRegularExpressionMatchIterator { return newQRegularExpressionMatchIterator((*C.QRegularExpressionMatchIterator)(h)) } diff --git a/qt/gen_qregularexpression.h b/qt/gen_qregularexpression.h index 500cfb1d..71cc017d 100644 --- a/qt/gen_qregularexpression.h +++ b/qt/gen_qregularexpression.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qresource.cpp b/qt/gen_qresource.cpp index 8f58f83c..3b9ab664 100644 --- a/qt/gen_qresource.cpp +++ b/qt/gen_qresource.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qresource.h" +#include #include "gen_qresource.h" #include "_cgo_export.h" diff --git a/qt/gen_qresource.go b/qt/gen_qresource.go index 735f4cd5..5510a5a1 100644 --- a/qt/gen_qresource.go +++ b/qt/gen_qresource.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -32,6 +33,13 @@ func (this *QResource) cPointer() *C.QResource { return this.h } +func (this *QResource) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQResource(h *C.QResource) *QResource { if h == nil { return nil @@ -39,7 +47,7 @@ func newQResource(h *C.QResource) *QResource { return &QResource{h: h} } -func newQResource_U(h unsafe.Pointer) *QResource { +func UnsafeNewQResource(h unsafe.Pointer) *QResource { return newQResource((*C.QResource)(h)) } @@ -51,7 +59,7 @@ func NewQResource() *QResource { // NewQResource2 constructs a new QResource object. func NewQResource2(file string) *QResource { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) ret := C.QResource_new2((*C.struct_miqt_string)(file_ms)) return newQResource(ret) @@ -59,14 +67,14 @@ func NewQResource2(file string) *QResource { // NewQResource3 constructs a new QResource object. func NewQResource3(file string, locale *QLocale) *QResource { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) ret := C.QResource_new3((*C.struct_miqt_string)(file_ms), locale.cPointer()) return newQResource(ret) } func (this *QResource) SetFileName(file string) { - file_ms := miqt_strdupg(file) + file_ms := libmiqt.Strdupg(file) defer C.free(file_ms) C.QResource_SetFileName(this.h, (*C.struct_miqt_string)(file_ms)) } @@ -131,7 +139,7 @@ func (this *QResource) LastModified() *QDateTime { } func QResource_AddSearchPath(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QResource_AddSearchPath((*C.struct_miqt_string)(path_ms)) } @@ -155,13 +163,13 @@ func (this *QResource) IsCompressed() bool { } func QResource_RegisterResource(rccFilename string) bool { - rccFilename_ms := miqt_strdupg(rccFilename) + rccFilename_ms := libmiqt.Strdupg(rccFilename) defer C.free(rccFilename_ms) return (bool)(C.QResource_RegisterResource((*C.struct_miqt_string)(rccFilename_ms))) } func QResource_UnregisterResource(rccFilename string) bool { - rccFilename_ms := miqt_strdupg(rccFilename) + rccFilename_ms := libmiqt.Strdupg(rccFilename) defer C.free(rccFilename_ms) return (bool)(C.QResource_UnregisterResource((*C.struct_miqt_string)(rccFilename_ms))) } @@ -175,29 +183,29 @@ func QResource_UnregisterResourceWithRccData(rccData *byte) bool { } func QResource_RegisterResource2(rccFilename string, resourceRoot string) bool { - rccFilename_ms := miqt_strdupg(rccFilename) + rccFilename_ms := libmiqt.Strdupg(rccFilename) defer C.free(rccFilename_ms) - resourceRoot_ms := miqt_strdupg(resourceRoot) + resourceRoot_ms := libmiqt.Strdupg(resourceRoot) defer C.free(resourceRoot_ms) return (bool)(C.QResource_RegisterResource2((*C.struct_miqt_string)(rccFilename_ms), (*C.struct_miqt_string)(resourceRoot_ms))) } func QResource_UnregisterResource2(rccFilename string, resourceRoot string) bool { - rccFilename_ms := miqt_strdupg(rccFilename) + rccFilename_ms := libmiqt.Strdupg(rccFilename) defer C.free(rccFilename_ms) - resourceRoot_ms := miqt_strdupg(resourceRoot) + resourceRoot_ms := libmiqt.Strdupg(resourceRoot) defer C.free(resourceRoot_ms) return (bool)(C.QResource_UnregisterResource2((*C.struct_miqt_string)(rccFilename_ms), (*C.struct_miqt_string)(resourceRoot_ms))) } func QResource_RegisterResource22(rccData *byte, resourceRoot string) bool { - resourceRoot_ms := miqt_strdupg(resourceRoot) + resourceRoot_ms := libmiqt.Strdupg(resourceRoot) defer C.free(resourceRoot_ms) return (bool)(C.QResource_RegisterResource22((*C.uchar)(unsafe.Pointer(rccData)), (*C.struct_miqt_string)(resourceRoot_ms))) } func QResource_UnregisterResource22(rccData *byte, resourceRoot string) bool { - resourceRoot_ms := miqt_strdupg(resourceRoot) + resourceRoot_ms := libmiqt.Strdupg(resourceRoot) defer C.free(resourceRoot_ms) return (bool)(C.QResource_UnregisterResource22((*C.uchar)(unsafe.Pointer(rccData)), (*C.struct_miqt_string)(resourceRoot_ms))) } diff --git a/qt/gen_qresource.h b/qt/gen_qresource.h index 79fbc638..9139ff0a 100644 --- a/qt/gen_qresource.h +++ b/qt/gen_qresource.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qresultstore.cpp b/qt/gen_qresultstore.cpp index db0f28e1..8fa02268 100644 --- a/qt/gen_qresultstore.cpp +++ b/qt/gen_qresultstore.cpp @@ -1,7 +1,7 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__ResultItem #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__ResultIteratorBase #define WORKAROUND_INNER_CLASS_DEFINITION_QtPrivate__ResultStoreBase -#include "qresultstore.h" +#include #include "gen_qresultstore.h" #include "_cgo_export.h" diff --git a/qt/gen_qresultstore.go b/qt/gen_qresultstore.go index e332ebc4..c0d25944 100644 --- a/qt/gen_qresultstore.go +++ b/qt/gen_qresultstore.go @@ -24,6 +24,13 @@ func (this *QtPrivate__ResultItem) cPointer() *C.QtPrivate__ResultItem { return this.h } +func (this *QtPrivate__ResultItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__ResultItem(h *C.QtPrivate__ResultItem) *QtPrivate__ResultItem { if h == nil { return nil @@ -31,7 +38,7 @@ func newQtPrivate__ResultItem(h *C.QtPrivate__ResultItem) *QtPrivate__ResultItem return &QtPrivate__ResultItem{h: h} } -func newQtPrivate__ResultItem_U(h unsafe.Pointer) *QtPrivate__ResultItem { +func UnsafeNewQtPrivate__ResultItem(h unsafe.Pointer) *QtPrivate__ResultItem { return newQtPrivate__ResultItem((*C.QtPrivate__ResultItem)(h)) } @@ -90,6 +97,13 @@ func (this *QtPrivate__ResultIteratorBase) cPointer() *C.QtPrivate__ResultIterat return this.h } +func (this *QtPrivate__ResultIteratorBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__ResultIteratorBase(h *C.QtPrivate__ResultIteratorBase) *QtPrivate__ResultIteratorBase { if h == nil { return nil @@ -97,7 +111,7 @@ func newQtPrivate__ResultIteratorBase(h *C.QtPrivate__ResultIteratorBase) *QtPri return &QtPrivate__ResultIteratorBase{h: h} } -func newQtPrivate__ResultIteratorBase_U(h unsafe.Pointer) *QtPrivate__ResultIteratorBase { +func UnsafeNewQtPrivate__ResultIteratorBase(h unsafe.Pointer) *QtPrivate__ResultIteratorBase { return newQtPrivate__ResultIteratorBase((*C.QtPrivate__ResultIteratorBase)(h)) } @@ -171,6 +185,13 @@ func (this *QtPrivate__ResultStoreBase) cPointer() *C.QtPrivate__ResultStoreBase return this.h } +func (this *QtPrivate__ResultStoreBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQtPrivate__ResultStoreBase(h *C.QtPrivate__ResultStoreBase) *QtPrivate__ResultStoreBase { if h == nil { return nil @@ -178,7 +199,7 @@ func newQtPrivate__ResultStoreBase(h *C.QtPrivate__ResultStoreBase) *QtPrivate__ return &QtPrivate__ResultStoreBase{h: h} } -func newQtPrivate__ResultStoreBase_U(h unsafe.Pointer) *QtPrivate__ResultStoreBase { +func UnsafeNewQtPrivate__ResultStoreBase(h unsafe.Pointer) *QtPrivate__ResultStoreBase { return newQtPrivate__ResultStoreBase((*C.QtPrivate__ResultStoreBase)(h)) } diff --git a/qt/gen_qresultstore.h b/qt/gen_qresultstore.h index 27b1ec18..3892c955 100644 --- a/qt/gen_qresultstore.h +++ b/qt/gen_qresultstore.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrgb.cpp b/qt/gen_qrgb.cpp index 07d69064..a2bcc7fe 100644 --- a/qt/gen_qrgb.cpp +++ b/qt/gen_qrgb.cpp @@ -1,4 +1,4 @@ -#include "qrgb.h" +#include #include "gen_qrgb.h" #include "_cgo_export.h" diff --git a/qt/gen_qrgb.h b/qt/gen_qrgb.h index ac25bc1f..04843700 100644 --- a/qt/gen_qrgb.h +++ b/qt/gen_qrgb.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrgba64.cpp b/qt/gen_qrgba64.cpp index f0edc8fd..81f267d5 100644 --- a/qt/gen_qrgba64.cpp +++ b/qt/gen_qrgba64.cpp @@ -1,5 +1,5 @@ #include -#include "qrgba64.h" +#include #include "gen_qrgba64.h" #include "_cgo_export.h" diff --git a/qt/gen_qrgba64.go b/qt/gen_qrgba64.go index 6f157c2d..68a6c11d 100644 --- a/qt/gen_qrgba64.go +++ b/qt/gen_qrgba64.go @@ -24,6 +24,13 @@ func (this *QRgba64) cPointer() *C.QRgba64 { return this.h } +func (this *QRgba64) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRgba64(h *C.QRgba64) *QRgba64 { if h == nil { return nil @@ -31,7 +38,7 @@ func newQRgba64(h *C.QRgba64) *QRgba64 { return &QRgba64{h: h} } -func newQRgba64_U(h unsafe.Pointer) *QRgba64 { +func UnsafeNewQRgba64(h unsafe.Pointer) *QRgba64 { return newQRgba64((*C.QRgba64)(h)) } diff --git a/qt/gen_qrgba64.h b/qt/gen_qrgba64.h index 8f9f43d7..17800e13 100644 --- a/qt/gen_qrgba64.h +++ b/qt/gen_qrgba64.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrubberband.cpp b/qt/gen_qrubberband.cpp index dd55a5ed..8ac1c1df 100644 --- a/qt/gen_qrubberband.cpp +++ b/qt/gen_qrubberband.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qrubberband.h" +#include #include "gen_qrubberband.h" #include "_cgo_export.h" diff --git a/qt/gen_qrubberband.go b/qt/gen_qrubberband.go index 3c4bf402..32010901 100644 --- a/qt/gen_qrubberband.go +++ b/qt/gen_qrubberband.go @@ -32,14 +32,21 @@ func (this *QRubberBand) cPointer() *C.QRubberBand { return this.h } +func (this *QRubberBand) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRubberBand(h *C.QRubberBand) *QRubberBand { if h == nil { return nil } - return &QRubberBand{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QRubberBand{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQRubberBand_U(h unsafe.Pointer) *QRubberBand { +func UnsafeNewQRubberBand(h unsafe.Pointer) *QRubberBand { return newQRubberBand((*C.QRubberBand)(h)) } @@ -56,7 +63,7 @@ func NewQRubberBand2(param1 QRubberBand__Shape, param2 *QWidget) *QRubberBand { } func (this *QRubberBand) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QRubberBand_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QRubberBand_MetaObject(this.h))) } func (this *QRubberBand) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qrubberband.h b/qt/gen_qrubberband.h index 56b2033c..463c3f3b 100644 --- a/qt/gen_qrubberband.h +++ b/qt/gen_qrubberband.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qrunnable.cpp b/qt/gen_qrunnable.cpp index 3d86cf4d..6c6ab6e8 100644 --- a/qt/gen_qrunnable.cpp +++ b/qt/gen_qrunnable.cpp @@ -1,5 +1,5 @@ #include -#include "qrunnable.h" +#include #include "gen_qrunnable.h" #include "_cgo_export.h" diff --git a/qt/gen_qrunnable.go b/qt/gen_qrunnable.go index a3a7ca02..5d8d23bc 100644 --- a/qt/gen_qrunnable.go +++ b/qt/gen_qrunnable.go @@ -24,6 +24,13 @@ func (this *QRunnable) cPointer() *C.QRunnable { return this.h } +func (this *QRunnable) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRunnable(h *C.QRunnable) *QRunnable { if h == nil { return nil @@ -31,7 +38,7 @@ func newQRunnable(h *C.QRunnable) *QRunnable { return &QRunnable{h: h} } -func newQRunnable_U(h unsafe.Pointer) *QRunnable { +func UnsafeNewQRunnable(h unsafe.Pointer) *QRunnable { return newQRunnable((*C.QRunnable)(h)) } diff --git a/qt/gen_qrunnable.h b/qt/gen_qrunnable.h index da811ac7..0b6e4b67 100644 --- a/qt/gen_qrunnable.h +++ b/qt/gen_qrunnable.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsavefile.cpp b/qt/gen_qsavefile.cpp index 0706f7ee..a0264506 100644 --- a/qt/gen_qsavefile.cpp +++ b/qt/gen_qsavefile.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qsavefile.h" +#include #include "gen_qsavefile.h" #include "_cgo_export.h" diff --git a/qt/gen_qsavefile.go b/qt/gen_qsavefile.go index e589582e..dda08998 100644 --- a/qt/gen_qsavefile.go +++ b/qt/gen_qsavefile.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,20 +26,27 @@ func (this *QSaveFile) cPointer() *C.QSaveFile { return this.h } +func (this *QSaveFile) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSaveFile(h *C.QSaveFile) *QSaveFile { if h == nil { return nil } - return &QSaveFile{h: h, QFileDevice: newQFileDevice_U(unsafe.Pointer(h))} + return &QSaveFile{h: h, QFileDevice: UnsafeNewQFileDevice(unsafe.Pointer(h))} } -func newQSaveFile_U(h unsafe.Pointer) *QSaveFile { +func UnsafeNewQSaveFile(h unsafe.Pointer) *QSaveFile { return newQSaveFile((*C.QSaveFile)(h)) } // NewQSaveFile constructs a new QSaveFile object. func NewQSaveFile(name string) *QSaveFile { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QSaveFile_new((*C.struct_miqt_string)(name_ms)) return newQSaveFile(ret) @@ -52,7 +60,7 @@ func NewQSaveFile2() *QSaveFile { // NewQSaveFile3 constructs a new QSaveFile object. func NewQSaveFile3(name string, parent *QObject) *QSaveFile { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) ret := C.QSaveFile_new3((*C.struct_miqt_string)(name_ms), parent.cPointer()) return newQSaveFile(ret) @@ -65,7 +73,7 @@ func NewQSaveFile4(parent *QObject) *QSaveFile { } func (this *QSaveFile) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSaveFile_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSaveFile_MetaObject(this.h))) } func (this *QSaveFile) Metacast(param1 string) unsafe.Pointer { @@ -100,7 +108,7 @@ func (this *QSaveFile) FileName() string { } func (this *QSaveFile) SetFileName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QSaveFile_SetFileName(this.h, (*C.struct_miqt_string)(name_ms)) } diff --git a/qt/gen_qsavefile.h b/qt/gen_qsavefile.h index f79ddb08..481bd88a 100644 --- a/qt/gen_qsavefile.h +++ b/qt/gen_qsavefile.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qscopedpointer.cpp b/qt/gen_qscopedpointer.cpp index fcaccf01..5b25a0c8 100644 --- a/qt/gen_qscopedpointer.cpp +++ b/qt/gen_qscopedpointer.cpp @@ -1,5 +1,5 @@ #include -#include "qscopedpointer.h" +#include #include "gen_qscopedpointer.h" #include "_cgo_export.h" diff --git a/qt/gen_qscopedpointer.go b/qt/gen_qscopedpointer.go index d7d4579b..23303fb7 100644 --- a/qt/gen_qscopedpointer.go +++ b/qt/gen_qscopedpointer.go @@ -24,6 +24,13 @@ func (this *QScopedPointerPodDeleter) cPointer() *C.QScopedPointerPodDeleter { return this.h } +func (this *QScopedPointerPodDeleter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScopedPointerPodDeleter(h *C.QScopedPointerPodDeleter) *QScopedPointerPodDeleter { if h == nil { return nil @@ -31,7 +38,7 @@ func newQScopedPointerPodDeleter(h *C.QScopedPointerPodDeleter) *QScopedPointerP return &QScopedPointerPodDeleter{h: h} } -func newQScopedPointerPodDeleter_U(h unsafe.Pointer) *QScopedPointerPodDeleter { +func UnsafeNewQScopedPointerPodDeleter(h unsafe.Pointer) *QScopedPointerPodDeleter { return newQScopedPointerPodDeleter((*C.QScopedPointerPodDeleter)(h)) } diff --git a/qt/gen_qscopedpointer.h b/qt/gen_qscopedpointer.h index 9299c715..1ab85034 100644 --- a/qt/gen_qscopedpointer.h +++ b/qt/gen_qscopedpointer.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qscreen.cpp b/qt/gen_qscreen.cpp index e7b19fa3..2b08f727 100644 --- a/qt/gen_qscreen.cpp +++ b/qt/gen_qscreen.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qscreen.h" +#include #include "gen_qscreen.h" #include "_cgo_export.h" diff --git a/qt/gen_qscreen.go b/qt/gen_qscreen.go index 0b92636c..92cf46b7 100644 --- a/qt/gen_qscreen.go +++ b/qt/gen_qscreen.go @@ -26,19 +26,26 @@ func (this *QScreen) cPointer() *C.QScreen { return this.h } +func (this *QScreen) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScreen(h *C.QScreen) *QScreen { if h == nil { return nil } - return &QScreen{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QScreen{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQScreen_U(h unsafe.Pointer) *QScreen { +func UnsafeNewQScreen(h unsafe.Pointer) *QScreen { return newQScreen((*C.QScreen)(h)) } func (this *QScreen) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QScreen_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QScreen_MetaObject(this.h))) } func (this *QScreen) Metacast(param1 string) unsafe.Pointer { @@ -165,14 +172,14 @@ func (this *QScreen) VirtualSiblings() []*QScreen { _ret := make([]*QScreen, int(_ma.len)) _outCast := (*[0xffff]*C.QScreen)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQScreen_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQScreen(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QScreen) VirtualSiblingAt(point QPoint) *QScreen { - return newQScreen_U(unsafe.Pointer(C.QScreen_VirtualSiblingAt(this.h, point.cPointer()))) + return UnsafeNewQScreen(unsafe.Pointer(C.QScreen_VirtualSiblingAt(this.h, point.cPointer()))) } func (this *QScreen) VirtualSize() *QSize { @@ -275,7 +282,7 @@ func miqt_exec_callback_QScreen_GeometryChanged(cb C.intptr_t, geometry *C.QRect } // Convert all CABI parameters to Go parameters - slotval1 := newQRect_U(unsafe.Pointer(geometry)) + slotval1 := UnsafeNewQRect(unsafe.Pointer(geometry)) gofunc(slotval1) } @@ -295,7 +302,7 @@ func miqt_exec_callback_QScreen_AvailableGeometryChanged(cb C.intptr_t, geometry } // Convert all CABI parameters to Go parameters - slotval1 := newQRect_U(unsafe.Pointer(geometry)) + slotval1 := UnsafeNewQRect(unsafe.Pointer(geometry)) gofunc(slotval1) } @@ -315,7 +322,7 @@ func miqt_exec_callback_QScreen_PhysicalSizeChanged(cb C.intptr_t, size *C.QSize } // Convert all CABI parameters to Go parameters - slotval1 := newQSizeF_U(unsafe.Pointer(size)) + slotval1 := UnsafeNewQSizeF(unsafe.Pointer(size)) gofunc(slotval1) } @@ -375,7 +382,7 @@ func miqt_exec_callback_QScreen_VirtualGeometryChanged(cb C.intptr_t, rect *C.QR } // Convert all CABI parameters to Go parameters - slotval1 := newQRect_U(unsafe.Pointer(rect)) + slotval1 := UnsafeNewQRect(unsafe.Pointer(rect)) gofunc(slotval1) } diff --git a/qt/gen_qscreen.h b/qt/gen_qscreen.h index 27a1f447..0f3d67ee 100644 --- a/qt/gen_qscreen.h +++ b/qt/gen_qscreen.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qscrollarea.cpp b/qt/gen_qscrollarea.cpp index c6f44723..72d14ac0 100644 --- a/qt/gen_qscrollarea.cpp +++ b/qt/gen_qscrollarea.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qscrollarea.h" +#include #include "gen_qscrollarea.h" #include "_cgo_export.h" diff --git a/qt/gen_qscrollarea.go b/qt/gen_qscrollarea.go index 6aea3a77..ddf184b4 100644 --- a/qt/gen_qscrollarea.go +++ b/qt/gen_qscrollarea.go @@ -25,14 +25,21 @@ func (this *QScrollArea) cPointer() *C.QScrollArea { return this.h } +func (this *QScrollArea) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScrollArea(h *C.QScrollArea) *QScrollArea { if h == nil { return nil } - return &QScrollArea{h: h, QAbstractScrollArea: newQAbstractScrollArea_U(unsafe.Pointer(h))} + return &QScrollArea{h: h, QAbstractScrollArea: UnsafeNewQAbstractScrollArea(unsafe.Pointer(h))} } -func newQScrollArea_U(h unsafe.Pointer) *QScrollArea { +func UnsafeNewQScrollArea(h unsafe.Pointer) *QScrollArea { return newQScrollArea((*C.QScrollArea)(h)) } @@ -49,7 +56,7 @@ func NewQScrollArea2(parent *QWidget) *QScrollArea { } func (this *QScrollArea) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QScrollArea_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QScrollArea_MetaObject(this.h))) } func (this *QScrollArea) Metacast(param1 string) unsafe.Pointer { @@ -77,7 +84,7 @@ func QScrollArea_TrUtf8(s string) string { } func (this *QScrollArea) Widget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QScrollArea_Widget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QScrollArea_Widget(this.h))) } func (this *QScrollArea) SetWidget(widget *QWidget) { @@ -85,7 +92,7 @@ func (this *QScrollArea) SetWidget(widget *QWidget) { } func (this *QScrollArea) TakeWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QScrollArea_TakeWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QScrollArea_TakeWidget(this.h))) } func (this *QScrollArea) WidgetResizable() bool { diff --git a/qt/gen_qscrollarea.h b/qt/gen_qscrollarea.h index d84d60a1..2e814c2b 100644 --- a/qt/gen_qscrollarea.h +++ b/qt/gen_qscrollarea.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qscrollbar.cpp b/qt/gen_qscrollbar.cpp index 84bcfe75..27ebaced 100644 --- a/qt/gen_qscrollbar.cpp +++ b/qt/gen_qscrollbar.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qscrollbar.h" +#include #include "gen_qscrollbar.h" #include "_cgo_export.h" diff --git a/qt/gen_qscrollbar.go b/qt/gen_qscrollbar.go index 9e08083f..fae93495 100644 --- a/qt/gen_qscrollbar.go +++ b/qt/gen_qscrollbar.go @@ -25,14 +25,21 @@ func (this *QScrollBar) cPointer() *C.QScrollBar { return this.h } +func (this *QScrollBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScrollBar(h *C.QScrollBar) *QScrollBar { if h == nil { return nil } - return &QScrollBar{h: h, QAbstractSlider: newQAbstractSlider_U(unsafe.Pointer(h))} + return &QScrollBar{h: h, QAbstractSlider: UnsafeNewQAbstractSlider(unsafe.Pointer(h))} } -func newQScrollBar_U(h unsafe.Pointer) *QScrollBar { +func UnsafeNewQScrollBar(h unsafe.Pointer) *QScrollBar { return newQScrollBar((*C.QScrollBar)(h)) } @@ -61,7 +68,7 @@ func NewQScrollBar4(param1 Orientation, parent *QWidget) *QScrollBar { } func (this *QScrollBar) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QScrollBar_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QScrollBar_MetaObject(this.h))) } func (this *QScrollBar) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qscrollbar.h b/qt/gen_qscrollbar.h index 6d322ac0..475d0722 100644 --- a/qt/gen_qscrollbar.h +++ b/qt/gen_qscrollbar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qscroller.cpp b/qt/gen_qscroller.cpp index e1b0d013..848861d9 100644 --- a/qt/gen_qscroller.cpp +++ b/qt/gen_qscroller.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qscroller.h" +#include #include "gen_qscroller.h" #include "_cgo_export.h" @@ -107,7 +107,7 @@ QScrollerProperties* QScroller_ScrollerProperties(const QScroller* self) { } void QScroller_SetSnapPositionsX(QScroller* self, struct miqt_array* /* of double */ positions) { - QList positions_QList; + QList positions_QList; positions_QList.reserve(positions->len); double* positions_arr = static_cast(positions->data); for(size_t i = 0; i < positions->len; ++i) { @@ -121,7 +121,7 @@ void QScroller_SetSnapPositionsX2(QScroller* self, double first, double interval } void QScroller_SetSnapPositionsY(QScroller* self, struct miqt_array* /* of double */ positions) { - QList positions_QList; + QList positions_QList; positions_QList.reserve(positions->len); double* positions_arr = static_cast(positions->data); for(size_t i = 0; i < positions->len; ++i) { diff --git a/qt/gen_qscroller.go b/qt/gen_qscroller.go index 0cee778a..4c235cf3 100644 --- a/qt/gen_qscroller.go +++ b/qt/gen_qscroller.go @@ -52,19 +52,26 @@ func (this *QScroller) cPointer() *C.QScroller { return this.h } +func (this *QScroller) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScroller(h *C.QScroller) *QScroller { if h == nil { return nil } - return &QScroller{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QScroller{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQScroller_U(h unsafe.Pointer) *QScroller { +func UnsafeNewQScroller(h unsafe.Pointer) *QScroller { return newQScroller((*C.QScroller)(h)) } func (this *QScroller) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QScroller_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QScroller_MetaObject(this.h))) } func (this *QScroller) Metacast(param1 string) unsafe.Pointer { @@ -96,11 +103,11 @@ func QScroller_HasScroller(target *QObject) bool { } func QScroller_Scroller(target *QObject) *QScroller { - return newQScroller_U(unsafe.Pointer(C.QScroller_Scroller(target.cPointer()))) + return UnsafeNewQScroller(unsafe.Pointer(C.QScroller_Scroller(target.cPointer()))) } func QScroller_ScrollerWithTarget(target *QObject) *QScroller { - return newQScroller_U(unsafe.Pointer(C.QScroller_ScrollerWithTarget(target.cPointer()))) + return UnsafeNewQScroller(unsafe.Pointer(C.QScroller_ScrollerWithTarget(target.cPointer()))) } func QScroller_GrabGesture(target *QObject) GestureType { @@ -120,14 +127,14 @@ func QScroller_ActiveScrollers() []*QScroller { _ret := make([]*QScroller, int(_ma.len)) _outCast := (*[0xffff]*C.QScroller)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQScroller_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQScroller(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QScroller) Target() *QObject { - return newQObject_U(unsafe.Pointer(C.QScroller_Target(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QScroller_Target(this.h))) } func (this *QScroller) State() QScroller__State { @@ -261,7 +268,7 @@ func miqt_exec_callback_QScroller_ScrollerPropertiesChanged(cb C.intptr_t, param } // Convert all CABI parameters to Go parameters - slotval1 := newQScrollerProperties_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQScrollerProperties(unsafe.Pointer(param1)) gofunc(slotval1) } diff --git a/qt/gen_qscroller.h b/qt/gen_qscroller.h index 8e156254..12c0c515 100644 --- a/qt/gen_qscroller.h +++ b/qt/gen_qscroller.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qscrollerproperties.cpp b/qt/gen_qscrollerproperties.cpp index 9736ce44..23abe2d4 100644 --- a/qt/gen_qscrollerproperties.cpp +++ b/qt/gen_qscrollerproperties.cpp @@ -1,6 +1,6 @@ #include #include -#include "qscrollerproperties.h" +#include #include "gen_qscrollerproperties.h" #include "_cgo_export.h" diff --git a/qt/gen_qscrollerproperties.go b/qt/gen_qscrollerproperties.go index 6d2343a5..99187fb9 100644 --- a/qt/gen_qscrollerproperties.go +++ b/qt/gen_qscrollerproperties.go @@ -67,6 +67,13 @@ func (this *QScrollerProperties) cPointer() *C.QScrollerProperties { return this.h } +func (this *QScrollerProperties) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQScrollerProperties(h *C.QScrollerProperties) *QScrollerProperties { if h == nil { return nil @@ -74,7 +81,7 @@ func newQScrollerProperties(h *C.QScrollerProperties) *QScrollerProperties { return &QScrollerProperties{h: h} } -func newQScrollerProperties_U(h unsafe.Pointer) *QScrollerProperties { +func UnsafeNewQScrollerProperties(h unsafe.Pointer) *QScrollerProperties { return newQScrollerProperties((*C.QScrollerProperties)(h)) } diff --git a/qt/gen_qscrollerproperties.h b/qt/gen_qscrollerproperties.h index 5a2bf494..898cabea 100644 --- a/qt/gen_qscrollerproperties.h +++ b/qt/gen_qscrollerproperties.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsemaphore.cpp b/qt/gen_qsemaphore.cpp index 37ad754a..a0b67265 100644 --- a/qt/gen_qsemaphore.cpp +++ b/qt/gen_qsemaphore.cpp @@ -1,6 +1,6 @@ #include #include -#include "qsemaphore.h" +#include #include "gen_qsemaphore.h" #include "_cgo_export.h" diff --git a/qt/gen_qsemaphore.go b/qt/gen_qsemaphore.go index bd4d9d04..6afe3a62 100644 --- a/qt/gen_qsemaphore.go +++ b/qt/gen_qsemaphore.go @@ -24,6 +24,13 @@ func (this *QSemaphore) cPointer() *C.QSemaphore { return this.h } +func (this *QSemaphore) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSemaphore(h *C.QSemaphore) *QSemaphore { if h == nil { return nil @@ -31,7 +38,7 @@ func newQSemaphore(h *C.QSemaphore) *QSemaphore { return &QSemaphore{h: h} } -func newQSemaphore_U(h unsafe.Pointer) *QSemaphore { +func UnsafeNewQSemaphore(h unsafe.Pointer) *QSemaphore { return newQSemaphore((*C.QSemaphore)(h)) } @@ -104,6 +111,13 @@ func (this *QSemaphoreReleaser) cPointer() *C.QSemaphoreReleaser { return this.h } +func (this *QSemaphoreReleaser) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSemaphoreReleaser(h *C.QSemaphoreReleaser) *QSemaphoreReleaser { if h == nil { return nil @@ -111,7 +125,7 @@ func newQSemaphoreReleaser(h *C.QSemaphoreReleaser) *QSemaphoreReleaser { return &QSemaphoreReleaser{h: h} } -func newQSemaphoreReleaser_U(h unsafe.Pointer) *QSemaphoreReleaser { +func UnsafeNewQSemaphoreReleaser(h unsafe.Pointer) *QSemaphoreReleaser { return newQSemaphoreReleaser((*C.QSemaphoreReleaser)(h)) } @@ -150,11 +164,11 @@ func (this *QSemaphoreReleaser) Swap(other *QSemaphoreReleaser) { } func (this *QSemaphoreReleaser) Semaphore() *QSemaphore { - return newQSemaphore_U(unsafe.Pointer(C.QSemaphoreReleaser_Semaphore(this.h))) + return UnsafeNewQSemaphore(unsafe.Pointer(C.QSemaphoreReleaser_Semaphore(this.h))) } func (this *QSemaphoreReleaser) Cancel() *QSemaphore { - return newQSemaphore_U(unsafe.Pointer(C.QSemaphoreReleaser_Cancel(this.h))) + return UnsafeNewQSemaphore(unsafe.Pointer(C.QSemaphoreReleaser_Cancel(this.h))) } // Delete this object from C++ memory. diff --git a/qt/gen_qsemaphore.h b/qt/gen_qsemaphore.h index 9ee4bc16..c6577dc6 100644 --- a/qt/gen_qsemaphore.h +++ b/qt/gen_qsemaphore.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsequentialanimationgroup.cpp b/qt/gen_qsequentialanimationgroup.cpp index 34a01bd1..bcdab3f1 100644 --- a/qt/gen_qsequentialanimationgroup.cpp +++ b/qt/gen_qsequentialanimationgroup.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qsequentialanimationgroup.h" +#include #include "gen_qsequentialanimationgroup.h" #include "_cgo_export.h" diff --git a/qt/gen_qsequentialanimationgroup.go b/qt/gen_qsequentialanimationgroup.go index 2e829719..908ab7ae 100644 --- a/qt/gen_qsequentialanimationgroup.go +++ b/qt/gen_qsequentialanimationgroup.go @@ -26,14 +26,21 @@ func (this *QSequentialAnimationGroup) cPointer() *C.QSequentialAnimationGroup { return this.h } +func (this *QSequentialAnimationGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSequentialAnimationGroup(h *C.QSequentialAnimationGroup) *QSequentialAnimationGroup { if h == nil { return nil } - return &QSequentialAnimationGroup{h: h, QAnimationGroup: newQAnimationGroup_U(unsafe.Pointer(h))} + return &QSequentialAnimationGroup{h: h, QAnimationGroup: UnsafeNewQAnimationGroup(unsafe.Pointer(h))} } -func newQSequentialAnimationGroup_U(h unsafe.Pointer) *QSequentialAnimationGroup { +func UnsafeNewQSequentialAnimationGroup(h unsafe.Pointer) *QSequentialAnimationGroup { return newQSequentialAnimationGroup((*C.QSequentialAnimationGroup)(h)) } @@ -50,7 +57,7 @@ func NewQSequentialAnimationGroup2(parent *QObject) *QSequentialAnimationGroup { } func (this *QSequentialAnimationGroup) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSequentialAnimationGroup_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSequentialAnimationGroup_MetaObject(this.h))) } func (this *QSequentialAnimationGroup) Metacast(param1 string) unsafe.Pointer { @@ -78,15 +85,15 @@ func QSequentialAnimationGroup_TrUtf8(s string) string { } func (this *QSequentialAnimationGroup) AddPause(msecs int) *QPauseAnimation { - return newQPauseAnimation_U(unsafe.Pointer(C.QSequentialAnimationGroup_AddPause(this.h, (C.int)(msecs)))) + return UnsafeNewQPauseAnimation(unsafe.Pointer(C.QSequentialAnimationGroup_AddPause(this.h, (C.int)(msecs)))) } func (this *QSequentialAnimationGroup) InsertPause(index int, msecs int) *QPauseAnimation { - return newQPauseAnimation_U(unsafe.Pointer(C.QSequentialAnimationGroup_InsertPause(this.h, (C.int)(index), (C.int)(msecs)))) + return UnsafeNewQPauseAnimation(unsafe.Pointer(C.QSequentialAnimationGroup_InsertPause(this.h, (C.int)(index), (C.int)(msecs)))) } func (this *QSequentialAnimationGroup) CurrentAnimation() *QAbstractAnimation { - return newQAbstractAnimation_U(unsafe.Pointer(C.QSequentialAnimationGroup_CurrentAnimation(this.h))) + return UnsafeNewQAbstractAnimation(unsafe.Pointer(C.QSequentialAnimationGroup_CurrentAnimation(this.h))) } func (this *QSequentialAnimationGroup) Duration() int { @@ -108,7 +115,7 @@ func miqt_exec_callback_QSequentialAnimationGroup_CurrentAnimationChanged(cb C.i } // Convert all CABI parameters to Go parameters - slotval1 := newQAbstractAnimation_U(unsafe.Pointer(current)) + slotval1 := UnsafeNewQAbstractAnimation(unsafe.Pointer(current)) gofunc(slotval1) } diff --git a/qt/gen_qsequentialanimationgroup.h b/qt/gen_qsequentialanimationgroup.h index 94ad217a..cce2f476 100644 --- a/qt/gen_qsequentialanimationgroup.h +++ b/qt/gen_qsequentialanimationgroup.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsessionmanager.cpp b/qt/gen_qsessionmanager.cpp index c3ad6e2c..47d735f0 100644 --- a/qt/gen_qsessionmanager.cpp +++ b/qt/gen_qsessionmanager.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qsessionmanager.h" +#include #include "gen_qsessionmanager.h" #include "_cgo_export.h" @@ -70,7 +70,7 @@ int QSessionManager_RestartHint(const QSessionManager* self) { } void QSessionManager_SetRestartCommand(QSessionManager* self, struct miqt_array* /* of struct miqt_string* */ restartCommand) { - QList restartCommand_QList; + QStringList restartCommand_QList; restartCommand_QList.reserve(restartCommand->len); struct miqt_string** restartCommand_arr = static_cast(restartCommand->data); for(size_t i = 0; i < restartCommand->len; ++i) { @@ -97,7 +97,7 @@ struct miqt_array* QSessionManager_RestartCommand(const QSessionManager* self) { } void QSessionManager_SetDiscardCommand(QSessionManager* self, struct miqt_array* /* of struct miqt_string* */ discardCommand) { - QList discardCommand_QList; + QStringList discardCommand_QList; discardCommand_QList.reserve(discardCommand->len); struct miqt_string** discardCommand_arr = static_cast(discardCommand->data); for(size_t i = 0; i < discardCommand->len; ++i) { @@ -131,7 +131,7 @@ void QSessionManager_SetManagerProperty(QSessionManager* self, struct miqt_strin void QSessionManager_SetManagerProperty2(QSessionManager* self, struct miqt_string* name, struct miqt_array* /* of struct miqt_string* */ value) { QString name_QString = QString::fromUtf8(&name->data, name->len); - QList value_QList; + QStringList value_QList; value_QList.reserve(value->len); struct miqt_string** value_arr = static_cast(value->data); for(size_t i = 0; i < value->len; ++i) { diff --git a/qt/gen_qsessionmanager.go b/qt/gen_qsessionmanager.go index 51481a49..39dfb9f7 100644 --- a/qt/gen_qsessionmanager.go +++ b/qt/gen_qsessionmanager.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -34,19 +35,26 @@ func (this *QSessionManager) cPointer() *C.QSessionManager { return this.h } +func (this *QSessionManager) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSessionManager(h *C.QSessionManager) *QSessionManager { if h == nil { return nil } - return &QSessionManager{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QSessionManager{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQSessionManager_U(h unsafe.Pointer) *QSessionManager { +func UnsafeNewQSessionManager(h unsafe.Pointer) *QSessionManager { return newQSessionManager((*C.QSessionManager)(h)) } func (this *QSessionManager) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSessionManager_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSessionManager_MetaObject(this.h))) } func (this *QSessionManager) Metacast(param1 string) unsafe.Pointer { @@ -116,7 +124,7 @@ func (this *QSessionManager) SetRestartCommand(restartCommand []string) { restartCommand_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(restartCommand)))) defer C.free(unsafe.Pointer(restartCommand_CArray)) for i := range restartCommand { - restartCommand_i_ms := miqt_strdupg(restartCommand[i]) + restartCommand_i_ms := libmiqt.Strdupg(restartCommand[i]) defer C.free(restartCommand_i_ms) restartCommand_CArray[i] = (*C.struct_miqt_string)(restartCommand_i_ms) } @@ -144,7 +152,7 @@ func (this *QSessionManager) SetDiscardCommand(discardCommand []string) { discardCommand_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(discardCommand)))) defer C.free(unsafe.Pointer(discardCommand_CArray)) for i := range discardCommand { - discardCommand_i_ms := miqt_strdupg(discardCommand[i]) + discardCommand_i_ms := libmiqt.Strdupg(discardCommand[i]) defer C.free(discardCommand_i_ms) discardCommand_CArray[i] = (*C.struct_miqt_string)(discardCommand_i_ms) } @@ -168,21 +176,21 @@ func (this *QSessionManager) DiscardCommand() []string { } func (this *QSessionManager) SetManagerProperty(name string, value string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) C.QSessionManager_SetManagerProperty(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(value_ms)) } func (this *QSessionManager) SetManagerProperty2(name string, value []string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) // For the C ABI, malloc a C array of raw pointers value_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(value)))) defer C.free(unsafe.Pointer(value_CArray)) for i := range value { - value_i_ms := miqt_strdupg(value[i]) + value_i_ms := libmiqt.Strdupg(value[i]) defer C.free(value_i_ms) value_CArray[i] = (*C.struct_miqt_string)(value_i_ms) } diff --git a/qt/gen_qsessionmanager.h b/qt/gen_qsessionmanager.h index 210b2c12..f2283e5a 100644 --- a/qt/gen_qsessionmanager.h +++ b/qt/gen_qsessionmanager.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsettings.cpp b/qt/gen_qsettings.cpp index 1c7271f7..d61fd295 100644 --- a/qt/gen_qsettings.cpp +++ b/qt/gen_qsettings.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qsettings.h" +#include #include "gen_qsettings.h" #include "_cgo_export.h" diff --git a/qt/gen_qsettings.go b/qt/gen_qsettings.go index 45bde62a..4326574d 100644 --- a/qt/gen_qsettings.go +++ b/qt/gen_qsettings.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -64,20 +65,27 @@ func (this *QSettings) cPointer() *C.QSettings { return this.h } +func (this *QSettings) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSettings(h *C.QSettings) *QSettings { if h == nil { return nil } - return &QSettings{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QSettings{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQSettings_U(h unsafe.Pointer) *QSettings { +func UnsafeNewQSettings(h unsafe.Pointer) *QSettings { return newQSettings((*C.QSettings)(h)) } // NewQSettings constructs a new QSettings object. func NewQSettings(organization string) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) ret := C.QSettings_new((*C.struct_miqt_string)(organization_ms)) return newQSettings(ret) @@ -85,7 +93,7 @@ func NewQSettings(organization string) *QSettings { // NewQSettings2 constructs a new QSettings object. func NewQSettings2(scope QSettings__Scope, organization string) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) ret := C.QSettings_new2((C.int)(scope), (*C.struct_miqt_string)(organization_ms)) return newQSettings(ret) @@ -93,7 +101,7 @@ func NewQSettings2(scope QSettings__Scope, organization string) *QSettings { // NewQSettings3 constructs a new QSettings object. func NewQSettings3(format QSettings__Format, scope QSettings__Scope, organization string) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) ret := C.QSettings_new3((C.int)(format), (C.int)(scope), (*C.struct_miqt_string)(organization_ms)) return newQSettings(ret) @@ -101,7 +109,7 @@ func NewQSettings3(format QSettings__Format, scope QSettings__Scope, organizatio // NewQSettings4 constructs a new QSettings object. func NewQSettings4(fileName string, format QSettings__Format) *QSettings { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QSettings_new4((*C.struct_miqt_string)(fileName_ms), (C.int)(format)) return newQSettings(ret) @@ -121,9 +129,9 @@ func NewQSettings6(scope QSettings__Scope) *QSettings { // NewQSettings7 constructs a new QSettings object. func NewQSettings7(organization string, application string) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) - application_ms := miqt_strdupg(application) + application_ms := libmiqt.Strdupg(application) defer C.free(application_ms) ret := C.QSettings_new7((*C.struct_miqt_string)(organization_ms), (*C.struct_miqt_string)(application_ms)) return newQSettings(ret) @@ -131,9 +139,9 @@ func NewQSettings7(organization string, application string) *QSettings { // NewQSettings8 constructs a new QSettings object. func NewQSettings8(organization string, application string, parent *QObject) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) - application_ms := miqt_strdupg(application) + application_ms := libmiqt.Strdupg(application) defer C.free(application_ms) ret := C.QSettings_new8((*C.struct_miqt_string)(organization_ms), (*C.struct_miqt_string)(application_ms), parent.cPointer()) return newQSettings(ret) @@ -141,9 +149,9 @@ func NewQSettings8(organization string, application string, parent *QObject) *QS // NewQSettings9 constructs a new QSettings object. func NewQSettings9(scope QSettings__Scope, organization string, application string) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) - application_ms := miqt_strdupg(application) + application_ms := libmiqt.Strdupg(application) defer C.free(application_ms) ret := C.QSettings_new9((C.int)(scope), (*C.struct_miqt_string)(organization_ms), (*C.struct_miqt_string)(application_ms)) return newQSettings(ret) @@ -151,9 +159,9 @@ func NewQSettings9(scope QSettings__Scope, organization string, application stri // NewQSettings10 constructs a new QSettings object. func NewQSettings10(scope QSettings__Scope, organization string, application string, parent *QObject) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) - application_ms := miqt_strdupg(application) + application_ms := libmiqt.Strdupg(application) defer C.free(application_ms) ret := C.QSettings_new10((C.int)(scope), (*C.struct_miqt_string)(organization_ms), (*C.struct_miqt_string)(application_ms), parent.cPointer()) return newQSettings(ret) @@ -161,9 +169,9 @@ func NewQSettings10(scope QSettings__Scope, organization string, application str // NewQSettings11 constructs a new QSettings object. func NewQSettings11(format QSettings__Format, scope QSettings__Scope, organization string, application string) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) - application_ms := miqt_strdupg(application) + application_ms := libmiqt.Strdupg(application) defer C.free(application_ms) ret := C.QSettings_new11((C.int)(format), (C.int)(scope), (*C.struct_miqt_string)(organization_ms), (*C.struct_miqt_string)(application_ms)) return newQSettings(ret) @@ -171,9 +179,9 @@ func NewQSettings11(format QSettings__Format, scope QSettings__Scope, organizati // NewQSettings12 constructs a new QSettings object. func NewQSettings12(format QSettings__Format, scope QSettings__Scope, organization string, application string, parent *QObject) *QSettings { - organization_ms := miqt_strdupg(organization) + organization_ms := libmiqt.Strdupg(organization) defer C.free(organization_ms) - application_ms := miqt_strdupg(application) + application_ms := libmiqt.Strdupg(application) defer C.free(application_ms) ret := C.QSettings_new12((C.int)(format), (C.int)(scope), (*C.struct_miqt_string)(organization_ms), (*C.struct_miqt_string)(application_ms), parent.cPointer()) return newQSettings(ret) @@ -181,7 +189,7 @@ func NewQSettings12(format QSettings__Format, scope QSettings__Scope, organizati // NewQSettings13 constructs a new QSettings object. func NewQSettings13(fileName string, format QSettings__Format, parent *QObject) *QSettings { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QSettings_new13((*C.struct_miqt_string)(fileName_ms), (C.int)(format), parent.cPointer()) return newQSettings(ret) @@ -200,7 +208,7 @@ func NewQSettings15(scope QSettings__Scope, parent *QObject) *QSettings { } func (this *QSettings) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSettings_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSettings_MetaObject(this.h))) } func (this *QSettings) Metacast(param1 string) unsafe.Pointer { @@ -248,7 +256,7 @@ func (this *QSettings) SetAtomicSyncRequired(enable bool) { } func (this *QSettings) BeginGroup(prefix string) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) C.QSettings_BeginGroup(this.h, (*C.struct_miqt_string)(prefix_ms)) } @@ -265,13 +273,13 @@ func (this *QSettings) Group() string { } func (this *QSettings) BeginReadArray(prefix string) int { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) return (int)(C.QSettings_BeginReadArray(this.h, (*C.struct_miqt_string)(prefix_ms))) } func (this *QSettings) BeginWriteArray(prefix string) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) C.QSettings_BeginWriteArray(this.h, (*C.struct_miqt_string)(prefix_ms)) } @@ -331,13 +339,13 @@ func (this *QSettings) IsWritable() bool { } func (this *QSettings) SetValue(key string, value *QVariant) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QSettings_SetValue(this.h, (*C.struct_miqt_string)(key_ms), value.cPointer()) } func (this *QSettings) Value(key string) *QVariant { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QSettings_Value(this.h, (*C.struct_miqt_string)(key_ms)) _goptr := newQVariant(_ret) @@ -346,13 +354,13 @@ func (this *QSettings) Value(key string) *QVariant { } func (this *QSettings) Remove(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QSettings_Remove(this.h, (*C.struct_miqt_string)(key_ms)) } func (this *QSettings) Contains(key string) bool { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) return (bool)(C.QSettings_Contains(this.h, (*C.struct_miqt_string)(key_ms))) } @@ -405,7 +413,7 @@ func (this *QSettings) SetIniCodecWithCodecName(codecName string) { } func (this *QSettings) IniCodec() *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QSettings_IniCodec(this.h))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QSettings_IniCodec(this.h))) } func QSettings_SetDefaultFormat(format QSettings__Format) { @@ -417,19 +425,19 @@ func QSettings_DefaultFormat() QSettings__Format { } func QSettings_SetSystemIniPath(dir string) { - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) C.QSettings_SetSystemIniPath((*C.struct_miqt_string)(dir_ms)) } func QSettings_SetUserIniPath(dir string) { - dir_ms := miqt_strdupg(dir) + dir_ms := libmiqt.Strdupg(dir) defer C.free(dir_ms) C.QSettings_SetUserIniPath((*C.struct_miqt_string)(dir_ms)) } func QSettings_SetPath(format QSettings__Format, scope QSettings__Scope, path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QSettings_SetPath((C.int)(format), (C.int)(scope), (*C.struct_miqt_string)(path_ms)) } @@ -479,13 +487,13 @@ func QSettings_TrUtf83(s string, c string, n int) string { } func (this *QSettings) BeginWriteArray2(prefix string, size int) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) C.QSettings_BeginWriteArray2(this.h, (*C.struct_miqt_string)(prefix_ms), (C.int)(size)) } func (this *QSettings) Value2(key string, defaultValue *QVariant) *QVariant { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) _ret := C.QSettings_Value2(this.h, (*C.struct_miqt_string)(key_ms), defaultValue.cPointer()) _goptr := newQVariant(_ret) diff --git a/qt/gen_qsettings.h b/qt/gen_qsettings.h index 7c41c7bd..554f2c30 100644 --- a/qt/gen_qsettings.h +++ b/qt/gen_qsettings.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qshareddata.cpp b/qt/gen_qshareddata.cpp index 0c03000f..c85e3f8c 100644 --- a/qt/gen_qshareddata.cpp +++ b/qt/gen_qshareddata.cpp @@ -1,5 +1,5 @@ #include -#include "qshareddata.h" +#include #include "gen_qshareddata.h" #include "_cgo_export.h" diff --git a/qt/gen_qshareddata.go b/qt/gen_qshareddata.go index 3edf082b..05724641 100644 --- a/qt/gen_qshareddata.go +++ b/qt/gen_qshareddata.go @@ -24,6 +24,13 @@ func (this *QSharedData) cPointer() *C.QSharedData { return this.h } +func (this *QSharedData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSharedData(h *C.QSharedData) *QSharedData { if h == nil { return nil @@ -31,7 +38,7 @@ func newQSharedData(h *C.QSharedData) *QSharedData { return &QSharedData{h: h} } -func newQSharedData_U(h unsafe.Pointer) *QSharedData { +func UnsafeNewQSharedData(h unsafe.Pointer) *QSharedData { return newQSharedData((*C.QSharedData)(h)) } diff --git a/qt/gen_qshareddata.h b/qt/gen_qshareddata.h index 69e280d3..355501c7 100644 --- a/qt/gen_qshareddata.h +++ b/qt/gen_qshareddata.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsharedmemory.cpp b/qt/gen_qsharedmemory.cpp index d3e42435..80c0866e 100644 --- a/qt/gen_qsharedmemory.cpp +++ b/qt/gen_qsharedmemory.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qsharedmemory.h" +#include #include "gen_qsharedmemory.h" #include "_cgo_export.h" diff --git a/qt/gen_qsharedmemory.go b/qt/gen_qsharedmemory.go index 3008ed83..d5eafb39 100644 --- a/qt/gen_qsharedmemory.go +++ b/qt/gen_qsharedmemory.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -46,14 +47,21 @@ func (this *QSharedMemory) cPointer() *C.QSharedMemory { return this.h } +func (this *QSharedMemory) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSharedMemory(h *C.QSharedMemory) *QSharedMemory { if h == nil { return nil } - return &QSharedMemory{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QSharedMemory{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQSharedMemory_U(h unsafe.Pointer) *QSharedMemory { +func UnsafeNewQSharedMemory(h unsafe.Pointer) *QSharedMemory { return newQSharedMemory((*C.QSharedMemory)(h)) } @@ -65,7 +73,7 @@ func NewQSharedMemory() *QSharedMemory { // NewQSharedMemory2 constructs a new QSharedMemory object. func NewQSharedMemory2(key string) *QSharedMemory { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QSharedMemory_new2((*C.struct_miqt_string)(key_ms)) return newQSharedMemory(ret) @@ -79,14 +87,14 @@ func NewQSharedMemory3(parent *QObject) *QSharedMemory { // NewQSharedMemory4 constructs a new QSharedMemory object. func NewQSharedMemory4(key string, parent *QObject) *QSharedMemory { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QSharedMemory_new4((*C.struct_miqt_string)(key_ms), parent.cPointer()) return newQSharedMemory(ret) } func (this *QSharedMemory) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSharedMemory_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSharedMemory_MetaObject(this.h))) } func (this *QSharedMemory) Metacast(param1 string) unsafe.Pointer { @@ -114,7 +122,7 @@ func QSharedMemory_TrUtf8(s string) string { } func (this *QSharedMemory) SetKey(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QSharedMemory_SetKey(this.h, (*C.struct_miqt_string)(key_ms)) } @@ -127,7 +135,7 @@ func (this *QSharedMemory) Key() string { } func (this *QSharedMemory) SetNativeKey(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QSharedMemory_SetNativeKey(this.h, (*C.struct_miqt_string)(key_ms)) } diff --git a/qt/gen_qsharedmemory.h b/qt/gen_qsharedmemory.h index edf223a4..17ccca49 100644 --- a/qt/gen_qsharedmemory.h +++ b/qt/gen_qsharedmemory.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qshortcut.cpp b/qt/gen_qshortcut.cpp index 41740bb0..36bfb7cd 100644 --- a/qt/gen_qshortcut.cpp +++ b/qt/gen_qshortcut.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qshortcut.h" +#include #include "gen_qshortcut.h" #include "_cgo_export.h" diff --git a/qt/gen_qshortcut.go b/qt/gen_qshortcut.go index bc7afe6b..0a2eceb8 100644 --- a/qt/gen_qshortcut.go +++ b/qt/gen_qshortcut.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QShortcut) cPointer() *C.QShortcut { return this.h } +func (this *QShortcut) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQShortcut(h *C.QShortcut) *QShortcut { if h == nil { return nil } - return &QShortcut{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QShortcut{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQShortcut_U(h unsafe.Pointer) *QShortcut { +func UnsafeNewQShortcut(h unsafe.Pointer) *QShortcut { return newQShortcut((*C.QShortcut)(h)) } @@ -78,7 +86,7 @@ func NewQShortcut5(key *QKeySequence, parent *QWidget, member string, ambiguousM } func (this *QShortcut) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QShortcut_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QShortcut_MetaObject(this.h))) } func (this *QShortcut) Metacast(param1 string) unsafe.Pointer { @@ -133,7 +141,7 @@ func (this *QShortcut) Context() ShortcutContext { } func (this *QShortcut) SetWhatsThis(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QShortcut_SetWhatsThis(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -158,7 +166,7 @@ func (this *QShortcut) Id() int { } func (this *QShortcut) ParentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QShortcut_ParentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QShortcut_ParentWidget(this.h))) } func (this *QShortcut) Activated() { diff --git a/qt/gen_qshortcut.h b/qt/gen_qshortcut.h index 11059c1c..a5bee2a7 100644 --- a/qt/gen_qshortcut.h +++ b/qt/gen_qshortcut.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsignalmapper.cpp b/qt/gen_qsignalmapper.cpp index b5a8dfc6..fb90c73a 100644 --- a/qt/gen_qsignalmapper.cpp +++ b/qt/gen_qsignalmapper.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qsignalmapper.h" +#include #include "gen_qsignalmapper.h" #include "_cgo_export.h" diff --git a/qt/gen_qsignalmapper.go b/qt/gen_qsignalmapper.go index 725af0ce..87074d04 100644 --- a/qt/gen_qsignalmapper.go +++ b/qt/gen_qsignalmapper.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QSignalMapper) cPointer() *C.QSignalMapper { return this.h } +func (this *QSignalMapper) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSignalMapper(h *C.QSignalMapper) *QSignalMapper { if h == nil { return nil } - return &QSignalMapper{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QSignalMapper{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQSignalMapper_U(h unsafe.Pointer) *QSignalMapper { +func UnsafeNewQSignalMapper(h unsafe.Pointer) *QSignalMapper { return newQSignalMapper((*C.QSignalMapper)(h)) } @@ -50,7 +58,7 @@ func NewQSignalMapper2(parent *QObject) *QSignalMapper { } func (this *QSignalMapper) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSignalMapper_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSignalMapper_MetaObject(this.h))) } func (this *QSignalMapper) Metacast(param1 string) unsafe.Pointer { @@ -82,7 +90,7 @@ func (this *QSignalMapper) SetMapping(sender *QObject, id int) { } func (this *QSignalMapper) SetMapping2(sender *QObject, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QSignalMapper_SetMapping2(this.h, sender.cPointer(), (*C.struct_miqt_string)(text_ms)) } @@ -100,21 +108,21 @@ func (this *QSignalMapper) RemoveMappings(sender *QObject) { } func (this *QSignalMapper) Mapping(id int) *QObject { - return newQObject_U(unsafe.Pointer(C.QSignalMapper_Mapping(this.h, (C.int)(id)))) + return UnsafeNewQObject(unsafe.Pointer(C.QSignalMapper_Mapping(this.h, (C.int)(id)))) } func (this *QSignalMapper) MappingWithText(text string) *QObject { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQObject_U(unsafe.Pointer(C.QSignalMapper_MappingWithText(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQObject(unsafe.Pointer(C.QSignalMapper_MappingWithText(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QSignalMapper) MappingWithWidget(widget *QWidget) *QObject { - return newQObject_U(unsafe.Pointer(C.QSignalMapper_MappingWithWidget(this.h, widget.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QSignalMapper_MappingWithWidget(this.h, widget.cPointer()))) } func (this *QSignalMapper) MappingWithObject(object *QObject) *QObject { - return newQObject_U(unsafe.Pointer(C.QSignalMapper_MappingWithObject(this.h, object.cPointer()))) + return UnsafeNewQObject(unsafe.Pointer(C.QSignalMapper_MappingWithObject(this.h, object.cPointer()))) } func (this *QSignalMapper) Mapped(param1 int) { @@ -138,7 +146,7 @@ func miqt_exec_callback_QSignalMapper_Mapped(cb C.intptr_t, param1 C.int) { } func (this *QSignalMapper) MappedWithQString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QSignalMapper_MappedWithQString(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -177,7 +185,7 @@ func miqt_exec_callback_QSignalMapper_MappedWithQWidget(cb C.intptr_t, param1 *C } // Convert all CABI parameters to Go parameters - slotval1 := newQWidget_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQWidget(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -197,7 +205,7 @@ func miqt_exec_callback_QSignalMapper_MappedWithQObject(cb C.intptr_t, param1 *C } // Convert all CABI parameters to Go parameters - slotval1 := newQObject_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQObject(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -223,7 +231,7 @@ func miqt_exec_callback_QSignalMapper_MappedInt(cb C.intptr_t, param1 C.int) { } func (this *QSignalMapper) MappedString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QSignalMapper_MappedString(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -262,7 +270,7 @@ func miqt_exec_callback_QSignalMapper_MappedWidget(cb C.intptr_t, param1 *C.QWid } // Convert all CABI parameters to Go parameters - slotval1 := newQWidget_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQWidget(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -282,7 +290,7 @@ func miqt_exec_callback_QSignalMapper_MappedObject(cb C.intptr_t, param1 *C.QObj } // Convert all CABI parameters to Go parameters - slotval1 := newQObject_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQObject(unsafe.Pointer(param1)) gofunc(slotval1) } diff --git a/qt/gen_qsignalmapper.h b/qt/gen_qsignalmapper.h index d5db7861..0ed3774f 100644 --- a/qt/gen_qsignalmapper.h +++ b/qt/gen_qsignalmapper.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsignaltransition.cpp b/qt/gen_qsignaltransition.cpp index 89a57b66..82048e68 100644 --- a/qt/gen_qsignaltransition.cpp +++ b/qt/gen_qsignaltransition.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qsignaltransition.h" +#include #include "gen_qsignaltransition.h" #include "_cgo_export.h" diff --git a/qt/gen_qsignaltransition.go b/qt/gen_qsignaltransition.go index 97867da1..a72b1b7f 100644 --- a/qt/gen_qsignaltransition.go +++ b/qt/gen_qsignaltransition.go @@ -25,14 +25,21 @@ func (this *QSignalTransition) cPointer() *C.QSignalTransition { return this.h } +func (this *QSignalTransition) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSignalTransition(h *C.QSignalTransition) *QSignalTransition { if h == nil { return nil } - return &QSignalTransition{h: h, QAbstractTransition: newQAbstractTransition_U(unsafe.Pointer(h))} + return &QSignalTransition{h: h, QAbstractTransition: UnsafeNewQAbstractTransition(unsafe.Pointer(h))} } -func newQSignalTransition_U(h unsafe.Pointer) *QSignalTransition { +func UnsafeNewQSignalTransition(h unsafe.Pointer) *QSignalTransition { return newQSignalTransition((*C.QSignalTransition)(h)) } @@ -65,7 +72,7 @@ func NewQSignalTransition4(sender *QObject, signal string, sourceState *QState) } func (this *QSignalTransition) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSignalTransition_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSignalTransition_MetaObject(this.h))) } func (this *QSignalTransition) Metacast(param1 string) unsafe.Pointer { @@ -93,7 +100,7 @@ func QSignalTransition_TrUtf8(s string) string { } func (this *QSignalTransition) SenderObject() *QObject { - return newQObject_U(unsafe.Pointer(C.QSignalTransition_SenderObject(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QSignalTransition_SenderObject(this.h))) } func (this *QSignalTransition) SetSenderObject(sender *QObject) { diff --git a/qt/gen_qsignaltransition.h b/qt/gen_qsignaltransition.h index 60171c58..217773d9 100644 --- a/qt/gen_qsignaltransition.h +++ b/qt/gen_qsignaltransition.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsize.cpp b/qt/gen_qsize.cpp index 0d740dd2..fc723ff2 100644 --- a/qt/gen_qsize.cpp +++ b/qt/gen_qsize.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qsize.h" +#include #include "gen_qsize.h" #include "_cgo_export.h" diff --git a/qt/gen_qsize.go b/qt/gen_qsize.go index 1ee353e4..f1eedc67 100644 --- a/qt/gen_qsize.go +++ b/qt/gen_qsize.go @@ -24,6 +24,13 @@ func (this *QSize) cPointer() *C.QSize { return this.h } +func (this *QSize) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSize(h *C.QSize) *QSize { if h == nil { return nil @@ -31,7 +38,7 @@ func newQSize(h *C.QSize) *QSize { return &QSize{h: h} } -func newQSize_U(h unsafe.Pointer) *QSize { +func UnsafeNewQSize(h unsafe.Pointer) *QSize { return newQSize((*C.QSize)(h)) } @@ -143,19 +150,19 @@ func (this *QSize) ShrunkBy(m QMargins) *QSize { } func (this *QSize) OperatorPlusAssign(param1 *QSize) *QSize { - return newQSize_U(unsafe.Pointer(C.QSize_OperatorPlusAssign(this.h, param1.cPointer()))) + return UnsafeNewQSize(unsafe.Pointer(C.QSize_OperatorPlusAssign(this.h, param1.cPointer()))) } func (this *QSize) OperatorMinusAssign(param1 *QSize) *QSize { - return newQSize_U(unsafe.Pointer(C.QSize_OperatorMinusAssign(this.h, param1.cPointer()))) + return UnsafeNewQSize(unsafe.Pointer(C.QSize_OperatorMinusAssign(this.h, param1.cPointer()))) } func (this *QSize) OperatorMultiplyAssign(c float64) *QSize { - return newQSize_U(unsafe.Pointer(C.QSize_OperatorMultiplyAssign(this.h, (C.double)(c)))) + return UnsafeNewQSize(unsafe.Pointer(C.QSize_OperatorMultiplyAssign(this.h, (C.double)(c)))) } func (this *QSize) OperatorDivideAssign(c float64) *QSize { - return newQSize_U(unsafe.Pointer(C.QSize_OperatorDivideAssign(this.h, (C.double)(c)))) + return UnsafeNewQSize(unsafe.Pointer(C.QSize_OperatorDivideAssign(this.h, (C.double)(c)))) } // Delete this object from C++ memory. @@ -183,6 +190,13 @@ func (this *QSizeF) cPointer() *C.QSizeF { return this.h } +func (this *QSizeF) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSizeF(h *C.QSizeF) *QSizeF { if h == nil { return nil @@ -190,7 +204,7 @@ func newQSizeF(h *C.QSizeF) *QSizeF { return &QSizeF{h: h} } -func newQSizeF_U(h unsafe.Pointer) *QSizeF { +func UnsafeNewQSizeF(h unsafe.Pointer) *QSizeF { return newQSizeF((*C.QSizeF)(h)) } @@ -308,19 +322,19 @@ func (this *QSizeF) ShrunkBy(m QMarginsF) *QSizeF { } func (this *QSizeF) OperatorPlusAssign(param1 *QSizeF) *QSizeF { - return newQSizeF_U(unsafe.Pointer(C.QSizeF_OperatorPlusAssign(this.h, param1.cPointer()))) + return UnsafeNewQSizeF(unsafe.Pointer(C.QSizeF_OperatorPlusAssign(this.h, param1.cPointer()))) } func (this *QSizeF) OperatorMinusAssign(param1 *QSizeF) *QSizeF { - return newQSizeF_U(unsafe.Pointer(C.QSizeF_OperatorMinusAssign(this.h, param1.cPointer()))) + return UnsafeNewQSizeF(unsafe.Pointer(C.QSizeF_OperatorMinusAssign(this.h, param1.cPointer()))) } func (this *QSizeF) OperatorMultiplyAssign(c float64) *QSizeF { - return newQSizeF_U(unsafe.Pointer(C.QSizeF_OperatorMultiplyAssign(this.h, (C.double)(c)))) + return UnsafeNewQSizeF(unsafe.Pointer(C.QSizeF_OperatorMultiplyAssign(this.h, (C.double)(c)))) } func (this *QSizeF) OperatorDivideAssign(c float64) *QSizeF { - return newQSizeF_U(unsafe.Pointer(C.QSizeF_OperatorDivideAssign(this.h, (C.double)(c)))) + return UnsafeNewQSizeF(unsafe.Pointer(C.QSizeF_OperatorDivideAssign(this.h, (C.double)(c)))) } func (this *QSizeF) ToSize() *QSize { diff --git a/qt/gen_qsize.h b/qt/gen_qsize.h index 4fcddd74..9d9213d4 100644 --- a/qt/gen_qsize.h +++ b/qt/gen_qsize.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsizegrip.cpp b/qt/gen_qsizegrip.cpp index 70038cb9..8cf50755 100644 --- a/qt/gen_qsizegrip.cpp +++ b/qt/gen_qsizegrip.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qsizegrip.h" +#include #include "gen_qsizegrip.h" #include "_cgo_export.h" diff --git a/qt/gen_qsizegrip.go b/qt/gen_qsizegrip.go index dc04cbf8..65ecb96e 100644 --- a/qt/gen_qsizegrip.go +++ b/qt/gen_qsizegrip.go @@ -25,14 +25,21 @@ func (this *QSizeGrip) cPointer() *C.QSizeGrip { return this.h } +func (this *QSizeGrip) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSizeGrip(h *C.QSizeGrip) *QSizeGrip { if h == nil { return nil } - return &QSizeGrip{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QSizeGrip{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQSizeGrip_U(h unsafe.Pointer) *QSizeGrip { +func UnsafeNewQSizeGrip(h unsafe.Pointer) *QSizeGrip { return newQSizeGrip((*C.QSizeGrip)(h)) } @@ -43,7 +50,7 @@ func NewQSizeGrip(parent *QWidget) *QSizeGrip { } func (this *QSizeGrip) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSizeGrip_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSizeGrip_MetaObject(this.h))) } func (this *QSizeGrip) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qsizegrip.h b/qt/gen_qsizegrip.h index 7b27097c..3459ce59 100644 --- a/qt/gen_qsizegrip.h +++ b/qt/gen_qsizegrip.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsizepolicy.cpp b/qt/gen_qsizepolicy.cpp index f35730fd..b332a145 100644 --- a/qt/gen_qsizepolicy.cpp +++ b/qt/gen_qsizepolicy.cpp @@ -1,5 +1,5 @@ #include -#include "qsizepolicy.h" +#include #include "gen_qsizepolicy.h" #include "_cgo_export.h" diff --git a/qt/gen_qsizepolicy.go b/qt/gen_qsizepolicy.go index a59f69ce..433b7f24 100644 --- a/qt/gen_qsizepolicy.go +++ b/qt/gen_qsizepolicy.go @@ -65,6 +65,13 @@ func (this *QSizePolicy) cPointer() *C.QSizePolicy { return this.h } +func (this *QSizePolicy) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSizePolicy(h *C.QSizePolicy) *QSizePolicy { if h == nil { return nil @@ -72,7 +79,7 @@ func newQSizePolicy(h *C.QSizePolicy) *QSizePolicy { return &QSizePolicy{h: h} } -func newQSizePolicy_U(h unsafe.Pointer) *QSizePolicy { +func UnsafeNewQSizePolicy(h unsafe.Pointer) *QSizePolicy { return newQSizePolicy((*C.QSizePolicy)(h)) } diff --git a/qt/gen_qsizepolicy.h b/qt/gen_qsizepolicy.h index f312b881..6ead5792 100644 --- a/qt/gen_qsizepolicy.h +++ b/qt/gen_qsizepolicy.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qslider.cpp b/qt/gen_qslider.cpp index c3bfccc0..39421136 100644 --- a/qt/gen_qslider.cpp +++ b/qt/gen_qslider.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qslider.h" +#include #include "gen_qslider.h" #include "_cgo_export.h" diff --git a/qt/gen_qslider.go b/qt/gen_qslider.go index decc09eb..fd97ec4b 100644 --- a/qt/gen_qslider.go +++ b/qt/gen_qslider.go @@ -36,14 +36,21 @@ func (this *QSlider) cPointer() *C.QSlider { return this.h } +func (this *QSlider) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSlider(h *C.QSlider) *QSlider { if h == nil { return nil } - return &QSlider{h: h, QAbstractSlider: newQAbstractSlider_U(unsafe.Pointer(h))} + return &QSlider{h: h, QAbstractSlider: UnsafeNewQAbstractSlider(unsafe.Pointer(h))} } -func newQSlider_U(h unsafe.Pointer) *QSlider { +func UnsafeNewQSlider(h unsafe.Pointer) *QSlider { return newQSlider((*C.QSlider)(h)) } @@ -72,7 +79,7 @@ func NewQSlider4(orientation Orientation, parent *QWidget) *QSlider { } func (this *QSlider) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSlider_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSlider_MetaObject(this.h))) } func (this *QSlider) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qslider.h b/qt/gen_qslider.h index 27806ddb..ebf84ff5 100644 --- a/qt/gen_qslider.h +++ b/qt/gen_qslider.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsocketnotifier.cpp b/qt/gen_qsocketnotifier.cpp index 58add22f..123f5b6e 100644 --- a/qt/gen_qsocketnotifier.cpp +++ b/qt/gen_qsocketnotifier.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qsocketnotifier.h" +#include #include "gen_qsocketnotifier.h" #include "_cgo_export.h" diff --git a/qt/gen_qsocketnotifier.go b/qt/gen_qsocketnotifier.go index 0479a5e0..278b9dc0 100644 --- a/qt/gen_qsocketnotifier.go +++ b/qt/gen_qsocketnotifier.go @@ -33,14 +33,21 @@ func (this *QSocketNotifier) cPointer() *C.QSocketNotifier { return this.h } +func (this *QSocketNotifier) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSocketNotifier(h *C.QSocketNotifier) *QSocketNotifier { if h == nil { return nil } - return &QSocketNotifier{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QSocketNotifier{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQSocketNotifier_U(h unsafe.Pointer) *QSocketNotifier { +func UnsafeNewQSocketNotifier(h unsafe.Pointer) *QSocketNotifier { return newQSocketNotifier((*C.QSocketNotifier)(h)) } @@ -57,7 +64,7 @@ func NewQSocketNotifier2(socket uintptr, param2 QSocketNotifier__Type, parent *Q } func (this *QSocketNotifier) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSocketNotifier_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSocketNotifier_MetaObject(this.h))) } func (this *QSocketNotifier) Metacast(param1 string) unsafe.Pointer { @@ -169,6 +176,13 @@ func (this *QSocketDescriptor) cPointer() *C.QSocketDescriptor { return this.h } +func (this *QSocketDescriptor) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSocketDescriptor(h *C.QSocketDescriptor) *QSocketDescriptor { if h == nil { return nil @@ -176,7 +190,7 @@ func newQSocketDescriptor(h *C.QSocketDescriptor) *QSocketDescriptor { return &QSocketDescriptor{h: h} } -func newQSocketDescriptor_U(h unsafe.Pointer) *QSocketDescriptor { +func UnsafeNewQSocketDescriptor(h unsafe.Pointer) *QSocketDescriptor { return newQSocketDescriptor((*C.QSocketDescriptor)(h)) } diff --git a/qt/gen_qsocketnotifier.h b/qt/gen_qsocketnotifier.h index 96813ce2..1d1249cf 100644 --- a/qt/gen_qsocketnotifier.h +++ b/qt/gen_qsocketnotifier.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsortfilterproxymodel.cpp b/qt/gen_qsortfilterproxymodel.cpp index e921fb78..66614934 100644 --- a/qt/gen_qsortfilterproxymodel.cpp +++ b/qt/gen_qsortfilterproxymodel.cpp @@ -12,7 +12,7 @@ #include #include #include -#include "qsortfilterproxymodel.h" +#include #include "gen_qsortfilterproxymodel.h" #include "_cgo_export.h" @@ -218,7 +218,7 @@ bool QSortFilterProxyModel_SetHeaderData(QSortFilterProxyModel* self, int sectio } QMimeData* QSortFilterProxyModel_MimeData(const QSortFilterProxyModel* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { diff --git a/qt/gen_qsortfilterproxymodel.go b/qt/gen_qsortfilterproxymodel.go index ab38bc9b..edeeff86 100644 --- a/qt/gen_qsortfilterproxymodel.go +++ b/qt/gen_qsortfilterproxymodel.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QSortFilterProxyModel) cPointer() *C.QSortFilterProxyModel { return this.h } +func (this *QSortFilterProxyModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSortFilterProxyModel(h *C.QSortFilterProxyModel) *QSortFilterProxyModel { if h == nil { return nil } - return &QSortFilterProxyModel{h: h, QAbstractProxyModel: newQAbstractProxyModel_U(unsafe.Pointer(h))} + return &QSortFilterProxyModel{h: h, QAbstractProxyModel: UnsafeNewQAbstractProxyModel(unsafe.Pointer(h))} } -func newQSortFilterProxyModel_U(h unsafe.Pointer) *QSortFilterProxyModel { +func UnsafeNewQSortFilterProxyModel(h unsafe.Pointer) *QSortFilterProxyModel { return newQSortFilterProxyModel((*C.QSortFilterProxyModel)(h)) } @@ -50,7 +58,7 @@ func NewQSortFilterProxyModel2(parent *QObject) *QSortFilterProxyModel { } func (this *QSortFilterProxyModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSortFilterProxyModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSortFilterProxyModel_MetaObject(this.h))) } func (this *QSortFilterProxyModel) Metacast(param1 string) unsafe.Pointer { @@ -182,7 +190,7 @@ func (this *QSortFilterProxyModel) SetRecursiveFilteringEnabled(recursive bool) } func (this *QSortFilterProxyModel) SetFilterRegExp(pattern string) { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) C.QSortFilterProxyModel_SetFilterRegExp(this.h, (*C.struct_miqt_string)(pattern_ms)) } @@ -192,7 +200,7 @@ func (this *QSortFilterProxyModel) SetFilterRegExpWithRegExp(regExp *QRegExp) { } func (this *QSortFilterProxyModel) SetFilterRegularExpression(pattern string) { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) C.QSortFilterProxyModel_SetFilterRegularExpression(this.h, (*C.struct_miqt_string)(pattern_ms)) } @@ -202,13 +210,13 @@ func (this *QSortFilterProxyModel) SetFilterRegularExpressionWithRegularExpressi } func (this *QSortFilterProxyModel) SetFilterWildcard(pattern string) { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) C.QSortFilterProxyModel_SetFilterWildcard(this.h, (*C.struct_miqt_string)(pattern_ms)) } func (this *QSortFilterProxyModel) SetFilterFixedString(pattern string) { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) C.QSortFilterProxyModel_SetFilterFixedString(this.h, (*C.struct_miqt_string)(pattern_ms)) } @@ -285,7 +293,7 @@ func (this *QSortFilterProxyModel) MimeData(indexes []QModelIndex) *QMimeData { } indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)} defer runtime.KeepAlive(unsafe.Pointer(indexes_ma)) - return newQMimeData_U(unsafe.Pointer(C.QSortFilterProxyModel_MimeData(this.h, indexes_ma))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QSortFilterProxyModel_MimeData(this.h, indexes_ma))) } func (this *QSortFilterProxyModel) DropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool { diff --git a/qt/gen_qsortfilterproxymodel.h b/qt/gen_qsortfilterproxymodel.h index 7eaadc52..66520903 100644 --- a/qt/gen_qsortfilterproxymodel.h +++ b/qt/gen_qsortfilterproxymodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qspinbox.cpp b/qt/gen_qspinbox.cpp index 4af91517..507a74af 100644 --- a/qt/gen_qspinbox.cpp +++ b/qt/gen_qspinbox.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qspinbox.h" +#include #include "gen_qspinbox.h" #include "_cgo_export.h" diff --git a/qt/gen_qspinbox.go b/qt/gen_qspinbox.go index 0ac54563..6fedfb91 100644 --- a/qt/gen_qspinbox.go +++ b/qt/gen_qspinbox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QSpinBox) cPointer() *C.QSpinBox { return this.h } +func (this *QSpinBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSpinBox(h *C.QSpinBox) *QSpinBox { if h == nil { return nil } - return &QSpinBox{h: h, QAbstractSpinBox: newQAbstractSpinBox_U(unsafe.Pointer(h))} + return &QSpinBox{h: h, QAbstractSpinBox: UnsafeNewQAbstractSpinBox(unsafe.Pointer(h))} } -func newQSpinBox_U(h unsafe.Pointer) *QSpinBox { +func UnsafeNewQSpinBox(h unsafe.Pointer) *QSpinBox { return newQSpinBox((*C.QSpinBox)(h)) } @@ -50,7 +58,7 @@ func NewQSpinBox2(parent *QWidget) *QSpinBox { } func (this *QSpinBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSpinBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSpinBox_MetaObject(this.h))) } func (this *QSpinBox) Metacast(param1 string) unsafe.Pointer { @@ -89,7 +97,7 @@ func (this *QSpinBox) Prefix() string { } func (this *QSpinBox) SetPrefix(prefix string) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) C.QSpinBox_SetPrefix(this.h, (*C.struct_miqt_string)(prefix_ms)) } @@ -102,7 +110,7 @@ func (this *QSpinBox) Suffix() string { } func (this *QSpinBox) SetSuffix(suffix string) { - suffix_ms := miqt_strdupg(suffix) + suffix_ms := libmiqt.Strdupg(suffix) defer C.free(suffix_ms) C.QSpinBox_SetSuffix(this.h, (*C.struct_miqt_string)(suffix_ms)) } @@ -183,7 +191,7 @@ func miqt_exec_callback_QSpinBox_ValueChanged(cb C.intptr_t, param1 C.int) { } func (this *QSpinBox) TextChanged(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QSpinBox_TextChanged(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -208,7 +216,7 @@ func miqt_exec_callback_QSpinBox_TextChanged(cb C.intptr_t, param1 *C.struct_miq } func (this *QSpinBox) ValueChangedWithQString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QSpinBox_ValueChangedWithQString(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -302,14 +310,21 @@ func (this *QDoubleSpinBox) cPointer() *C.QDoubleSpinBox { return this.h } +func (this *QDoubleSpinBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDoubleSpinBox(h *C.QDoubleSpinBox) *QDoubleSpinBox { if h == nil { return nil } - return &QDoubleSpinBox{h: h, QAbstractSpinBox: newQAbstractSpinBox_U(unsafe.Pointer(h))} + return &QDoubleSpinBox{h: h, QAbstractSpinBox: UnsafeNewQAbstractSpinBox(unsafe.Pointer(h))} } -func newQDoubleSpinBox_U(h unsafe.Pointer) *QDoubleSpinBox { +func UnsafeNewQDoubleSpinBox(h unsafe.Pointer) *QDoubleSpinBox { return newQDoubleSpinBox((*C.QDoubleSpinBox)(h)) } @@ -326,7 +341,7 @@ func NewQDoubleSpinBox2(parent *QWidget) *QDoubleSpinBox { } func (this *QDoubleSpinBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDoubleSpinBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDoubleSpinBox_MetaObject(this.h))) } func (this *QDoubleSpinBox) Metacast(param1 string) unsafe.Pointer { @@ -365,7 +380,7 @@ func (this *QDoubleSpinBox) Prefix() string { } func (this *QDoubleSpinBox) SetPrefix(prefix string) { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) C.QDoubleSpinBox_SetPrefix(this.h, (*C.struct_miqt_string)(prefix_ms)) } @@ -378,7 +393,7 @@ func (this *QDoubleSpinBox) Suffix() string { } func (this *QDoubleSpinBox) SetSuffix(suffix string) { - suffix_ms := miqt_strdupg(suffix) + suffix_ms := libmiqt.Strdupg(suffix) defer C.free(suffix_ms) C.QDoubleSpinBox_SetSuffix(this.h, (*C.struct_miqt_string)(suffix_ms)) } @@ -435,13 +450,13 @@ func (this *QDoubleSpinBox) SetDecimals(prec int) { } func (this *QDoubleSpinBox) Validate(input string, pos *int) QValidator__State { - input_ms := miqt_strdupg(input) + input_ms := libmiqt.Strdupg(input) defer C.free(input_ms) return (QValidator__State)(C.QDoubleSpinBox_Validate(this.h, (*C.struct_miqt_string)(input_ms), (*C.int)(unsafe.Pointer(pos)))) } func (this *QDoubleSpinBox) ValueFromText(text string) float64 { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (float64)(C.QDoubleSpinBox_ValueFromText(this.h, (*C.struct_miqt_string)(text_ms))) } @@ -454,7 +469,7 @@ func (this *QDoubleSpinBox) TextFromValue(val float64) string { } func (this *QDoubleSpinBox) Fixup(str string) { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) C.QDoubleSpinBox_Fixup(this.h, (*C.struct_miqt_string)(str_ms)) } @@ -484,7 +499,7 @@ func miqt_exec_callback_QDoubleSpinBox_ValueChanged(cb C.intptr_t, param1 C.doub } func (this *QDoubleSpinBox) TextChanged(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QDoubleSpinBox_TextChanged(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -509,7 +524,7 @@ func miqt_exec_callback_QDoubleSpinBox_TextChanged(cb C.intptr_t, param1 *C.stru } func (this *QDoubleSpinBox) ValueChangedWithQString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QDoubleSpinBox_ValueChangedWithQString(this.h, (*C.struct_miqt_string)(param1_ms)) } diff --git a/qt/gen_qspinbox.h b/qt/gen_qspinbox.h index 19b7b9a9..2248d14a 100644 --- a/qt/gen_qspinbox.h +++ b/qt/gen_qspinbox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsplashscreen.cpp b/qt/gen_qsplashscreen.cpp index 9f631dfa..ed9d7c1c 100644 --- a/qt/gen_qsplashscreen.cpp +++ b/qt/gen_qsplashscreen.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qsplashscreen.h" +#include #include "gen_qsplashscreen.h" #include "_cgo_export.h" diff --git a/qt/gen_qsplashscreen.go b/qt/gen_qsplashscreen.go index 20789954..7c6aad69 100644 --- a/qt/gen_qsplashscreen.go +++ b/qt/gen_qsplashscreen.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QSplashScreen) cPointer() *C.QSplashScreen { return this.h } +func (this *QSplashScreen) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSplashScreen(h *C.QSplashScreen) *QSplashScreen { if h == nil { return nil } - return &QSplashScreen{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QSplashScreen{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQSplashScreen_U(h unsafe.Pointer) *QSplashScreen { +func UnsafeNewQSplashScreen(h unsafe.Pointer) *QSplashScreen { return newQSplashScreen((*C.QSplashScreen)(h)) } @@ -92,7 +100,7 @@ func NewQSplashScreen9(parent *QWidget, pixmap *QPixmap, f WindowType) *QSplashS } func (this *QSplashScreen) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSplashScreen_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSplashScreen_MetaObject(this.h))) } func (this *QSplashScreen) Metacast(param1 string) unsafe.Pointer { @@ -146,7 +154,7 @@ func (this *QSplashScreen) Message() string { } func (this *QSplashScreen) ShowMessage(message string) { - message_ms := miqt_strdupg(message) + message_ms := libmiqt.Strdupg(message) defer C.free(message_ms) C.QSplashScreen_ShowMessage(this.h, (*C.struct_miqt_string)(message_ms)) } @@ -156,7 +164,7 @@ func (this *QSplashScreen) ClearMessage() { } func (this *QSplashScreen) MessageChanged(message string) { - message_ms := miqt_strdupg(message) + message_ms := libmiqt.Strdupg(message) defer C.free(message_ms) C.QSplashScreen_MessageChanged(this.h, (*C.struct_miqt_string)(message_ms)) } @@ -225,13 +233,13 @@ func QSplashScreen_TrUtf83(s string, c string, n int) string { } func (this *QSplashScreen) ShowMessage2(message string, alignment int) { - message_ms := miqt_strdupg(message) + message_ms := libmiqt.Strdupg(message) defer C.free(message_ms) C.QSplashScreen_ShowMessage2(this.h, (*C.struct_miqt_string)(message_ms), (C.int)(alignment)) } func (this *QSplashScreen) ShowMessage3(message string, alignment int, color *QColor) { - message_ms := miqt_strdupg(message) + message_ms := libmiqt.Strdupg(message) defer C.free(message_ms) C.QSplashScreen_ShowMessage3(this.h, (*C.struct_miqt_string)(message_ms), (C.int)(alignment), color.cPointer()) } diff --git a/qt/gen_qsplashscreen.h b/qt/gen_qsplashscreen.h index 8da5ae56..89ba014b 100644 --- a/qt/gen_qsplashscreen.h +++ b/qt/gen_qsplashscreen.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsplitter.cpp b/qt/gen_qsplitter.cpp index ec1d0568..4bbfc179 100644 --- a/qt/gen_qsplitter.cpp +++ b/qt/gen_qsplitter.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qsplitter.h" +#include #include "gen_qsplitter.h" #include "_cgo_export.h" diff --git a/qt/gen_qsplitter.go b/qt/gen_qsplitter.go index cd8361c7..6e405d66 100644 --- a/qt/gen_qsplitter.go +++ b/qt/gen_qsplitter.go @@ -26,14 +26,21 @@ func (this *QSplitter) cPointer() *C.QSplitter { return this.h } +func (this *QSplitter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSplitter(h *C.QSplitter) *QSplitter { if h == nil { return nil } - return &QSplitter{h: h, QFrame: newQFrame_U(unsafe.Pointer(h))} + return &QSplitter{h: h, QFrame: UnsafeNewQFrame(unsafe.Pointer(h))} } -func newQSplitter_U(h unsafe.Pointer) *QSplitter { +func UnsafeNewQSplitter(h unsafe.Pointer) *QSplitter { return newQSplitter((*C.QSplitter)(h)) } @@ -62,7 +69,7 @@ func NewQSplitter4(param1 Orientation, parent *QWidget) *QSplitter { } func (this *QSplitter) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSplitter_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSplitter_MetaObject(this.h))) } func (this *QSplitter) Metacast(param1 string) unsafe.Pointer { @@ -98,7 +105,7 @@ func (this *QSplitter) InsertWidget(index int, widget *QWidget) { } func (this *QSplitter) ReplaceWidget(index int, widget *QWidget) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QSplitter_ReplaceWidget(this.h, (C.int)(index), widget.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QSplitter_ReplaceWidget(this.h, (C.int)(index), widget.cPointer()))) } func (this *QSplitter) SetOrientation(orientation Orientation) { @@ -198,7 +205,7 @@ func (this *QSplitter) IndexOf(w *QWidget) int { } func (this *QSplitter) Widget(index int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QSplitter_Widget(this.h, (C.int)(index)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QSplitter_Widget(this.h, (C.int)(index)))) } func (this *QSplitter) Count() int { @@ -210,7 +217,7 @@ func (this *QSplitter) GetRange(index int, param2 *int, param3 *int) { } func (this *QSplitter) Handle(index int) *QSplitterHandle { - return newQSplitterHandle_U(unsafe.Pointer(C.QSplitter_Handle(this.h, (C.int)(index)))) + return UnsafeNewQSplitterHandle(unsafe.Pointer(C.QSplitter_Handle(this.h, (C.int)(index)))) } func (this *QSplitter) SetStretchFactor(index int, stretch int) { @@ -313,14 +320,21 @@ func (this *QSplitterHandle) cPointer() *C.QSplitterHandle { return this.h } +func (this *QSplitterHandle) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSplitterHandle(h *C.QSplitterHandle) *QSplitterHandle { if h == nil { return nil } - return &QSplitterHandle{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QSplitterHandle{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQSplitterHandle_U(h unsafe.Pointer) *QSplitterHandle { +func UnsafeNewQSplitterHandle(h unsafe.Pointer) *QSplitterHandle { return newQSplitterHandle((*C.QSplitterHandle)(h)) } @@ -331,7 +345,7 @@ func NewQSplitterHandle(o Orientation, parent *QSplitter) *QSplitterHandle { } func (this *QSplitterHandle) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSplitterHandle_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSplitterHandle_MetaObject(this.h))) } func (this *QSplitterHandle) Metacast(param1 string) unsafe.Pointer { @@ -371,7 +385,7 @@ func (this *QSplitterHandle) OpaqueResize() bool { } func (this *QSplitterHandle) Splitter() *QSplitter { - return newQSplitter_U(unsafe.Pointer(C.QSplitterHandle_Splitter(this.h))) + return UnsafeNewQSplitter(unsafe.Pointer(C.QSplitterHandle_Splitter(this.h))) } func (this *QSplitterHandle) SizeHint() *QSize { diff --git a/qt/gen_qsplitter.h b/qt/gen_qsplitter.h index 9a9ac7d3..e1e2eadc 100644 --- a/qt/gen_qsplitter.h +++ b/qt/gen_qsplitter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstackedlayout.cpp b/qt/gen_qstackedlayout.cpp index fab8e99d..8dbfca40 100644 --- a/qt/gen_qstackedlayout.cpp +++ b/qt/gen_qstackedlayout.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qstackedlayout.h" +#include #include "gen_qstackedlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qstackedlayout.go b/qt/gen_qstackedlayout.go index 4100971f..ac45209c 100644 --- a/qt/gen_qstackedlayout.go +++ b/qt/gen_qstackedlayout.go @@ -33,14 +33,21 @@ func (this *QStackedLayout) cPointer() *C.QStackedLayout { return this.h } +func (this *QStackedLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStackedLayout(h *C.QStackedLayout) *QStackedLayout { if h == nil { return nil } - return &QStackedLayout{h: h, QLayout: newQLayout_U(unsafe.Pointer(h))} + return &QStackedLayout{h: h, QLayout: UnsafeNewQLayout(unsafe.Pointer(h))} } -func newQStackedLayout_U(h unsafe.Pointer) *QStackedLayout { +func UnsafeNewQStackedLayout(h unsafe.Pointer) *QStackedLayout { return newQStackedLayout((*C.QStackedLayout)(h)) } @@ -63,7 +70,7 @@ func NewQStackedLayout3(parentLayout *QLayout) *QStackedLayout { } func (this *QStackedLayout) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStackedLayout_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStackedLayout_MetaObject(this.h))) } func (this *QStackedLayout) Metacast(param1 string) unsafe.Pointer { @@ -99,7 +106,7 @@ func (this *QStackedLayout) InsertWidget(index int, w *QWidget) int { } func (this *QStackedLayout) CurrentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QStackedLayout_CurrentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QStackedLayout_CurrentWidget(this.h))) } func (this *QStackedLayout) CurrentIndex() int { @@ -107,7 +114,7 @@ func (this *QStackedLayout) CurrentIndex() int { } func (this *QStackedLayout) Widget(param1 int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QStackedLayout_Widget(this.h, (C.int)(param1)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QStackedLayout_Widget(this.h, (C.int)(param1)))) } func (this *QStackedLayout) Count() int { @@ -141,11 +148,11 @@ func (this *QStackedLayout) MinimumSize() *QSize { } func (this *QStackedLayout) ItemAt(param1 int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QStackedLayout_ItemAt(this.h, (C.int)(param1)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QStackedLayout_ItemAt(this.h, (C.int)(param1)))) } func (this *QStackedLayout) TakeAt(param1 int) *QLayoutItem { - return newQLayoutItem_U(unsafe.Pointer(C.QStackedLayout_TakeAt(this.h, (C.int)(param1)))) + return UnsafeNewQLayoutItem(unsafe.Pointer(C.QStackedLayout_TakeAt(this.h, (C.int)(param1)))) } func (this *QStackedLayout) SetGeometry(rect *QRect) { diff --git a/qt/gen_qstackedlayout.h b/qt/gen_qstackedlayout.h index b057a400..ed0438ad 100644 --- a/qt/gen_qstackedlayout.h +++ b/qt/gen_qstackedlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstackedwidget.cpp b/qt/gen_qstackedwidget.cpp index 6acace81..e18fab52 100644 --- a/qt/gen_qstackedwidget.cpp +++ b/qt/gen_qstackedwidget.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qstackedwidget.h" +#include #include "gen_qstackedwidget.h" #include "_cgo_export.h" diff --git a/qt/gen_qstackedwidget.go b/qt/gen_qstackedwidget.go index bbc0699c..f962fab2 100644 --- a/qt/gen_qstackedwidget.go +++ b/qt/gen_qstackedwidget.go @@ -26,14 +26,21 @@ func (this *QStackedWidget) cPointer() *C.QStackedWidget { return this.h } +func (this *QStackedWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStackedWidget(h *C.QStackedWidget) *QStackedWidget { if h == nil { return nil } - return &QStackedWidget{h: h, QFrame: newQFrame_U(unsafe.Pointer(h))} + return &QStackedWidget{h: h, QFrame: UnsafeNewQFrame(unsafe.Pointer(h))} } -func newQStackedWidget_U(h unsafe.Pointer) *QStackedWidget { +func UnsafeNewQStackedWidget(h unsafe.Pointer) *QStackedWidget { return newQStackedWidget((*C.QStackedWidget)(h)) } @@ -50,7 +57,7 @@ func NewQStackedWidget2(parent *QWidget) *QStackedWidget { } func (this *QStackedWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStackedWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStackedWidget_MetaObject(this.h))) } func (this *QStackedWidget) Metacast(param1 string) unsafe.Pointer { @@ -90,7 +97,7 @@ func (this *QStackedWidget) RemoveWidget(w *QWidget) { } func (this *QStackedWidget) CurrentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QStackedWidget_CurrentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QStackedWidget_CurrentWidget(this.h))) } func (this *QStackedWidget) CurrentIndex() int { @@ -102,7 +109,7 @@ func (this *QStackedWidget) IndexOf(param1 *QWidget) int { } func (this *QStackedWidget) Widget(param1 int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QStackedWidget_Widget(this.h, (C.int)(param1)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QStackedWidget_Widget(this.h, (C.int)(param1)))) } func (this *QStackedWidget) Count() int { diff --git a/qt/gen_qstackedwidget.h b/qt/gen_qstackedwidget.h index 06c119f2..aa8bd6ba 100644 --- a/qt/gen_qstackedwidget.h +++ b/qt/gen_qstackedwidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstandarditemmodel.cpp b/qt/gen_qstandarditemmodel.cpp index ff81bff7..256975aa 100644 --- a/qt/gen_qstandarditemmodel.cpp +++ b/qt/gen_qstandarditemmodel.cpp @@ -14,7 +14,7 @@ #include #include #include -#include "qstandarditemmodel.h" +#include #include "gen_qstandarditemmodel.h" #include "_cgo_export.h" @@ -316,7 +316,7 @@ void QStandardItem_SetChild2(QStandardItem* self, int row, QStandardItem* item) } void QStandardItem_InsertRow(QStandardItem* self, int row, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -326,7 +326,7 @@ void QStandardItem_InsertRow(QStandardItem* self, int row, struct miqt_array* /* } void QStandardItem_InsertColumn(QStandardItem* self, int column, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -336,7 +336,7 @@ void QStandardItem_InsertColumn(QStandardItem* self, int column, struct miqt_arr } void QStandardItem_InsertRows(QStandardItem* self, int row, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -370,7 +370,7 @@ void QStandardItem_RemoveColumns(QStandardItem* self, int column, int count) { } void QStandardItem_AppendRow(QStandardItem* self, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -380,7 +380,7 @@ void QStandardItem_AppendRow(QStandardItem* self, struct miqt_array* /* of QStan } void QStandardItem_AppendRows(QStandardItem* self, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -390,7 +390,7 @@ void QStandardItem_AppendRows(QStandardItem* self, struct miqt_array* /* of QSta } void QStandardItem_AppendColumn(QStandardItem* self, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -642,7 +642,7 @@ void QStandardItemModel_SetVerticalHeaderItem(QStandardItemModel* self, int row, } void QStandardItemModel_SetHorizontalHeaderLabels(QStandardItemModel* self, struct miqt_array* /* of struct miqt_string* */ labels) { - QList labels_QList; + QStringList labels_QList; labels_QList.reserve(labels->len); struct miqt_string** labels_arr = static_cast(labels->data); for(size_t i = 0; i < labels->len; ++i) { @@ -653,7 +653,7 @@ void QStandardItemModel_SetHorizontalHeaderLabels(QStandardItemModel* self, stru } void QStandardItemModel_SetVerticalHeaderLabels(QStandardItemModel* self, struct miqt_array* /* of struct miqt_string* */ labels) { - QList labels_QList; + QStringList labels_QList; labels_QList.reserve(labels->len); struct miqt_string** labels_arr = static_cast(labels->data); for(size_t i = 0; i < labels->len; ++i) { @@ -672,7 +672,7 @@ void QStandardItemModel_SetColumnCount(QStandardItemModel* self, int columns) { } void QStandardItemModel_AppendRow(QStandardItemModel* self, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -682,7 +682,7 @@ void QStandardItemModel_AppendRow(QStandardItemModel* self, struct miqt_array* / } void QStandardItemModel_AppendColumn(QStandardItemModel* self, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -696,7 +696,7 @@ void QStandardItemModel_AppendRowWithItem(QStandardItemModel* self, QStandardIte } void QStandardItemModel_InsertRow(QStandardItemModel* self, int row, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -706,7 +706,7 @@ void QStandardItemModel_InsertRow(QStandardItemModel* self, int row, struct miqt } void QStandardItemModel_InsertColumn(QStandardItemModel* self, int column, struct miqt_array* /* of QStandardItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QStandardItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -812,7 +812,7 @@ struct miqt_array* QStandardItemModel_MimeTypes(const QStandardItemModel* self) } QMimeData* QStandardItemModel_MimeData(const QStandardItemModel* self, struct miqt_array* /* of QModelIndex* */ indexes) { - QList indexes_QList; + QModelIndexList indexes_QList; indexes_QList.reserve(indexes->len); QModelIndex** indexes_arr = static_cast(indexes->data); for(size_t i = 0; i < indexes->len; ++i) { diff --git a/qt/gen_qstandarditemmodel.go b/qt/gen_qstandarditemmodel.go index e34c29f1..7b21a441 100644 --- a/qt/gen_qstandarditemmodel.go +++ b/qt/gen_qstandarditemmodel.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -32,6 +33,13 @@ func (this *QStandardItem) cPointer() *C.QStandardItem { return this.h } +func (this *QStandardItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStandardItem(h *C.QStandardItem) *QStandardItem { if h == nil { return nil @@ -39,7 +47,7 @@ func newQStandardItem(h *C.QStandardItem) *QStandardItem { return &QStandardItem{h: h} } -func newQStandardItem_U(h unsafe.Pointer) *QStandardItem { +func UnsafeNewQStandardItem(h unsafe.Pointer) *QStandardItem { return newQStandardItem((*C.QStandardItem)(h)) } @@ -51,7 +59,7 @@ func NewQStandardItem() *QStandardItem { // NewQStandardItem2 constructs a new QStandardItem object. func NewQStandardItem2(text string) *QStandardItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QStandardItem_new2((*C.struct_miqt_string)(text_ms)) return newQStandardItem(ret) @@ -59,7 +67,7 @@ func NewQStandardItem2(text string) *QStandardItem { // NewQStandardItem3 constructs a new QStandardItem object. func NewQStandardItem3(icon *QIcon, text string) *QStandardItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QStandardItem_new3(icon.cPointer(), (*C.struct_miqt_string)(text_ms)) return newQStandardItem(ret) @@ -100,7 +108,7 @@ func (this *QStandardItem) Text() string { } func (this *QStandardItem) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStandardItem_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -124,7 +132,7 @@ func (this *QStandardItem) ToolTip() string { } func (this *QStandardItem) SetToolTip(toolTip string) { - toolTip_ms := miqt_strdupg(toolTip) + toolTip_ms := libmiqt.Strdupg(toolTip) defer C.free(toolTip_ms) C.QStandardItem_SetToolTip(this.h, (*C.struct_miqt_string)(toolTip_ms)) } @@ -137,7 +145,7 @@ func (this *QStandardItem) StatusTip() string { } func (this *QStandardItem) SetStatusTip(statusTip string) { - statusTip_ms := miqt_strdupg(statusTip) + statusTip_ms := libmiqt.Strdupg(statusTip) defer C.free(statusTip_ms) C.QStandardItem_SetStatusTip(this.h, (*C.struct_miqt_string)(statusTip_ms)) } @@ -150,7 +158,7 @@ func (this *QStandardItem) WhatsThis() string { } func (this *QStandardItem) SetWhatsThis(whatsThis string) { - whatsThis_ms := miqt_strdupg(whatsThis) + whatsThis_ms := libmiqt.Strdupg(whatsThis) defer C.free(whatsThis_ms) C.QStandardItem_SetWhatsThis(this.h, (*C.struct_miqt_string)(whatsThis_ms)) } @@ -223,7 +231,7 @@ func (this *QStandardItem) AccessibleText() string { } func (this *QStandardItem) SetAccessibleText(accessibleText string) { - accessibleText_ms := miqt_strdupg(accessibleText) + accessibleText_ms := libmiqt.Strdupg(accessibleText) defer C.free(accessibleText_ms) C.QStandardItem_SetAccessibleText(this.h, (*C.struct_miqt_string)(accessibleText_ms)) } @@ -236,7 +244,7 @@ func (this *QStandardItem) AccessibleDescription() string { } func (this *QStandardItem) SetAccessibleDescription(accessibleDescription string) { - accessibleDescription_ms := miqt_strdupg(accessibleDescription) + accessibleDescription_ms := libmiqt.Strdupg(accessibleDescription) defer C.free(accessibleDescription_ms) C.QStandardItem_SetAccessibleDescription(this.h, (*C.struct_miqt_string)(accessibleDescription_ms)) } @@ -322,7 +330,7 @@ func (this *QStandardItem) SetDropEnabled(dropEnabled bool) { } func (this *QStandardItem) Parent() *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItem_Parent(this.h))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItem_Parent(this.h))) } func (this *QStandardItem) Row() int { @@ -341,7 +349,7 @@ func (this *QStandardItem) Index() *QModelIndex { } func (this *QStandardItem) Model() *QStandardItemModel { - return newQStandardItemModel_U(unsafe.Pointer(C.QStandardItem_Model(this.h))) + return UnsafeNewQStandardItemModel(unsafe.Pointer(C.QStandardItem_Model(this.h))) } func (this *QStandardItem) RowCount() int { @@ -365,7 +373,7 @@ func (this *QStandardItem) HasChildren() bool { } func (this *QStandardItem) Child(row int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItem_Child(this.h, (C.int)(row)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItem_Child(this.h, (C.int)(row)))) } func (this *QStandardItem) SetChild(row int, column int, item *QStandardItem) { @@ -481,7 +489,7 @@ func (this *QStandardItem) AppendRowWithItem(item *QStandardItem) { } func (this *QStandardItem) TakeChild(row int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItem_TakeChild(this.h, (C.int)(row)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItem_TakeChild(this.h, (C.int)(row)))) } func (this *QStandardItem) TakeRow(row int) []*QStandardItem { @@ -489,7 +497,7 @@ func (this *QStandardItem) TakeRow(row int) []*QStandardItem { _ret := make([]*QStandardItem, int(_ma.len)) _outCast := (*[0xffff]*C.QStandardItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQStandardItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQStandardItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -500,7 +508,7 @@ func (this *QStandardItem) TakeColumn(column int) []*QStandardItem { _ret := make([]*QStandardItem, int(_ma.len)) _outCast := (*[0xffff]*C.QStandardItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQStandardItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQStandardItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -511,7 +519,7 @@ func (this *QStandardItem) SortChildren(column int) { } func (this *QStandardItem) Clone() *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItem_Clone(this.h))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItem_Clone(this.h))) } func (this *QStandardItem) Type() int { @@ -542,11 +550,11 @@ func (this *QStandardItem) SetData2(value *QVariant, role int) { } func (this *QStandardItem) Child2(row int, column int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItem_Child2(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItem_Child2(this.h, (C.int)(row), (C.int)(column)))) } func (this *QStandardItem) TakeChild2(row int, column int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItem_TakeChild2(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItem_TakeChild2(this.h, (C.int)(row), (C.int)(column)))) } func (this *QStandardItem) SortChildren2(column int, order SortOrder) { @@ -579,14 +587,21 @@ func (this *QStandardItemModel) cPointer() *C.QStandardItemModel { return this.h } +func (this *QStandardItemModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStandardItemModel(h *C.QStandardItemModel) *QStandardItemModel { if h == nil { return nil } - return &QStandardItemModel{h: h, QAbstractItemModel: newQAbstractItemModel_U(unsafe.Pointer(h))} + return &QStandardItemModel{h: h, QAbstractItemModel: UnsafeNewQAbstractItemModel(unsafe.Pointer(h))} } -func newQStandardItemModel_U(h unsafe.Pointer) *QStandardItemModel { +func UnsafeNewQStandardItemModel(h unsafe.Pointer) *QStandardItemModel { return newQStandardItemModel((*C.QStandardItemModel)(h)) } @@ -615,7 +630,7 @@ func NewQStandardItemModel4(rows int, columns int, parent *QObject) *QStandardIt } func (this *QStandardItemModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStandardItemModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStandardItemModel_MetaObject(this.h))) } func (this *QStandardItemModel) Metacast(param1 string) unsafe.Pointer { @@ -734,7 +749,7 @@ func (this *QStandardItemModel) Sort(column int) { } func (this *QStandardItemModel) ItemFromIndex(index *QModelIndex) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_ItemFromIndex(this.h, index.cPointer()))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_ItemFromIndex(this.h, index.cPointer()))) } func (this *QStandardItemModel) IndexFromItem(item *QStandardItem) *QModelIndex { @@ -745,7 +760,7 @@ func (this *QStandardItemModel) IndexFromItem(item *QStandardItem) *QModelIndex } func (this *QStandardItemModel) Item(row int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_Item(this.h, (C.int)(row)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_Item(this.h, (C.int)(row)))) } func (this *QStandardItemModel) SetItem(row int, column int, item *QStandardItem) { @@ -757,11 +772,11 @@ func (this *QStandardItemModel) SetItem2(row int, item *QStandardItem) { } func (this *QStandardItemModel) InvisibleRootItem() *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_InvisibleRootItem(this.h))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_InvisibleRootItem(this.h))) } func (this *QStandardItemModel) HorizontalHeaderItem(column int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_HorizontalHeaderItem(this.h, (C.int)(column)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_HorizontalHeaderItem(this.h, (C.int)(column)))) } func (this *QStandardItemModel) SetHorizontalHeaderItem(column int, item *QStandardItem) { @@ -769,7 +784,7 @@ func (this *QStandardItemModel) SetHorizontalHeaderItem(column int, item *QStand } func (this *QStandardItemModel) VerticalHeaderItem(row int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_VerticalHeaderItem(this.h, (C.int)(row)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_VerticalHeaderItem(this.h, (C.int)(row)))) } func (this *QStandardItemModel) SetVerticalHeaderItem(row int, item *QStandardItem) { @@ -781,7 +796,7 @@ func (this *QStandardItemModel) SetHorizontalHeaderLabels(labels []string) { labels_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(labels)))) defer C.free(unsafe.Pointer(labels_CArray)) for i := range labels { - labels_i_ms := miqt_strdupg(labels[i]) + labels_i_ms := libmiqt.Strdupg(labels[i]) defer C.free(labels_i_ms) labels_CArray[i] = (*C.struct_miqt_string)(labels_i_ms) } @@ -795,7 +810,7 @@ func (this *QStandardItemModel) SetVerticalHeaderLabels(labels []string) { labels_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(labels)))) defer C.free(unsafe.Pointer(labels_CArray)) for i := range labels { - labels_i_ms := miqt_strdupg(labels[i]) + labels_i_ms := libmiqt.Strdupg(labels[i]) defer C.free(labels_i_ms) labels_CArray[i] = (*C.struct_miqt_string)(labels_i_ms) } @@ -877,7 +892,7 @@ func (this *QStandardItemModel) InsertColumnWithColumn(column int) bool { } func (this *QStandardItemModel) TakeItem(row int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_TakeItem(this.h, (C.int)(row)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_TakeItem(this.h, (C.int)(row)))) } func (this *QStandardItemModel) TakeRow(row int) []*QStandardItem { @@ -885,7 +900,7 @@ func (this *QStandardItemModel) TakeRow(row int) []*QStandardItem { _ret := make([]*QStandardItem, int(_ma.len)) _outCast := (*[0xffff]*C.QStandardItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQStandardItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQStandardItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -896,22 +911,22 @@ func (this *QStandardItemModel) TakeColumn(column int) []*QStandardItem { _ret := make([]*QStandardItem, int(_ma.len)) _outCast := (*[0xffff]*C.QStandardItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQStandardItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQStandardItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QStandardItemModel) TakeHorizontalHeaderItem(column int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_TakeHorizontalHeaderItem(this.h, (C.int)(column)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_TakeHorizontalHeaderItem(this.h, (C.int)(column)))) } func (this *QStandardItemModel) TakeVerticalHeaderItem(row int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_TakeVerticalHeaderItem(this.h, (C.int)(row)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_TakeVerticalHeaderItem(this.h, (C.int)(row)))) } func (this *QStandardItemModel) ItemPrototype() *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_ItemPrototype(this.h))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_ItemPrototype(this.h))) } func (this *QStandardItemModel) SetItemPrototype(item *QStandardItem) { @@ -919,13 +934,13 @@ func (this *QStandardItemModel) SetItemPrototype(item *QStandardItem) { } func (this *QStandardItemModel) FindItems(text string) []*QStandardItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QStandardItemModel_FindItems(this.h, (*C.struct_miqt_string)(text_ms)) _ret := make([]*QStandardItem, int(_ma.len)) _outCast := (*[0xffff]*C.QStandardItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQStandardItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQStandardItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -962,7 +977,7 @@ func (this *QStandardItemModel) MimeData(indexes []QModelIndex) *QMimeData { } indexes_ma := &C.struct_miqt_array{len: C.size_t(len(indexes)), data: unsafe.Pointer(indexes_CArray)} defer runtime.KeepAlive(unsafe.Pointer(indexes_ma)) - return newQMimeData_U(unsafe.Pointer(C.QStandardItemModel_MimeData(this.h, indexes_ma))) + return UnsafeNewQMimeData(unsafe.Pointer(C.QStandardItemModel_MimeData(this.h, indexes_ma))) } func (this *QStandardItemModel) DropMimeData(data *QMimeData, action DropAction, row int, column int, parent *QModelIndex) bool { @@ -984,7 +999,7 @@ func miqt_exec_callback_QStandardItemModel_ItemChanged(cb C.intptr_t, item *C.QS } // Convert all CABI parameters to Go parameters - slotval1 := newQStandardItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQStandardItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -1095,7 +1110,7 @@ func (this *QStandardItemModel) Sort2(column int, order SortOrder) { } func (this *QStandardItemModel) Item2(row int, column int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_Item2(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_Item2(this.h, (C.int)(row), (C.int)(column)))) } func (this *QStandardItemModel) InsertRow22(row int, parent *QModelIndex) bool { @@ -1107,30 +1122,30 @@ func (this *QStandardItemModel) InsertColumn2(column int, parent *QModelIndex) b } func (this *QStandardItemModel) TakeItem2(row int, column int) *QStandardItem { - return newQStandardItem_U(unsafe.Pointer(C.QStandardItemModel_TakeItem2(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQStandardItem(unsafe.Pointer(C.QStandardItemModel_TakeItem2(this.h, (C.int)(row), (C.int)(column)))) } func (this *QStandardItemModel) FindItems2(text string, flags MatchFlag) []*QStandardItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QStandardItemModel_FindItems2(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(flags)) _ret := make([]*QStandardItem, int(_ma.len)) _outCast := (*[0xffff]*C.QStandardItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQStandardItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQStandardItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QStandardItemModel) FindItems3(text string, flags MatchFlag, column int) []*QStandardItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QStandardItemModel_FindItems3(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(flags), (C.int)(column)) _ret := make([]*QStandardItem, int(_ma.len)) _outCast := (*[0xffff]*C.QStandardItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQStandardItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQStandardItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret diff --git a/qt/gen_qstandarditemmodel.h b/qt/gen_qstandarditemmodel.h index 8467dcb9..993848a0 100644 --- a/qt/gen_qstandarditemmodel.h +++ b/qt/gen_qstandarditemmodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstandardpaths.cpp b/qt/gen_qstandardpaths.cpp index 4812099a..586606da 100644 --- a/qt/gen_qstandardpaths.cpp +++ b/qt/gen_qstandardpaths.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qstandardpaths.h" +#include #include "gen_qstandardpaths.h" #include "_cgo_export.h" @@ -109,7 +109,7 @@ struct miqt_array* QStandardPaths_LocateAll3(int typeVal, struct miqt_string* fi struct miqt_string* QStandardPaths_FindExecutable2(struct miqt_string* executableName, struct miqt_array* /* of struct miqt_string* */ paths) { QString executableName_QString = QString::fromUtf8(&executableName->data, executableName->len); - QList paths_QList; + QStringList paths_QList; paths_QList.reserve(paths->len); struct miqt_string** paths_arr = static_cast(paths->data); for(size_t i = 0; i < paths->len; ++i) { diff --git a/qt/gen_qstandardpaths.go b/qt/gen_qstandardpaths.go index 3b9f3c0f..00a38c05 100644 --- a/qt/gen_qstandardpaths.go +++ b/qt/gen_qstandardpaths.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -56,6 +57,13 @@ func (this *QStandardPaths) cPointer() *C.QStandardPaths { return this.h } +func (this *QStandardPaths) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStandardPaths(h *C.QStandardPaths) *QStandardPaths { if h == nil { return nil @@ -63,7 +71,7 @@ func newQStandardPaths(h *C.QStandardPaths) *QStandardPaths { return &QStandardPaths{h: h} } -func newQStandardPaths_U(h unsafe.Pointer) *QStandardPaths { +func UnsafeNewQStandardPaths(h unsafe.Pointer) *QStandardPaths { return newQStandardPaths((*C.QStandardPaths)(h)) } @@ -89,7 +97,7 @@ func QStandardPaths_StandardLocations(typeVal QStandardPaths__StandardLocation) } func QStandardPaths_Locate(typeVal QStandardPaths__StandardLocation, fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QStandardPaths_Locate((C.int)(typeVal), (*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -98,7 +106,7 @@ func QStandardPaths_Locate(typeVal QStandardPaths__StandardLocation, fileName st } func QStandardPaths_LocateAll(typeVal QStandardPaths__StandardLocation, fileName string) []string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ma *C.struct_miqt_array = C.QStandardPaths_LocateAll((C.int)(typeVal), (*C.struct_miqt_string)(fileName_ms)) _ret := make([]string, int(_ma.len)) @@ -121,7 +129,7 @@ func QStandardPaths_DisplayName(typeVal QStandardPaths__StandardLocation) string } func QStandardPaths_FindExecutable(executableName string) string { - executableName_ms := miqt_strdupg(executableName) + executableName_ms := libmiqt.Strdupg(executableName) defer C.free(executableName_ms) var _ms *C.struct_miqt_string = C.QStandardPaths_FindExecutable((*C.struct_miqt_string)(executableName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -142,7 +150,7 @@ func QStandardPaths_IsTestModeEnabled() bool { } func QStandardPaths_Locate3(typeVal QStandardPaths__StandardLocation, fileName string, options QStandardPaths__LocateOption) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QStandardPaths_Locate3((C.int)(typeVal), (*C.struct_miqt_string)(fileName_ms), (C.int)(options)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -151,7 +159,7 @@ func QStandardPaths_Locate3(typeVal QStandardPaths__StandardLocation, fileName s } func QStandardPaths_LocateAll3(typeVal QStandardPaths__StandardLocation, fileName string, options QStandardPaths__LocateOption) []string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ma *C.struct_miqt_array = C.QStandardPaths_LocateAll3((C.int)(typeVal), (*C.struct_miqt_string)(fileName_ms), (C.int)(options)) _ret := make([]string, int(_ma.len)) @@ -167,13 +175,13 @@ func QStandardPaths_LocateAll3(typeVal QStandardPaths__StandardLocation, fileNam } func QStandardPaths_FindExecutable2(executableName string, paths []string) string { - executableName_ms := miqt_strdupg(executableName) + executableName_ms := libmiqt.Strdupg(executableName) defer C.free(executableName_ms) // For the C ABI, malloc a C array of raw pointers paths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(paths)))) defer C.free(unsafe.Pointer(paths_CArray)) for i := range paths { - paths_i_ms := miqt_strdupg(paths[i]) + paths_i_ms := libmiqt.Strdupg(paths[i]) defer C.free(paths_i_ms) paths_CArray[i] = (*C.struct_miqt_string)(paths_i_ms) } diff --git a/qt/gen_qstandardpaths.h b/qt/gen_qstandardpaths.h index c5c50662..7a96dc53 100644 --- a/qt/gen_qstandardpaths.h +++ b/qt/gen_qstandardpaths.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstate.cpp b/qt/gen_qstate.cpp index c9f9a7ee..8e3168f8 100644 --- a/qt/gen_qstate.cpp +++ b/qt/gen_qstate.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qstate.h" +#include #include "gen_qstate.h" #include "_cgo_export.h" diff --git a/qt/gen_qstate.go b/qt/gen_qstate.go index da45a7a2..f3c15fd7 100644 --- a/qt/gen_qstate.go +++ b/qt/gen_qstate.go @@ -39,14 +39,21 @@ func (this *QState) cPointer() *C.QState { return this.h } +func (this *QState) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQState(h *C.QState) *QState { if h == nil { return nil } - return &QState{h: h, QAbstractState: newQAbstractState_U(unsafe.Pointer(h))} + return &QState{h: h, QAbstractState: UnsafeNewQAbstractState(unsafe.Pointer(h))} } -func newQState_U(h unsafe.Pointer) *QState { +func UnsafeNewQState(h unsafe.Pointer) *QState { return newQState((*C.QState)(h)) } @@ -75,7 +82,7 @@ func NewQState4(childMode QState__ChildMode, parent *QState) *QState { } func (this *QState) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QState_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QState_MetaObject(this.h))) } func (this *QState) Metacast(param1 string) unsafe.Pointer { @@ -103,7 +110,7 @@ func QState_TrUtf8(s string) string { } func (this *QState) ErrorState() *QAbstractState { - return newQAbstractState_U(unsafe.Pointer(C.QState_ErrorState(this.h))) + return UnsafeNewQAbstractState(unsafe.Pointer(C.QState_ErrorState(this.h))) } func (this *QState) SetErrorState(state *QAbstractState) { @@ -117,11 +124,11 @@ func (this *QState) AddTransition(transition *QAbstractTransition) { func (this *QState) AddTransition2(sender *QObject, signal string, target *QAbstractState) *QSignalTransition { signal_Cstring := C.CString(signal) defer C.free(unsafe.Pointer(signal_Cstring)) - return newQSignalTransition_U(unsafe.Pointer(C.QState_AddTransition2(this.h, sender.cPointer(), signal_Cstring, target.cPointer()))) + return UnsafeNewQSignalTransition(unsafe.Pointer(C.QState_AddTransition2(this.h, sender.cPointer(), signal_Cstring, target.cPointer()))) } func (this *QState) AddTransitionWithTarget(target *QAbstractState) *QAbstractTransition { - return newQAbstractTransition_U(unsafe.Pointer(C.QState_AddTransitionWithTarget(this.h, target.cPointer()))) + return UnsafeNewQAbstractTransition(unsafe.Pointer(C.QState_AddTransitionWithTarget(this.h, target.cPointer()))) } func (this *QState) RemoveTransition(transition *QAbstractTransition) { @@ -133,14 +140,14 @@ func (this *QState) Transitions() []*QAbstractTransition { _ret := make([]*QAbstractTransition, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractTransition)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractTransition_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractTransition(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QState) InitialState() *QAbstractState { - return newQAbstractState_U(unsafe.Pointer(C.QState_InitialState(this.h))) + return UnsafeNewQAbstractState(unsafe.Pointer(C.QState_InitialState(this.h))) } func (this *QState) SetInitialState(state *QAbstractState) { diff --git a/qt/gen_qstate.h b/qt/gen_qstate.h index c1eb7613..946e4d29 100644 --- a/qt/gen_qstate.h +++ b/qt/gen_qstate.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstatemachine.cpp b/qt/gen_qstatemachine.cpp index 86624a95..2680a2be 100644 --- a/qt/gen_qstatemachine.cpp +++ b/qt/gen_qstatemachine.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qstatemachine.h" +#include #include "gen_qstatemachine.h" #include "_cgo_export.h" @@ -132,7 +132,7 @@ bool QStateMachine_CancelDelayedEvent(QStateMachine* self, int id) { struct miqt_array* QStateMachine_Configuration(const QStateMachine* self) { QSet _ret = self->configuration(); - // Convert QList<> from C++ memory to manually-managed C memory + // Convert QSet<> from C++ memory to manually-managed C memory QAbstractState** _arr = static_cast(malloc(sizeof(QAbstractState*) * _ret.size())); int _ctr = 0; QSetIterator _itr(_ret); diff --git a/qt/gen_qstatemachine.go b/qt/gen_qstatemachine.go index 23fc8e64..75779215 100644 --- a/qt/gen_qstatemachine.go +++ b/qt/gen_qstatemachine.go @@ -43,14 +43,21 @@ func (this *QStateMachine) cPointer() *C.QStateMachine { return this.h } +func (this *QStateMachine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStateMachine(h *C.QStateMachine) *QStateMachine { if h == nil { return nil } - return &QStateMachine{h: h, QState: newQState_U(unsafe.Pointer(h))} + return &QStateMachine{h: h, QState: UnsafeNewQState(unsafe.Pointer(h))} } -func newQStateMachine_U(h unsafe.Pointer) *QStateMachine { +func UnsafeNewQStateMachine(h unsafe.Pointer) *QStateMachine { return newQStateMachine((*C.QStateMachine)(h)) } @@ -79,7 +86,7 @@ func NewQStateMachine4(childMode QState__ChildMode, parent *QObject) *QStateMach } func (this *QStateMachine) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStateMachine_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStateMachine_MetaObject(this.h))) } func (this *QStateMachine) Metacast(param1 string) unsafe.Pointer { @@ -150,7 +157,7 @@ func (this *QStateMachine) DefaultAnimations() []*QAbstractAnimation { _ret := make([]*QAbstractAnimation, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractAnimation)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAbstractAnimation_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAbstractAnimation(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -185,7 +192,7 @@ func (this *QStateMachine) Configuration() map[*QAbstractState]struct{} { _ret := make(map[*QAbstractState]struct{}, int(_ma.len)) _outCast := (*[0xffff]*C.QAbstractState)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _element := newQAbstractState_U(unsafe.Pointer(_outCast[i])) + _element := UnsafeNewQAbstractState(unsafe.Pointer(_outCast[i])) _ret[_element] = struct{}{} } C.free(unsafe.Pointer(_ma)) @@ -302,14 +309,21 @@ func (this *QStateMachine__SignalEvent) cPointer() *C.QStateMachine__SignalEvent return this.h } +func (this *QStateMachine__SignalEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStateMachine__SignalEvent(h *C.QStateMachine__SignalEvent) *QStateMachine__SignalEvent { if h == nil { return nil } - return &QStateMachine__SignalEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QStateMachine__SignalEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQStateMachine__SignalEvent_U(h unsafe.Pointer) *QStateMachine__SignalEvent { +func UnsafeNewQStateMachine__SignalEvent(h unsafe.Pointer) *QStateMachine__SignalEvent { return newQStateMachine__SignalEvent((*C.QStateMachine__SignalEvent)(h)) } @@ -320,7 +334,7 @@ func NewQStateMachine__SignalEvent(param1 *QStateMachine__SignalEvent) *QStateMa } func (this *QStateMachine__SignalEvent) Sender() *QObject { - return newQObject_U(unsafe.Pointer(C.QStateMachine__SignalEvent_Sender(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QStateMachine__SignalEvent_Sender(this.h))) } func (this *QStateMachine__SignalEvent) SignalIndex() int { @@ -353,14 +367,21 @@ func (this *QStateMachine__WrappedEvent) cPointer() *C.QStateMachine__WrappedEve return this.h } +func (this *QStateMachine__WrappedEvent) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStateMachine__WrappedEvent(h *C.QStateMachine__WrappedEvent) *QStateMachine__WrappedEvent { if h == nil { return nil } - return &QStateMachine__WrappedEvent{h: h, QEvent: newQEvent_U(unsafe.Pointer(h))} + return &QStateMachine__WrappedEvent{h: h, QEvent: UnsafeNewQEvent(unsafe.Pointer(h))} } -func newQStateMachine__WrappedEvent_U(h unsafe.Pointer) *QStateMachine__WrappedEvent { +func UnsafeNewQStateMachine__WrappedEvent(h unsafe.Pointer) *QStateMachine__WrappedEvent { return newQStateMachine__WrappedEvent((*C.QStateMachine__WrappedEvent)(h)) } @@ -377,11 +398,11 @@ func NewQStateMachine__WrappedEvent2(param1 *QStateMachine__WrappedEvent) *QStat } func (this *QStateMachine__WrappedEvent) Object() *QObject { - return newQObject_U(unsafe.Pointer(C.QStateMachine__WrappedEvent_Object(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QStateMachine__WrappedEvent_Object(this.h))) } func (this *QStateMachine__WrappedEvent) Event() *QEvent { - return newQEvent_U(unsafe.Pointer(C.QStateMachine__WrappedEvent_Event(this.h))) + return UnsafeNewQEvent(unsafe.Pointer(C.QStateMachine__WrappedEvent_Event(this.h))) } // Delete this object from C++ memory. diff --git a/qt/gen_qstatemachine.h b/qt/gen_qstatemachine.h index 24667b7a..83227ade 100644 --- a/qt/gen_qstatemachine.h +++ b/qt/gen_qstatemachine.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstatictext.cpp b/qt/gen_qstatictext.cpp index 610cea25..09eeadcf 100644 --- a/qt/gen_qstatictext.cpp +++ b/qt/gen_qstatictext.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qstatictext.h" +#include #include "gen_qstatictext.h" #include "_cgo_export.h" diff --git a/qt/gen_qstatictext.go b/qt/gen_qstatictext.go index cfbae976..fbfc94d4 100644 --- a/qt/gen_qstatictext.go +++ b/qt/gen_qstatictext.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -31,6 +32,13 @@ func (this *QStaticText) cPointer() *C.QStaticText { return this.h } +func (this *QStaticText) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStaticText(h *C.QStaticText) *QStaticText { if h == nil { return nil @@ -38,7 +46,7 @@ func newQStaticText(h *C.QStaticText) *QStaticText { return &QStaticText{h: h} } -func newQStaticText_U(h unsafe.Pointer) *QStaticText { +func UnsafeNewQStaticText(h unsafe.Pointer) *QStaticText { return newQStaticText((*C.QStaticText)(h)) } @@ -50,7 +58,7 @@ func NewQStaticText() *QStaticText { // NewQStaticText2 constructs a new QStaticText object. func NewQStaticText2(text string) *QStaticText { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QStaticText_new2((*C.struct_miqt_string)(text_ms)) return newQStaticText(ret) @@ -71,7 +79,7 @@ func (this *QStaticText) Swap(other *QStaticText) { } func (this *QStaticText) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStaticText_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } diff --git a/qt/gen_qstatictext.h b/qt/gen_qstatictext.h index 5c374ff8..fe8824cf 100644 --- a/qt/gen_qstatictext.h +++ b/qt/gen_qstatictext.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstatusbar.cpp b/qt/gen_qstatusbar.cpp index 740d28a6..dffa9ae5 100644 --- a/qt/gen_qstatusbar.cpp +++ b/qt/gen_qstatusbar.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qstatusbar.h" +#include #include "gen_qstatusbar.h" #include "_cgo_export.h" diff --git a/qt/gen_qstatusbar.go b/qt/gen_qstatusbar.go index 6f15a0fe..17a9507d 100644 --- a/qt/gen_qstatusbar.go +++ b/qt/gen_qstatusbar.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QStatusBar) cPointer() *C.QStatusBar { return this.h } +func (this *QStatusBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStatusBar(h *C.QStatusBar) *QStatusBar { if h == nil { return nil } - return &QStatusBar{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QStatusBar{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQStatusBar_U(h unsafe.Pointer) *QStatusBar { +func UnsafeNewQStatusBar(h unsafe.Pointer) *QStatusBar { return newQStatusBar((*C.QStatusBar)(h)) } @@ -50,7 +58,7 @@ func NewQStatusBar2(parent *QWidget) *QStatusBar { } func (this *QStatusBar) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStatusBar_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStatusBar_MetaObject(this.h))) } func (this *QStatusBar) Metacast(param1 string) unsafe.Pointer { @@ -113,7 +121,7 @@ func (this *QStatusBar) CurrentMessage() string { } func (this *QStatusBar) ShowMessage(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStatusBar_ShowMessage(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -123,7 +131,7 @@ func (this *QStatusBar) ClearMessage() { } func (this *QStatusBar) MessageChanged(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStatusBar_MessageChanged(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -208,7 +216,7 @@ func (this *QStatusBar) InsertPermanentWidget3(index int, widget *QWidget, stret } func (this *QStatusBar) ShowMessage2(text string, timeout int) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStatusBar_ShowMessage2(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(timeout)) } diff --git a/qt/gen_qstatusbar.h b/qt/gen_qstatusbar.h index f005daef..7b0d7523 100644 --- a/qt/gen_qstatusbar.h +++ b/qt/gen_qstatusbar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstorageinfo.cpp b/qt/gen_qstorageinfo.cpp index bb060e79..96e3b2fc 100644 --- a/qt/gen_qstorageinfo.cpp +++ b/qt/gen_qstorageinfo.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qstorageinfo.h" +#include #include "gen_qstorageinfo.h" #include "_cgo_export.h" diff --git a/qt/gen_qstorageinfo.go b/qt/gen_qstorageinfo.go index 3652a5b9..6037d891 100644 --- a/qt/gen_qstorageinfo.go +++ b/qt/gen_qstorageinfo.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QStorageInfo) cPointer() *C.QStorageInfo { return this.h } +func (this *QStorageInfo) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStorageInfo(h *C.QStorageInfo) *QStorageInfo { if h == nil { return nil @@ -31,7 +39,7 @@ func newQStorageInfo(h *C.QStorageInfo) *QStorageInfo { return &QStorageInfo{h: h} } -func newQStorageInfo_U(h unsafe.Pointer) *QStorageInfo { +func UnsafeNewQStorageInfo(h unsafe.Pointer) *QStorageInfo { return newQStorageInfo((*C.QStorageInfo)(h)) } @@ -43,7 +51,7 @@ func NewQStorageInfo() *QStorageInfo { // NewQStorageInfo2 constructs a new QStorageInfo object. func NewQStorageInfo2(path string) *QStorageInfo { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) ret := C.QStorageInfo_new2((*C.struct_miqt_string)(path_ms)) return newQStorageInfo(ret) @@ -70,7 +78,7 @@ func (this *QStorageInfo) Swap(other *QStorageInfo) { } func (this *QStorageInfo) SetPath(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QStorageInfo_SetPath(this.h, (*C.struct_miqt_string)(path_ms)) } diff --git a/qt/gen_qstorageinfo.h b/qt/gen_qstorageinfo.h index 581bea47..ffa83f92 100644 --- a/qt/gen_qstorageinfo.h +++ b/qt/gen_qstorageinfo.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstringbuilder.cpp b/qt/gen_qstringbuilder.cpp index d8654f3b..15758bdf 100644 --- a/qt/gen_qstringbuilder.cpp +++ b/qt/gen_qstringbuilder.cpp @@ -1,4 +1,4 @@ -#include "qstringbuilder.h" +#include #include "gen_qstringbuilder.h" #include "_cgo_export.h" diff --git a/qt/gen_qstringbuilder.go b/qt/gen_qstringbuilder.go index 3df605e8..034c2dcb 100644 --- a/qt/gen_qstringbuilder.go +++ b/qt/gen_qstringbuilder.go @@ -24,6 +24,13 @@ func (this *QAbstractConcatenable) cPointer() *C.QAbstractConcatenable { return this.h } +func (this *QAbstractConcatenable) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractConcatenable(h *C.QAbstractConcatenable) *QAbstractConcatenable { if h == nil { return nil @@ -31,7 +38,7 @@ func newQAbstractConcatenable(h *C.QAbstractConcatenable) *QAbstractConcatenable return &QAbstractConcatenable{h: h} } -func newQAbstractConcatenable_U(h unsafe.Pointer) *QAbstractConcatenable { +func UnsafeNewQAbstractConcatenable(h unsafe.Pointer) *QAbstractConcatenable { return newQAbstractConcatenable((*C.QAbstractConcatenable)(h)) } diff --git a/qt/gen_qstringbuilder.h b/qt/gen_qstringbuilder.h index 6b98fc3a..1a556ddb 100644 --- a/qt/gen_qstringbuilder.h +++ b/qt/gen_qstringbuilder.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstringlistmodel.cpp b/qt/gen_qstringlistmodel.cpp index e23a365f..cef5cb3f 100644 --- a/qt/gen_qstringlistmodel.cpp +++ b/qt/gen_qstringlistmodel.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qstringlistmodel.h" +#include #include "gen_qstringlistmodel.h" #include "_cgo_export.h" @@ -16,7 +16,7 @@ QStringListModel* QStringListModel_new() { } QStringListModel* QStringListModel_new2(struct miqt_array* /* of struct miqt_string* */ strings) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -31,7 +31,7 @@ QStringListModel* QStringListModel_new3(QObject* parent) { } QStringListModel* QStringListModel_new4(struct miqt_array* /* of struct miqt_string* */ strings, QObject* parent) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -117,7 +117,7 @@ struct miqt_array* QStringListModel_StringList(const QStringListModel* self) { } void QStringListModel_SetStringList(QStringListModel* self, struct miqt_array* /* of struct miqt_string* */ strings) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { diff --git a/qt/gen_qstringlistmodel.go b/qt/gen_qstringlistmodel.go index b19b31c2..047fd128 100644 --- a/qt/gen_qstringlistmodel.go +++ b/qt/gen_qstringlistmodel.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QStringListModel) cPointer() *C.QStringListModel { return this.h } +func (this *QStringListModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStringListModel(h *C.QStringListModel) *QStringListModel { if h == nil { return nil } - return &QStringListModel{h: h, QAbstractListModel: newQAbstractListModel_U(unsafe.Pointer(h))} + return &QStringListModel{h: h, QAbstractListModel: UnsafeNewQAbstractListModel(unsafe.Pointer(h))} } -func newQStringListModel_U(h unsafe.Pointer) *QStringListModel { +func UnsafeNewQStringListModel(h unsafe.Pointer) *QStringListModel { return newQStringListModel((*C.QStringListModel)(h)) } @@ -48,7 +56,7 @@ func NewQStringListModel2(strings []string) *QStringListModel { strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -70,7 +78,7 @@ func NewQStringListModel4(strings []string, parent *QObject) *QStringListModel { strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -81,7 +89,7 @@ func NewQStringListModel4(strings []string, parent *QObject) *QStringListModel { } func (this *QStringListModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStringListModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStringListModel_MetaObject(this.h))) } func (this *QStringListModel) Metacast(param1 string) unsafe.Pointer { @@ -169,7 +177,7 @@ func (this *QStringListModel) SetStringList(strings []string) { strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } diff --git a/qt/gen_qstringlistmodel.h b/qt/gen_qstringlistmodel.h index 607bf48d..aaea7176 100644 --- a/qt/gen_qstringlistmodel.h +++ b/qt/gen_qstringlistmodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstringliteral.cpp b/qt/gen_qstringliteral.cpp index 9f563ec0..ceb67114 100644 --- a/qt/gen_qstringliteral.cpp +++ b/qt/gen_qstringliteral.cpp @@ -1,5 +1,5 @@ #include -#include "qstringliteral.h" +#include #include "gen_qstringliteral.h" #include "_cgo_export.h" diff --git a/qt/gen_qstringliteral.go b/qt/gen_qstringliteral.go index 852f4605..cf4c9f4c 100644 --- a/qt/gen_qstringliteral.go +++ b/qt/gen_qstringliteral.go @@ -24,6 +24,13 @@ func (this *QStringDataPtr) cPointer() *C.QStringDataPtr { return this.h } +func (this *QStringDataPtr) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStringDataPtr(h *C.QStringDataPtr) *QStringDataPtr { if h == nil { return nil @@ -31,7 +38,7 @@ func newQStringDataPtr(h *C.QStringDataPtr) *QStringDataPtr { return &QStringDataPtr{h: h} } -func newQStringDataPtr_U(h unsafe.Pointer) *QStringDataPtr { +func UnsafeNewQStringDataPtr(h unsafe.Pointer) *QStringDataPtr { return newQStringDataPtr((*C.QStringDataPtr)(h)) } diff --git a/qt/gen_qstringliteral.h b/qt/gen_qstringliteral.h index 8a6dd618..f14d6999 100644 --- a/qt/gen_qstringliteral.h +++ b/qt/gen_qstringliteral.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstringmatcher.cpp b/qt/gen_qstringmatcher.cpp index 8f54245e..f9841a49 100644 --- a/qt/gen_qstringmatcher.cpp +++ b/qt/gen_qstringmatcher.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qstringmatcher.h" +#include #include "gen_qstringmatcher.h" #include "_cgo_export.h" diff --git a/qt/gen_qstringmatcher.go b/qt/gen_qstringmatcher.go index 8fd86345..3a356bdd 100644 --- a/qt/gen_qstringmatcher.go +++ b/qt/gen_qstringmatcher.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QStringMatcher) cPointer() *C.QStringMatcher { return this.h } +func (this *QStringMatcher) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStringMatcher(h *C.QStringMatcher) *QStringMatcher { if h == nil { return nil @@ -31,7 +39,7 @@ func newQStringMatcher(h *C.QStringMatcher) *QStringMatcher { return &QStringMatcher{h: h} } -func newQStringMatcher_U(h unsafe.Pointer) *QStringMatcher { +func UnsafeNewQStringMatcher(h unsafe.Pointer) *QStringMatcher { return newQStringMatcher((*C.QStringMatcher)(h)) } @@ -43,7 +51,7 @@ func NewQStringMatcher() *QStringMatcher { // NewQStringMatcher2 constructs a new QStringMatcher object. func NewQStringMatcher2(pattern string) *QStringMatcher { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) ret := C.QStringMatcher_new2((*C.struct_miqt_string)(pattern_ms)) return newQStringMatcher(ret) @@ -63,7 +71,7 @@ func NewQStringMatcher4(other *QStringMatcher) *QStringMatcher { // NewQStringMatcher5 constructs a new QStringMatcher object. func NewQStringMatcher5(pattern string, cs CaseSensitivity) *QStringMatcher { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) ret := C.QStringMatcher_new5((*C.struct_miqt_string)(pattern_ms), (C.int)(cs)) return newQStringMatcher(ret) @@ -80,7 +88,7 @@ func (this *QStringMatcher) OperatorAssign(other *QStringMatcher) { } func (this *QStringMatcher) SetPattern(pattern string) { - pattern_ms := miqt_strdupg(pattern) + pattern_ms := libmiqt.Strdupg(pattern) defer C.free(pattern_ms) C.QStringMatcher_SetPattern(this.h, (*C.struct_miqt_string)(pattern_ms)) } @@ -90,7 +98,7 @@ func (this *QStringMatcher) SetCaseSensitivity(cs CaseSensitivity) { } func (this *QStringMatcher) IndexIn(str string) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QStringMatcher_IndexIn(this.h, (*C.struct_miqt_string)(str_ms))) } @@ -111,7 +119,7 @@ func (this *QStringMatcher) CaseSensitivity() CaseSensitivity { } func (this *QStringMatcher) IndexIn22(str string, from int) int { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) return (int)(C.QStringMatcher_IndexIn22(this.h, (*C.struct_miqt_string)(str_ms), (C.int)(from))) } diff --git a/qt/gen_qstringmatcher.h b/qt/gen_qstringmatcher.h index 1325f8b5..83f83218 100644 --- a/qt/gen_qstringmatcher.h +++ b/qt/gen_qstringmatcher.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstringview.cpp b/qt/gen_qstringview.cpp index e101cbc9..57bc58c0 100644 --- a/qt/gen_qstringview.cpp +++ b/qt/gen_qstringview.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qstringview.h" +#include #include "gen_qstringview.h" #include "_cgo_export.h" diff --git a/qt/gen_qstringview.go b/qt/gen_qstringview.go index 07a8f9e7..f0c26513 100644 --- a/qt/gen_qstringview.go +++ b/qt/gen_qstringview.go @@ -24,6 +24,13 @@ func (this *QStringView) cPointer() *C.QStringView { return this.h } +func (this *QStringView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStringView(h *C.QStringView) *QStringView { if h == nil { return nil @@ -31,7 +38,7 @@ func newQStringView(h *C.QStringView) *QStringView { return &QStringView{h: h} } -func newQStringView_U(h unsafe.Pointer) *QStringView { +func UnsafeNewQStringView(h unsafe.Pointer) *QStringView { return newQStringView((*C.QStringView)(h)) } @@ -53,7 +60,7 @@ func (this *QStringView) Size() int64 { } func (this *QStringView) Data() *QChar { - return newQChar_U(unsafe.Pointer(C.QStringView_Data(this.h))) + return UnsafeNewQChar(unsafe.Pointer(C.QStringView_Data(this.h))) } func (this *QStringView) OperatorSubscript(n int64) *QChar { @@ -199,19 +206,19 @@ func (this *QStringView) ToDouble() float64 { } func (this *QStringView) Begin() *QChar { - return newQChar_U(unsafe.Pointer(C.QStringView_Begin(this.h))) + return UnsafeNewQChar(unsafe.Pointer(C.QStringView_Begin(this.h))) } func (this *QStringView) End() *QChar { - return newQChar_U(unsafe.Pointer(C.QStringView_End(this.h))) + return UnsafeNewQChar(unsafe.Pointer(C.QStringView_End(this.h))) } func (this *QStringView) Cbegin() *QChar { - return newQChar_U(unsafe.Pointer(C.QStringView_Cbegin(this.h))) + return UnsafeNewQChar(unsafe.Pointer(C.QStringView_Cbegin(this.h))) } func (this *QStringView) Cend() *QChar { - return newQChar_U(unsafe.Pointer(C.QStringView_Cend(this.h))) + return UnsafeNewQChar(unsafe.Pointer(C.QStringView_Cend(this.h))) } func (this *QStringView) Empty() bool { diff --git a/qt/gen_qstringview.h b/qt/gen_qstringview.h index e9cf14df..4f3a5605 100644 --- a/qt/gen_qstringview.h +++ b/qt/gen_qstringview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstyle.cpp b/qt/gen_qstyle.cpp index e2823744..308a9872 100644 --- a/qt/gen_qstyle.cpp +++ b/qt/gen_qstyle.cpp @@ -16,7 +16,7 @@ #include #include #include -#include "qstyle.h" +#include #include "gen_qstyle.h" #include "_cgo_export.h" diff --git a/qt/gen_qstyle.go b/qt/gen_qstyle.go index 5341646d..571a5dab 100644 --- a/qt/gen_qstyle.go +++ b/qt/gen_qstyle.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -648,19 +649,26 @@ func (this *QStyle) cPointer() *C.QStyle { return this.h } +func (this *QStyle) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyle(h *C.QStyle) *QStyle { if h == nil { return nil } - return &QStyle{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QStyle{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQStyle_U(h unsafe.Pointer) *QStyle { +func UnsafeNewQStyle(h unsafe.Pointer) *QStyle { return newQStyle((*C.QStyle)(h)) } func (this *QStyle) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStyle_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStyle_MetaObject(this.h))) } func (this *QStyle) Metacast(param1 string) unsafe.Pointer { @@ -708,7 +716,7 @@ func (this *QStyle) PolishWithPalette(palette *QPalette) { } func (this *QStyle) ItemTextRect(fm *QFontMetrics, r *QRect, flags int, enabled bool, text string) *QRect { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) _ret := C.QStyle_ItemTextRect(this.h, fm.cPointer(), r.cPointer(), (C.int)(flags), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms)) _goptr := newQRect(_ret) @@ -724,7 +732,7 @@ func (this *QStyle) ItemPixmapRect(r *QRect, flags int, pixmap *QPixmap) *QRect } func (this *QStyle) DrawItemText(painter *QPainter, rect *QRect, flags int, pal *QPalette, enabled bool, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStyle_DrawItemText(this.h, painter.cPointer(), rect.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms)) } @@ -848,7 +856,7 @@ func (this *QStyle) CombinedLayoutSpacing(controls1 QSizePolicy__ControlType, co } func (this *QStyle) Proxy() *QStyle { - return newQStyle_U(unsafe.Pointer(C.QStyle_Proxy(this.h))) + return UnsafeNewQStyle(unsafe.Pointer(C.QStyle_Proxy(this.h))) } func QStyle_Tr2(s string, c string) string { @@ -896,7 +904,7 @@ func QStyle_TrUtf83(s string, c string, n int) string { } func (this *QStyle) DrawItemText7(painter *QPainter, rect *QRect, flags int, pal *QPalette, enabled bool, text string, textRole QPalette__ColorRole) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStyle_DrawItemText7(this.h, painter.cPointer(), rect.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms), (C.int)(textRole)) } diff --git a/qt/gen_qstyle.h b/qt/gen_qstyle.h index 5235330e..26ad5bc8 100644 --- a/qt/gen_qstyle.h +++ b/qt/gen_qstyle.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstyleditemdelegate.cpp b/qt/gen_qstyleditemdelegate.cpp index 6a168241..81affc16 100644 --- a/qt/gen_qstyleditemdelegate.cpp +++ b/qt/gen_qstyleditemdelegate.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qstyleditemdelegate.h" +#include #include "gen_qstyleditemdelegate.h" #include "_cgo_export.h" diff --git a/qt/gen_qstyleditemdelegate.go b/qt/gen_qstyleditemdelegate.go index a8190f91..e968aa81 100644 --- a/qt/gen_qstyleditemdelegate.go +++ b/qt/gen_qstyleditemdelegate.go @@ -25,14 +25,21 @@ func (this *QStyledItemDelegate) cPointer() *C.QStyledItemDelegate { return this.h } +func (this *QStyledItemDelegate) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyledItemDelegate(h *C.QStyledItemDelegate) *QStyledItemDelegate { if h == nil { return nil } - return &QStyledItemDelegate{h: h, QAbstractItemDelegate: newQAbstractItemDelegate_U(unsafe.Pointer(h))} + return &QStyledItemDelegate{h: h, QAbstractItemDelegate: UnsafeNewQAbstractItemDelegate(unsafe.Pointer(h))} } -func newQStyledItemDelegate_U(h unsafe.Pointer) *QStyledItemDelegate { +func UnsafeNewQStyledItemDelegate(h unsafe.Pointer) *QStyledItemDelegate { return newQStyledItemDelegate((*C.QStyledItemDelegate)(h)) } @@ -49,7 +56,7 @@ func NewQStyledItemDelegate2(parent *QObject) *QStyledItemDelegate { } func (this *QStyledItemDelegate) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStyledItemDelegate_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStyledItemDelegate_MetaObject(this.h))) } func (this *QStyledItemDelegate) Metacast(param1 string) unsafe.Pointer { @@ -88,7 +95,7 @@ func (this *QStyledItemDelegate) SizeHint(option *QStyleOptionViewItem, index *Q } func (this *QStyledItemDelegate) CreateEditor(parent *QWidget, option *QStyleOptionViewItem, index *QModelIndex) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QStyledItemDelegate_CreateEditor(this.h, parent.cPointer(), option.cPointer(), index.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QStyledItemDelegate_CreateEditor(this.h, parent.cPointer(), option.cPointer(), index.cPointer()))) } func (this *QStyledItemDelegate) SetEditorData(editor *QWidget, index *QModelIndex) { @@ -104,7 +111,7 @@ func (this *QStyledItemDelegate) UpdateEditorGeometry(editor *QWidget, option *Q } func (this *QStyledItemDelegate) ItemEditorFactory() *QItemEditorFactory { - return newQItemEditorFactory_U(unsafe.Pointer(C.QStyledItemDelegate_ItemEditorFactory(this.h))) + return UnsafeNewQItemEditorFactory(unsafe.Pointer(C.QStyledItemDelegate_ItemEditorFactory(this.h))) } func (this *QStyledItemDelegate) SetItemEditorFactory(factory *QItemEditorFactory) { diff --git a/qt/gen_qstyleditemdelegate.h b/qt/gen_qstyleditemdelegate.h index 31598a54..dc9ee558 100644 --- a/qt/gen_qstyleditemdelegate.h +++ b/qt/gen_qstyleditemdelegate.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstylefactory.cpp b/qt/gen_qstylefactory.cpp index 7147ca78..a5bb7132 100644 --- a/qt/gen_qstylefactory.cpp +++ b/qt/gen_qstylefactory.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qstylefactory.h" +#include #include "gen_qstylefactory.h" #include "_cgo_export.h" diff --git a/qt/gen_qstylefactory.go b/qt/gen_qstylefactory.go index ee5310e3..997c3309 100644 --- a/qt/gen_qstylefactory.go +++ b/qt/gen_qstylefactory.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QStyleFactory) cPointer() *C.QStyleFactory { return this.h } +func (this *QStyleFactory) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleFactory(h *C.QStyleFactory) *QStyleFactory { if h == nil { return nil @@ -31,7 +39,7 @@ func newQStyleFactory(h *C.QStyleFactory) *QStyleFactory { return &QStyleFactory{h: h} } -func newQStyleFactory_U(h unsafe.Pointer) *QStyleFactory { +func UnsafeNewQStyleFactory(h unsafe.Pointer) *QStyleFactory { return newQStyleFactory((*C.QStyleFactory)(h)) } @@ -50,9 +58,9 @@ func QStyleFactory_Keys() []string { } func QStyleFactory_Create(param1 string) *QStyle { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) - return newQStyle_U(unsafe.Pointer(C.QStyleFactory_Create((*C.struct_miqt_string)(param1_ms)))) + return UnsafeNewQStyle(unsafe.Pointer(C.QStyleFactory_Create((*C.struct_miqt_string)(param1_ms)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qstylefactory.h b/qt/gen_qstylefactory.h index 8717f2fe..9a29bfe8 100644 --- a/qt/gen_qstylefactory.h +++ b/qt/gen_qstylefactory.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstylehints.cpp b/qt/gen_qstylehints.cpp index 17b5c54a..30a7b4bd 100644 --- a/qt/gen_qstylehints.cpp +++ b/qt/gen_qstylehints.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qstylehints.h" +#include #include "gen_qstylehints.h" #include "_cgo_export.h" diff --git a/qt/gen_qstylehints.go b/qt/gen_qstylehints.go index 4f0ec7a5..92b42d8e 100644 --- a/qt/gen_qstylehints.go +++ b/qt/gen_qstylehints.go @@ -26,19 +26,26 @@ func (this *QStyleHints) cPointer() *C.QStyleHints { return this.h } +func (this *QStyleHints) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleHints(h *C.QStyleHints) *QStyleHints { if h == nil { return nil } - return &QStyleHints{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QStyleHints{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQStyleHints_U(h unsafe.Pointer) *QStyleHints { +func UnsafeNewQStyleHints(h unsafe.Pointer) *QStyleHints { return newQStyleHints((*C.QStyleHints)(h)) } func (this *QStyleHints) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStyleHints_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStyleHints_MetaObject(this.h))) } func (this *QStyleHints) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qstylehints.h b/qt/gen_qstylehints.h index 5ca7460c..f0e48378 100644 --- a/qt/gen_qstylehints.h +++ b/qt/gen_qstylehints.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstyleoption.cpp b/qt/gen_qstyleoption.cpp index 693ec206..e908b106 100644 --- a/qt/gen_qstyleoption.cpp +++ b/qt/gen_qstyleoption.cpp @@ -28,7 +28,7 @@ #include #include #include -#include "qstyleoption.h" +#include #include "gen_qstyleoption.h" #include "_cgo_export.h" diff --git a/qt/gen_qstyleoption.go b/qt/gen_qstyleoption.go index b1595e35..bebe34bd 100644 --- a/qt/gen_qstyleoption.go +++ b/qt/gen_qstyleoption.go @@ -565,6 +565,13 @@ func (this *QStyleOption) cPointer() *C.QStyleOption { return this.h } +func (this *QStyleOption) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOption(h *C.QStyleOption) *QStyleOption { if h == nil { return nil @@ -572,7 +579,7 @@ func newQStyleOption(h *C.QStyleOption) *QStyleOption { return &QStyleOption{h: h} } -func newQStyleOption_U(h unsafe.Pointer) *QStyleOption { +func UnsafeNewQStyleOption(h unsafe.Pointer) *QStyleOption { return newQStyleOption((*C.QStyleOption)(h)) } @@ -638,14 +645,21 @@ func (this *QStyleOptionFocusRect) cPointer() *C.QStyleOptionFocusRect { return this.h } +func (this *QStyleOptionFocusRect) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionFocusRect(h *C.QStyleOptionFocusRect) *QStyleOptionFocusRect { if h == nil { return nil } - return &QStyleOptionFocusRect{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionFocusRect{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionFocusRect_U(h unsafe.Pointer) *QStyleOptionFocusRect { +func UnsafeNewQStyleOptionFocusRect(h unsafe.Pointer) *QStyleOptionFocusRect { return newQStyleOptionFocusRect((*C.QStyleOptionFocusRect)(h)) } @@ -687,14 +701,21 @@ func (this *QStyleOptionFrame) cPointer() *C.QStyleOptionFrame { return this.h } +func (this *QStyleOptionFrame) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionFrame(h *C.QStyleOptionFrame) *QStyleOptionFrame { if h == nil { return nil } - return &QStyleOptionFrame{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionFrame{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionFrame_U(h unsafe.Pointer) *QStyleOptionFrame { +func UnsafeNewQStyleOptionFrame(h unsafe.Pointer) *QStyleOptionFrame { return newQStyleOptionFrame((*C.QStyleOptionFrame)(h)) } @@ -736,14 +757,21 @@ func (this *QStyleOptionTabWidgetFrame) cPointer() *C.QStyleOptionTabWidgetFrame return this.h } +func (this *QStyleOptionTabWidgetFrame) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionTabWidgetFrame(h *C.QStyleOptionTabWidgetFrame) *QStyleOptionTabWidgetFrame { if h == nil { return nil } - return &QStyleOptionTabWidgetFrame{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionTabWidgetFrame{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionTabWidgetFrame_U(h unsafe.Pointer) *QStyleOptionTabWidgetFrame { +func UnsafeNewQStyleOptionTabWidgetFrame(h unsafe.Pointer) *QStyleOptionTabWidgetFrame { return newQStyleOptionTabWidgetFrame((*C.QStyleOptionTabWidgetFrame)(h)) } @@ -785,14 +813,21 @@ func (this *QStyleOptionTabBarBase) cPointer() *C.QStyleOptionTabBarBase { return this.h } +func (this *QStyleOptionTabBarBase) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionTabBarBase(h *C.QStyleOptionTabBarBase) *QStyleOptionTabBarBase { if h == nil { return nil } - return &QStyleOptionTabBarBase{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionTabBarBase{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionTabBarBase_U(h unsafe.Pointer) *QStyleOptionTabBarBase { +func UnsafeNewQStyleOptionTabBarBase(h unsafe.Pointer) *QStyleOptionTabBarBase { return newQStyleOptionTabBarBase((*C.QStyleOptionTabBarBase)(h)) } @@ -834,14 +869,21 @@ func (this *QStyleOptionHeader) cPointer() *C.QStyleOptionHeader { return this.h } +func (this *QStyleOptionHeader) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionHeader(h *C.QStyleOptionHeader) *QStyleOptionHeader { if h == nil { return nil } - return &QStyleOptionHeader{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionHeader{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionHeader_U(h unsafe.Pointer) *QStyleOptionHeader { +func UnsafeNewQStyleOptionHeader(h unsafe.Pointer) *QStyleOptionHeader { return newQStyleOptionHeader((*C.QStyleOptionHeader)(h)) } @@ -883,14 +925,21 @@ func (this *QStyleOptionButton) cPointer() *C.QStyleOptionButton { return this.h } +func (this *QStyleOptionButton) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionButton(h *C.QStyleOptionButton) *QStyleOptionButton { if h == nil { return nil } - return &QStyleOptionButton{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionButton{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionButton_U(h unsafe.Pointer) *QStyleOptionButton { +func UnsafeNewQStyleOptionButton(h unsafe.Pointer) *QStyleOptionButton { return newQStyleOptionButton((*C.QStyleOptionButton)(h)) } @@ -932,14 +981,21 @@ func (this *QStyleOptionTab) cPointer() *C.QStyleOptionTab { return this.h } +func (this *QStyleOptionTab) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionTab(h *C.QStyleOptionTab) *QStyleOptionTab { if h == nil { return nil } - return &QStyleOptionTab{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionTab{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionTab_U(h unsafe.Pointer) *QStyleOptionTab { +func UnsafeNewQStyleOptionTab(h unsafe.Pointer) *QStyleOptionTab { return newQStyleOptionTab((*C.QStyleOptionTab)(h)) } @@ -981,14 +1037,21 @@ func (this *QStyleOptionTabV4) cPointer() *C.QStyleOptionTabV4 { return this.h } +func (this *QStyleOptionTabV4) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionTabV4(h *C.QStyleOptionTabV4) *QStyleOptionTabV4 { if h == nil { return nil } - return &QStyleOptionTabV4{h: h, QStyleOptionTab: newQStyleOptionTab_U(unsafe.Pointer(h))} + return &QStyleOptionTabV4{h: h, QStyleOptionTab: UnsafeNewQStyleOptionTab(unsafe.Pointer(h))} } -func newQStyleOptionTabV4_U(h unsafe.Pointer) *QStyleOptionTabV4 { +func UnsafeNewQStyleOptionTabV4(h unsafe.Pointer) *QStyleOptionTabV4 { return newQStyleOptionTabV4((*C.QStyleOptionTabV4)(h)) } @@ -1034,14 +1097,21 @@ func (this *QStyleOptionToolBar) cPointer() *C.QStyleOptionToolBar { return this.h } +func (this *QStyleOptionToolBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionToolBar(h *C.QStyleOptionToolBar) *QStyleOptionToolBar { if h == nil { return nil } - return &QStyleOptionToolBar{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionToolBar{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionToolBar_U(h unsafe.Pointer) *QStyleOptionToolBar { +func UnsafeNewQStyleOptionToolBar(h unsafe.Pointer) *QStyleOptionToolBar { return newQStyleOptionToolBar((*C.QStyleOptionToolBar)(h)) } @@ -1083,14 +1153,21 @@ func (this *QStyleOptionProgressBar) cPointer() *C.QStyleOptionProgressBar { return this.h } +func (this *QStyleOptionProgressBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionProgressBar(h *C.QStyleOptionProgressBar) *QStyleOptionProgressBar { if h == nil { return nil } - return &QStyleOptionProgressBar{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionProgressBar{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionProgressBar_U(h unsafe.Pointer) *QStyleOptionProgressBar { +func UnsafeNewQStyleOptionProgressBar(h unsafe.Pointer) *QStyleOptionProgressBar { return newQStyleOptionProgressBar((*C.QStyleOptionProgressBar)(h)) } @@ -1132,14 +1209,21 @@ func (this *QStyleOptionMenuItem) cPointer() *C.QStyleOptionMenuItem { return this.h } +func (this *QStyleOptionMenuItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionMenuItem(h *C.QStyleOptionMenuItem) *QStyleOptionMenuItem { if h == nil { return nil } - return &QStyleOptionMenuItem{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionMenuItem{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionMenuItem_U(h unsafe.Pointer) *QStyleOptionMenuItem { +func UnsafeNewQStyleOptionMenuItem(h unsafe.Pointer) *QStyleOptionMenuItem { return newQStyleOptionMenuItem((*C.QStyleOptionMenuItem)(h)) } @@ -1181,14 +1265,21 @@ func (this *QStyleOptionDockWidget) cPointer() *C.QStyleOptionDockWidget { return this.h } +func (this *QStyleOptionDockWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionDockWidget(h *C.QStyleOptionDockWidget) *QStyleOptionDockWidget { if h == nil { return nil } - return &QStyleOptionDockWidget{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionDockWidget{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionDockWidget_U(h unsafe.Pointer) *QStyleOptionDockWidget { +func UnsafeNewQStyleOptionDockWidget(h unsafe.Pointer) *QStyleOptionDockWidget { return newQStyleOptionDockWidget((*C.QStyleOptionDockWidget)(h)) } @@ -1230,14 +1321,21 @@ func (this *QStyleOptionViewItem) cPointer() *C.QStyleOptionViewItem { return this.h } +func (this *QStyleOptionViewItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionViewItem(h *C.QStyleOptionViewItem) *QStyleOptionViewItem { if h == nil { return nil } - return &QStyleOptionViewItem{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionViewItem{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionViewItem_U(h unsafe.Pointer) *QStyleOptionViewItem { +func UnsafeNewQStyleOptionViewItem(h unsafe.Pointer) *QStyleOptionViewItem { return newQStyleOptionViewItem((*C.QStyleOptionViewItem)(h)) } @@ -1279,14 +1377,21 @@ func (this *QStyleOptionToolBox) cPointer() *C.QStyleOptionToolBox { return this.h } +func (this *QStyleOptionToolBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionToolBox(h *C.QStyleOptionToolBox) *QStyleOptionToolBox { if h == nil { return nil } - return &QStyleOptionToolBox{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionToolBox{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionToolBox_U(h unsafe.Pointer) *QStyleOptionToolBox { +func UnsafeNewQStyleOptionToolBox(h unsafe.Pointer) *QStyleOptionToolBox { return newQStyleOptionToolBox((*C.QStyleOptionToolBox)(h)) } @@ -1328,14 +1433,21 @@ func (this *QStyleOptionRubberBand) cPointer() *C.QStyleOptionRubberBand { return this.h } +func (this *QStyleOptionRubberBand) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionRubberBand(h *C.QStyleOptionRubberBand) *QStyleOptionRubberBand { if h == nil { return nil } - return &QStyleOptionRubberBand{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionRubberBand{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionRubberBand_U(h unsafe.Pointer) *QStyleOptionRubberBand { +func UnsafeNewQStyleOptionRubberBand(h unsafe.Pointer) *QStyleOptionRubberBand { return newQStyleOptionRubberBand((*C.QStyleOptionRubberBand)(h)) } @@ -1377,14 +1489,21 @@ func (this *QStyleOptionComplex) cPointer() *C.QStyleOptionComplex { return this.h } +func (this *QStyleOptionComplex) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionComplex(h *C.QStyleOptionComplex) *QStyleOptionComplex { if h == nil { return nil } - return &QStyleOptionComplex{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionComplex{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionComplex_U(h unsafe.Pointer) *QStyleOptionComplex { +func UnsafeNewQStyleOptionComplex(h unsafe.Pointer) *QStyleOptionComplex { return newQStyleOptionComplex((*C.QStyleOptionComplex)(h)) } @@ -1438,14 +1557,21 @@ func (this *QStyleOptionSlider) cPointer() *C.QStyleOptionSlider { return this.h } +func (this *QStyleOptionSlider) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionSlider(h *C.QStyleOptionSlider) *QStyleOptionSlider { if h == nil { return nil } - return &QStyleOptionSlider{h: h, QStyleOptionComplex: newQStyleOptionComplex_U(unsafe.Pointer(h))} + return &QStyleOptionSlider{h: h, QStyleOptionComplex: UnsafeNewQStyleOptionComplex(unsafe.Pointer(h))} } -func newQStyleOptionSlider_U(h unsafe.Pointer) *QStyleOptionSlider { +func UnsafeNewQStyleOptionSlider(h unsafe.Pointer) *QStyleOptionSlider { return newQStyleOptionSlider((*C.QStyleOptionSlider)(h)) } @@ -1487,14 +1613,21 @@ func (this *QStyleOptionSpinBox) cPointer() *C.QStyleOptionSpinBox { return this.h } +func (this *QStyleOptionSpinBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionSpinBox(h *C.QStyleOptionSpinBox) *QStyleOptionSpinBox { if h == nil { return nil } - return &QStyleOptionSpinBox{h: h, QStyleOptionComplex: newQStyleOptionComplex_U(unsafe.Pointer(h))} + return &QStyleOptionSpinBox{h: h, QStyleOptionComplex: UnsafeNewQStyleOptionComplex(unsafe.Pointer(h))} } -func newQStyleOptionSpinBox_U(h unsafe.Pointer) *QStyleOptionSpinBox { +func UnsafeNewQStyleOptionSpinBox(h unsafe.Pointer) *QStyleOptionSpinBox { return newQStyleOptionSpinBox((*C.QStyleOptionSpinBox)(h)) } @@ -1536,14 +1669,21 @@ func (this *QStyleOptionToolButton) cPointer() *C.QStyleOptionToolButton { return this.h } +func (this *QStyleOptionToolButton) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionToolButton(h *C.QStyleOptionToolButton) *QStyleOptionToolButton { if h == nil { return nil } - return &QStyleOptionToolButton{h: h, QStyleOptionComplex: newQStyleOptionComplex_U(unsafe.Pointer(h))} + return &QStyleOptionToolButton{h: h, QStyleOptionComplex: UnsafeNewQStyleOptionComplex(unsafe.Pointer(h))} } -func newQStyleOptionToolButton_U(h unsafe.Pointer) *QStyleOptionToolButton { +func UnsafeNewQStyleOptionToolButton(h unsafe.Pointer) *QStyleOptionToolButton { return newQStyleOptionToolButton((*C.QStyleOptionToolButton)(h)) } @@ -1585,14 +1725,21 @@ func (this *QStyleOptionComboBox) cPointer() *C.QStyleOptionComboBox { return this.h } +func (this *QStyleOptionComboBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionComboBox(h *C.QStyleOptionComboBox) *QStyleOptionComboBox { if h == nil { return nil } - return &QStyleOptionComboBox{h: h, QStyleOptionComplex: newQStyleOptionComplex_U(unsafe.Pointer(h))} + return &QStyleOptionComboBox{h: h, QStyleOptionComplex: UnsafeNewQStyleOptionComplex(unsafe.Pointer(h))} } -func newQStyleOptionComboBox_U(h unsafe.Pointer) *QStyleOptionComboBox { +func UnsafeNewQStyleOptionComboBox(h unsafe.Pointer) *QStyleOptionComboBox { return newQStyleOptionComboBox((*C.QStyleOptionComboBox)(h)) } @@ -1634,14 +1781,21 @@ func (this *QStyleOptionTitleBar) cPointer() *C.QStyleOptionTitleBar { return this.h } +func (this *QStyleOptionTitleBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionTitleBar(h *C.QStyleOptionTitleBar) *QStyleOptionTitleBar { if h == nil { return nil } - return &QStyleOptionTitleBar{h: h, QStyleOptionComplex: newQStyleOptionComplex_U(unsafe.Pointer(h))} + return &QStyleOptionTitleBar{h: h, QStyleOptionComplex: UnsafeNewQStyleOptionComplex(unsafe.Pointer(h))} } -func newQStyleOptionTitleBar_U(h unsafe.Pointer) *QStyleOptionTitleBar { +func UnsafeNewQStyleOptionTitleBar(h unsafe.Pointer) *QStyleOptionTitleBar { return newQStyleOptionTitleBar((*C.QStyleOptionTitleBar)(h)) } @@ -1683,14 +1837,21 @@ func (this *QStyleOptionGroupBox) cPointer() *C.QStyleOptionGroupBox { return this.h } +func (this *QStyleOptionGroupBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionGroupBox(h *C.QStyleOptionGroupBox) *QStyleOptionGroupBox { if h == nil { return nil } - return &QStyleOptionGroupBox{h: h, QStyleOptionComplex: newQStyleOptionComplex_U(unsafe.Pointer(h))} + return &QStyleOptionGroupBox{h: h, QStyleOptionComplex: UnsafeNewQStyleOptionComplex(unsafe.Pointer(h))} } -func newQStyleOptionGroupBox_U(h unsafe.Pointer) *QStyleOptionGroupBox { +func UnsafeNewQStyleOptionGroupBox(h unsafe.Pointer) *QStyleOptionGroupBox { return newQStyleOptionGroupBox((*C.QStyleOptionGroupBox)(h)) } @@ -1732,14 +1893,21 @@ func (this *QStyleOptionSizeGrip) cPointer() *C.QStyleOptionSizeGrip { return this.h } +func (this *QStyleOptionSizeGrip) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionSizeGrip(h *C.QStyleOptionSizeGrip) *QStyleOptionSizeGrip { if h == nil { return nil } - return &QStyleOptionSizeGrip{h: h, QStyleOptionComplex: newQStyleOptionComplex_U(unsafe.Pointer(h))} + return &QStyleOptionSizeGrip{h: h, QStyleOptionComplex: UnsafeNewQStyleOptionComplex(unsafe.Pointer(h))} } -func newQStyleOptionSizeGrip_U(h unsafe.Pointer) *QStyleOptionSizeGrip { +func UnsafeNewQStyleOptionSizeGrip(h unsafe.Pointer) *QStyleOptionSizeGrip { return newQStyleOptionSizeGrip((*C.QStyleOptionSizeGrip)(h)) } @@ -1781,14 +1949,21 @@ func (this *QStyleOptionGraphicsItem) cPointer() *C.QStyleOptionGraphicsItem { return this.h } +func (this *QStyleOptionGraphicsItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleOptionGraphicsItem(h *C.QStyleOptionGraphicsItem) *QStyleOptionGraphicsItem { if h == nil { return nil } - return &QStyleOptionGraphicsItem{h: h, QStyleOption: newQStyleOption_U(unsafe.Pointer(h))} + return &QStyleOptionGraphicsItem{h: h, QStyleOption: UnsafeNewQStyleOption(unsafe.Pointer(h))} } -func newQStyleOptionGraphicsItem_U(h unsafe.Pointer) *QStyleOptionGraphicsItem { +func UnsafeNewQStyleOptionGraphicsItem(h unsafe.Pointer) *QStyleOptionGraphicsItem { return newQStyleOptionGraphicsItem((*C.QStyleOptionGraphicsItem)(h)) } @@ -1833,6 +2008,13 @@ func (this *QStyleHintReturn) cPointer() *C.QStyleHintReturn { return this.h } +func (this *QStyleHintReturn) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleHintReturn(h *C.QStyleHintReturn) *QStyleHintReturn { if h == nil { return nil @@ -1840,7 +2022,7 @@ func newQStyleHintReturn(h *C.QStyleHintReturn) *QStyleHintReturn { return &QStyleHintReturn{h: h} } -func newQStyleHintReturn_U(h unsafe.Pointer) *QStyleHintReturn { +func UnsafeNewQStyleHintReturn(h unsafe.Pointer) *QStyleHintReturn { return newQStyleHintReturn((*C.QStyleHintReturn)(h)) } @@ -1898,14 +2080,21 @@ func (this *QStyleHintReturnMask) cPointer() *C.QStyleHintReturnMask { return this.h } +func (this *QStyleHintReturnMask) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleHintReturnMask(h *C.QStyleHintReturnMask) *QStyleHintReturnMask { if h == nil { return nil } - return &QStyleHintReturnMask{h: h, QStyleHintReturn: newQStyleHintReturn_U(unsafe.Pointer(h))} + return &QStyleHintReturnMask{h: h, QStyleHintReturn: UnsafeNewQStyleHintReturn(unsafe.Pointer(h))} } -func newQStyleHintReturnMask_U(h unsafe.Pointer) *QStyleHintReturnMask { +func UnsafeNewQStyleHintReturnMask(h unsafe.Pointer) *QStyleHintReturnMask { return newQStyleHintReturnMask((*C.QStyleHintReturnMask)(h)) } @@ -1951,14 +2140,21 @@ func (this *QStyleHintReturnVariant) cPointer() *C.QStyleHintReturnVariant { return this.h } +func (this *QStyleHintReturnVariant) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStyleHintReturnVariant(h *C.QStyleHintReturnVariant) *QStyleHintReturnVariant { if h == nil { return nil } - return &QStyleHintReturnVariant{h: h, QStyleHintReturn: newQStyleHintReturn_U(unsafe.Pointer(h))} + return &QStyleHintReturnVariant{h: h, QStyleHintReturn: UnsafeNewQStyleHintReturn(unsafe.Pointer(h))} } -func newQStyleHintReturnVariant_U(h unsafe.Pointer) *QStyleHintReturnVariant { +func UnsafeNewQStyleHintReturnVariant(h unsafe.Pointer) *QStyleHintReturnVariant { return newQStyleHintReturnVariant((*C.QStyleHintReturnVariant)(h)) } diff --git a/qt/gen_qstyleoption.h b/qt/gen_qstyleoption.h index b2b03744..7c5457f1 100644 --- a/qt/gen_qstyleoption.h +++ b/qt/gen_qstyleoption.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstylepainter.cpp b/qt/gen_qstylepainter.cpp index 0dd00a04..eb8feda2 100644 --- a/qt/gen_qstylepainter.cpp +++ b/qt/gen_qstylepainter.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qstylepainter.h" +#include #include "gen_qstylepainter.h" #include "_cgo_export.h" diff --git a/qt/gen_qstylepainter.go b/qt/gen_qstylepainter.go index af69b434..2300f234 100644 --- a/qt/gen_qstylepainter.go +++ b/qt/gen_qstylepainter.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QStylePainter) cPointer() *C.QStylePainter { return this.h } +func (this *QStylePainter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStylePainter(h *C.QStylePainter) *QStylePainter { if h == nil { return nil } - return &QStylePainter{h: h, QPainter: newQPainter_U(unsafe.Pointer(h))} + return &QStylePainter{h: h, QPainter: UnsafeNewQPainter(unsafe.Pointer(h))} } -func newQStylePainter_U(h unsafe.Pointer) *QStylePainter { +func UnsafeNewQStylePainter(h unsafe.Pointer) *QStylePainter { return newQStylePainter((*C.QStylePainter)(h)) } @@ -75,7 +83,7 @@ func (this *QStylePainter) DrawComplexControl(cc QStyle__ComplexControl, opt *QS } func (this *QStylePainter) DrawItemText(r *QRect, flags int, pal *QPalette, enabled bool, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStylePainter_DrawItemText(this.h, r.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms)) } @@ -85,11 +93,11 @@ func (this *QStylePainter) DrawItemPixmap(r *QRect, flags int, pixmap *QPixmap) } func (this *QStylePainter) Style() *QStyle { - return newQStyle_U(unsafe.Pointer(C.QStylePainter_Style(this.h))) + return UnsafeNewQStyle(unsafe.Pointer(C.QStylePainter_Style(this.h))) } func (this *QStylePainter) DrawItemText6(r *QRect, flags int, pal *QPalette, enabled bool, text string, textRole QPalette__ColorRole) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QStylePainter_DrawItemText6(this.h, r.cPointer(), (C.int)(flags), pal.cPointer(), (C.bool)(enabled), (*C.struct_miqt_string)(text_ms), (C.int)(textRole)) } diff --git a/qt/gen_qstylepainter.h b/qt/gen_qstylepainter.h index 2a7a7651..5f528f2d 100644 --- a/qt/gen_qstylepainter.h +++ b/qt/gen_qstylepainter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qstyleplugin.cpp b/qt/gen_qstyleplugin.cpp index 5b0d72c1..ebf51d87 100644 --- a/qt/gen_qstyleplugin.cpp +++ b/qt/gen_qstyleplugin.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qstyleplugin.h" +#include #include "gen_qstyleplugin.h" #include "_cgo_export.h" diff --git a/qt/gen_qstyleplugin.go b/qt/gen_qstyleplugin.go index 2ab8a985..68e250a4 100644 --- a/qt/gen_qstyleplugin.go +++ b/qt/gen_qstyleplugin.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,19 +26,26 @@ func (this *QStylePlugin) cPointer() *C.QStylePlugin { return this.h } +func (this *QStylePlugin) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQStylePlugin(h *C.QStylePlugin) *QStylePlugin { if h == nil { return nil } - return &QStylePlugin{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QStylePlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQStylePlugin_U(h unsafe.Pointer) *QStylePlugin { +func UnsafeNewQStylePlugin(h unsafe.Pointer) *QStylePlugin { return newQStylePlugin((*C.QStylePlugin)(h)) } func (this *QStylePlugin) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QStylePlugin_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QStylePlugin_MetaObject(this.h))) } func (this *QStylePlugin) Metacast(param1 string) unsafe.Pointer { @@ -65,9 +73,9 @@ func QStylePlugin_TrUtf8(s string) string { } func (this *QStylePlugin) Create(key string) *QStyle { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) - return newQStyle_U(unsafe.Pointer(C.QStylePlugin_Create(this.h, (*C.struct_miqt_string)(key_ms)))) + return UnsafeNewQStyle(unsafe.Pointer(C.QStylePlugin_Create(this.h, (*C.struct_miqt_string)(key_ms)))) } func QStylePlugin_Tr2(s string, c string) string { diff --git a/qt/gen_qstyleplugin.h b/qt/gen_qstyleplugin.h index 2a419b09..2996919a 100644 --- a/qt/gen_qstyleplugin.h +++ b/qt/gen_qstyleplugin.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsurface.cpp b/qt/gen_qsurface.cpp index 61fdcd09..f88d7930 100644 --- a/qt/gen_qsurface.cpp +++ b/qt/gen_qsurface.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qsurface.h" +#include #include "gen_qsurface.h" #include "_cgo_export.h" diff --git a/qt/gen_qsurface.go b/qt/gen_qsurface.go index ebfcd337..855a9028 100644 --- a/qt/gen_qsurface.go +++ b/qt/gen_qsurface.go @@ -42,6 +42,13 @@ func (this *QSurface) cPointer() *C.QSurface { return this.h } +func (this *QSurface) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSurface(h *C.QSurface) *QSurface { if h == nil { return nil @@ -49,7 +56,7 @@ func newQSurface(h *C.QSurface) *QSurface { return &QSurface{h: h} } -func newQSurface_U(h unsafe.Pointer) *QSurface { +func UnsafeNewQSurface(h unsafe.Pointer) *QSurface { return newQSurface((*C.QSurface)(h)) } diff --git a/qt/gen_qsurface.h b/qt/gen_qsurface.h index 9ea19c7f..0ad58a32 100644 --- a/qt/gen_qsurface.h +++ b/qt/gen_qsurface.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsurfaceformat.cpp b/qt/gen_qsurfaceformat.cpp index 10044f2f..c7f60b03 100644 --- a/qt/gen_qsurfaceformat.cpp +++ b/qt/gen_qsurfaceformat.cpp @@ -1,5 +1,5 @@ #include -#include "qsurfaceformat.h" +#include #include "gen_qsurfaceformat.h" #include "_cgo_export.h" diff --git a/qt/gen_qsurfaceformat.go b/qt/gen_qsurfaceformat.go index f7cf7b8e..6ada05be 100644 --- a/qt/gen_qsurfaceformat.go +++ b/qt/gen_qsurfaceformat.go @@ -66,6 +66,13 @@ func (this *QSurfaceFormat) cPointer() *C.QSurfaceFormat { return this.h } +func (this *QSurfaceFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSurfaceFormat(h *C.QSurfaceFormat) *QSurfaceFormat { if h == nil { return nil @@ -73,7 +80,7 @@ func newQSurfaceFormat(h *C.QSurfaceFormat) *QSurfaceFormat { return &QSurfaceFormat{h: h} } -func newQSurfaceFormat_U(h unsafe.Pointer) *QSurfaceFormat { +func UnsafeNewQSurfaceFormat(h unsafe.Pointer) *QSurfaceFormat { return newQSurfaceFormat((*C.QSurfaceFormat)(h)) } diff --git a/qt/gen_qsurfaceformat.h b/qt/gen_qsurfaceformat.h index 9b93ebd2..58474399 100644 --- a/qt/gen_qsurfaceformat.h +++ b/qt/gen_qsurfaceformat.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsyntaxhighlighter.cpp b/qt/gen_qsyntaxhighlighter.cpp index 01bedbef..51ca1f12 100644 --- a/qt/gen_qsyntaxhighlighter.cpp +++ b/qt/gen_qsyntaxhighlighter.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qsyntaxhighlighter.h" +#include #include "gen_qsyntaxhighlighter.h" #include "_cgo_export.h" diff --git a/qt/gen_qsyntaxhighlighter.go b/qt/gen_qsyntaxhighlighter.go index ab910c24..1364030a 100644 --- a/qt/gen_qsyntaxhighlighter.go +++ b/qt/gen_qsyntaxhighlighter.go @@ -25,19 +25,26 @@ func (this *QSyntaxHighlighter) cPointer() *C.QSyntaxHighlighter { return this.h } +func (this *QSyntaxHighlighter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSyntaxHighlighter(h *C.QSyntaxHighlighter) *QSyntaxHighlighter { if h == nil { return nil } - return &QSyntaxHighlighter{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QSyntaxHighlighter{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQSyntaxHighlighter_U(h unsafe.Pointer) *QSyntaxHighlighter { +func UnsafeNewQSyntaxHighlighter(h unsafe.Pointer) *QSyntaxHighlighter { return newQSyntaxHighlighter((*C.QSyntaxHighlighter)(h)) } func (this *QSyntaxHighlighter) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSyntaxHighlighter_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSyntaxHighlighter_MetaObject(this.h))) } func (this *QSyntaxHighlighter) Metacast(param1 string) unsafe.Pointer { @@ -69,7 +76,7 @@ func (this *QSyntaxHighlighter) SetDocument(doc *QTextDocument) { } func (this *QSyntaxHighlighter) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QSyntaxHighlighter_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QSyntaxHighlighter_Document(this.h))) } func (this *QSyntaxHighlighter) Rehighlight() { diff --git a/qt/gen_qsyntaxhighlighter.h b/qt/gen_qsyntaxhighlighter.h index d864f113..d2b0c2b2 100644 --- a/qt/gen_qsyntaxhighlighter.h +++ b/qt/gen_qsyntaxhighlighter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsystemsemaphore.cpp b/qt/gen_qsystemsemaphore.cpp index 3e71a7b8..cea7ca00 100644 --- a/qt/gen_qsystemsemaphore.cpp +++ b/qt/gen_qsystemsemaphore.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qsystemsemaphore.h" +#include #include "gen_qsystemsemaphore.h" #include "_cgo_export.h" diff --git a/qt/gen_qsystemsemaphore.go b/qt/gen_qsystemsemaphore.go index 781884de..16f550e3 100644 --- a/qt/gen_qsystemsemaphore.go +++ b/qt/gen_qsystemsemaphore.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -43,6 +44,13 @@ func (this *QSystemSemaphore) cPointer() *C.QSystemSemaphore { return this.h } +func (this *QSystemSemaphore) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSystemSemaphore(h *C.QSystemSemaphore) *QSystemSemaphore { if h == nil { return nil @@ -50,13 +58,13 @@ func newQSystemSemaphore(h *C.QSystemSemaphore) *QSystemSemaphore { return &QSystemSemaphore{h: h} } -func newQSystemSemaphore_U(h unsafe.Pointer) *QSystemSemaphore { +func UnsafeNewQSystemSemaphore(h unsafe.Pointer) *QSystemSemaphore { return newQSystemSemaphore((*C.QSystemSemaphore)(h)) } // NewQSystemSemaphore constructs a new QSystemSemaphore object. func NewQSystemSemaphore(key string) *QSystemSemaphore { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QSystemSemaphore_new((*C.struct_miqt_string)(key_ms)) return newQSystemSemaphore(ret) @@ -64,7 +72,7 @@ func NewQSystemSemaphore(key string) *QSystemSemaphore { // NewQSystemSemaphore2 constructs a new QSystemSemaphore object. func NewQSystemSemaphore2(key string, initialValue int) *QSystemSemaphore { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QSystemSemaphore_new2((*C.struct_miqt_string)(key_ms), (C.int)(initialValue)) return newQSystemSemaphore(ret) @@ -72,14 +80,14 @@ func NewQSystemSemaphore2(key string, initialValue int) *QSystemSemaphore { // NewQSystemSemaphore3 constructs a new QSystemSemaphore object. func NewQSystemSemaphore3(key string, initialValue int, mode QSystemSemaphore__AccessMode) *QSystemSemaphore { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) ret := C.QSystemSemaphore_new3((*C.struct_miqt_string)(key_ms), (C.int)(initialValue), (C.int)(mode)) return newQSystemSemaphore(ret) } func (this *QSystemSemaphore) SetKey(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QSystemSemaphore_SetKey(this.h, (*C.struct_miqt_string)(key_ms)) } @@ -111,13 +119,13 @@ func (this *QSystemSemaphore) ErrorString() string { } func (this *QSystemSemaphore) SetKey2(key string, initialValue int) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QSystemSemaphore_SetKey2(this.h, (*C.struct_miqt_string)(key_ms), (C.int)(initialValue)) } func (this *QSystemSemaphore) SetKey3(key string, initialValue int, mode QSystemSemaphore__AccessMode) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QSystemSemaphore_SetKey3(this.h, (*C.struct_miqt_string)(key_ms), (C.int)(initialValue), (C.int)(mode)) } diff --git a/qt/gen_qsystemsemaphore.h b/qt/gen_qsystemsemaphore.h index 77f71ac2..812f3c59 100644 --- a/qt/gen_qsystemsemaphore.h +++ b/qt/gen_qsystemsemaphore.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qsystemtrayicon.cpp b/qt/gen_qsystemtrayicon.cpp index ffbcfc43..1c85eb96 100644 --- a/qt/gen_qsystemtrayicon.cpp +++ b/qt/gen_qsystemtrayicon.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qsystemtrayicon.h" +#include #include "gen_qsystemtrayicon.h" #include "_cgo_export.h" diff --git a/qt/gen_qsystemtrayicon.go b/qt/gen_qsystemtrayicon.go index 91c38f26..185603b7 100644 --- a/qt/gen_qsystemtrayicon.go +++ b/qt/gen_qsystemtrayicon.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -45,14 +46,21 @@ func (this *QSystemTrayIcon) cPointer() *C.QSystemTrayIcon { return this.h } +func (this *QSystemTrayIcon) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSystemTrayIcon(h *C.QSystemTrayIcon) *QSystemTrayIcon { if h == nil { return nil } - return &QSystemTrayIcon{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QSystemTrayIcon{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQSystemTrayIcon_U(h unsafe.Pointer) *QSystemTrayIcon { +func UnsafeNewQSystemTrayIcon(h unsafe.Pointer) *QSystemTrayIcon { return newQSystemTrayIcon((*C.QSystemTrayIcon)(h)) } @@ -81,7 +89,7 @@ func NewQSystemTrayIcon4(icon *QIcon, parent *QObject) *QSystemTrayIcon { } func (this *QSystemTrayIcon) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QSystemTrayIcon_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QSystemTrayIcon_MetaObject(this.h))) } func (this *QSystemTrayIcon) Metacast(param1 string) unsafe.Pointer { @@ -113,7 +121,7 @@ func (this *QSystemTrayIcon) SetContextMenu(menu *QMenu) { } func (this *QSystemTrayIcon) ContextMenu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QSystemTrayIcon_ContextMenu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QSystemTrayIcon_ContextMenu(this.h))) } func (this *QSystemTrayIcon) Icon() *QIcon { @@ -135,7 +143,7 @@ func (this *QSystemTrayIcon) ToolTip() string { } func (this *QSystemTrayIcon) SetToolTip(tip string) { - tip_ms := miqt_strdupg(tip) + tip_ms := libmiqt.Strdupg(tip) defer C.free(tip_ms) C.QSystemTrayIcon_SetToolTip(this.h, (*C.struct_miqt_string)(tip_ms)) } @@ -172,17 +180,17 @@ func (this *QSystemTrayIcon) Hide() { } func (this *QSystemTrayIcon) ShowMessage(title string, msg string, icon *QIcon) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - msg_ms := miqt_strdupg(msg) + msg_ms := libmiqt.Strdupg(msg) defer C.free(msg_ms) C.QSystemTrayIcon_ShowMessage(this.h, (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(msg_ms), icon.cPointer()) } func (this *QSystemTrayIcon) ShowMessage2(title string, msg string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - msg_ms := miqt_strdupg(msg) + msg_ms := libmiqt.Strdupg(msg) defer C.free(msg_ms) C.QSystemTrayIcon_ShowMessage2(this.h, (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(msg_ms)) } @@ -269,25 +277,25 @@ func QSystemTrayIcon_TrUtf83(s string, c string, n int) string { } func (this *QSystemTrayIcon) ShowMessage4(title string, msg string, icon *QIcon, msecs int) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - msg_ms := miqt_strdupg(msg) + msg_ms := libmiqt.Strdupg(msg) defer C.free(msg_ms) C.QSystemTrayIcon_ShowMessage4(this.h, (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(msg_ms), icon.cPointer(), (C.int)(msecs)) } func (this *QSystemTrayIcon) ShowMessage3(title string, msg string, icon QSystemTrayIcon__MessageIcon) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - msg_ms := miqt_strdupg(msg) + msg_ms := libmiqt.Strdupg(msg) defer C.free(msg_ms) C.QSystemTrayIcon_ShowMessage3(this.h, (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(msg_ms), (C.int)(icon)) } func (this *QSystemTrayIcon) ShowMessage42(title string, msg string, icon QSystemTrayIcon__MessageIcon, msecs int) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) - msg_ms := miqt_strdupg(msg) + msg_ms := libmiqt.Strdupg(msg) defer C.free(msg_ms) C.QSystemTrayIcon_ShowMessage42(this.h, (*C.struct_miqt_string)(title_ms), (*C.struct_miqt_string)(msg_ms), (C.int)(icon), (C.int)(msecs)) } diff --git a/qt/gen_qsystemtrayicon.h b/qt/gen_qsystemtrayicon.h index bc2e3cea..2d2157ba 100644 --- a/qt/gen_qsystemtrayicon.h +++ b/qt/gen_qsystemtrayicon.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtabbar.cpp b/qt/gen_qtabbar.cpp index 24155fd2..b54e8b88 100644 --- a/qt/gen_qtabbar.cpp +++ b/qt/gen_qtabbar.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qtabbar.h" +#include #include "gen_qtabbar.h" #include "_cgo_export.h" diff --git a/qt/gen_qtabbar.go b/qt/gen_qtabbar.go index bb41a404..cf64c51e 100644 --- a/qt/gen_qtabbar.go +++ b/qt/gen_qtabbar.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -54,14 +55,21 @@ func (this *QTabBar) cPointer() *C.QTabBar { return this.h } +func (this *QTabBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTabBar(h *C.QTabBar) *QTabBar { if h == nil { return nil } - return &QTabBar{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QTabBar{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQTabBar_U(h unsafe.Pointer) *QTabBar { +func UnsafeNewQTabBar(h unsafe.Pointer) *QTabBar { return newQTabBar((*C.QTabBar)(h)) } @@ -78,7 +86,7 @@ func NewQTabBar2(parent *QWidget) *QTabBar { } func (this *QTabBar) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTabBar_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTabBar_MetaObject(this.h))) } func (this *QTabBar) Metacast(param1 string) unsafe.Pointer { @@ -114,25 +122,25 @@ func (this *QTabBar) SetShape(shape QTabBar__Shape) { } func (this *QTabBar) AddTab(text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QTabBar_AddTab(this.h, (*C.struct_miqt_string)(text_ms))) } func (this *QTabBar) AddTab2(icon *QIcon, text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QTabBar_AddTab2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms))) } func (this *QTabBar) InsertTab(index int, text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QTabBar_InsertTab(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms))) } func (this *QTabBar) InsertTab2(index int, icon *QIcon, text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QTabBar_InsertTab2(this.h, (C.int)(index), icon.cPointer(), (*C.struct_miqt_string)(text_ms))) } @@ -169,7 +177,7 @@ func (this *QTabBar) TabText(index int) string { } func (this *QTabBar) SetTabText(index int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTabBar_SetTabText(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms)) } @@ -205,7 +213,7 @@ func (this *QTabBar) SetElideMode(mode TextElideMode) { } func (this *QTabBar) SetTabToolTip(index int, tip string) { - tip_ms := miqt_strdupg(tip) + tip_ms := libmiqt.Strdupg(tip) defer C.free(tip_ms) C.QTabBar_SetTabToolTip(this.h, (C.int)(index), (*C.struct_miqt_string)(tip_ms)) } @@ -218,7 +226,7 @@ func (this *QTabBar) TabToolTip(index int) string { } func (this *QTabBar) SetTabWhatsThis(index int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTabBar_SetTabWhatsThis(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms)) } @@ -314,7 +322,7 @@ func (this *QTabBar) SetTabButton(index int, position QTabBar__ButtonPosition, w } func (this *QTabBar) TabButton(index int, position QTabBar__ButtonPosition) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QTabBar_TabButton(this.h, (C.int)(index), (C.int)(position)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QTabBar_TabButton(this.h, (C.int)(index), (C.int)(position)))) } func (this *QTabBar) SelectionBehaviorOnRemove() QTabBar__SelectionBehavior { @@ -373,7 +381,7 @@ func (this *QTabBar) AccessibleTabName(index int) string { } func (this *QTabBar) SetAccessibleTabName(index int, name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTabBar_SetAccessibleTabName(this.h, (C.int)(index), (*C.struct_miqt_string)(name_ms)) } diff --git a/qt/gen_qtabbar.h b/qt/gen_qtabbar.h index 4b3d684f..9e364b9b 100644 --- a/qt/gen_qtabbar.h +++ b/qt/gen_qtabbar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtableview.cpp b/qt/gen_qtableview.cpp index 723e43cd..f0443629 100644 --- a/qt/gen_qtableview.cpp +++ b/qt/gen_qtableview.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qtableview.h" +#include #include "gen_qtableview.h" #include "_cgo_export.h" diff --git a/qt/gen_qtableview.go b/qt/gen_qtableview.go index 59b6fbe0..3c3b2ebb 100644 --- a/qt/gen_qtableview.go +++ b/qt/gen_qtableview.go @@ -25,14 +25,21 @@ func (this *QTableView) cPointer() *C.QTableView { return this.h } +func (this *QTableView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTableView(h *C.QTableView) *QTableView { if h == nil { return nil } - return &QTableView{h: h, QAbstractItemView: newQAbstractItemView_U(unsafe.Pointer(h))} + return &QTableView{h: h, QAbstractItemView: UnsafeNewQAbstractItemView(unsafe.Pointer(h))} } -func newQTableView_U(h unsafe.Pointer) *QTableView { +func UnsafeNewQTableView(h unsafe.Pointer) *QTableView { return newQTableView((*C.QTableView)(h)) } @@ -49,7 +56,7 @@ func NewQTableView2(parent *QWidget) *QTableView { } func (this *QTableView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTableView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTableView_MetaObject(this.h))) } func (this *QTableView) Metacast(param1 string) unsafe.Pointer { @@ -93,11 +100,11 @@ func (this *QTableView) DoItemsLayout() { } func (this *QTableView) HorizontalHeader() *QHeaderView { - return newQHeaderView_U(unsafe.Pointer(C.QTableView_HorizontalHeader(this.h))) + return UnsafeNewQHeaderView(unsafe.Pointer(C.QTableView_HorizontalHeader(this.h))) } func (this *QTableView) VerticalHeader() *QHeaderView { - return newQHeaderView_U(unsafe.Pointer(C.QTableView_VerticalHeader(this.h))) + return UnsafeNewQHeaderView(unsafe.Pointer(C.QTableView_VerticalHeader(this.h))) } func (this *QTableView) SetHorizontalHeader(header *QHeaderView) { diff --git a/qt/gen_qtableview.h b/qt/gen_qtableview.h index d2dadfd0..49b6d915 100644 --- a/qt/gen_qtableview.h +++ b/qt/gen_qtableview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtablewidget.cpp b/qt/gen_qtablewidget.cpp index 511f8bb7..4c796fd4 100644 --- a/qt/gen_qtablewidget.cpp +++ b/qt/gen_qtablewidget.cpp @@ -16,7 +16,7 @@ #include #include #include -#include "qtablewidget.h" +#include #include "gen_qtablewidget.h" #include "_cgo_export.h" @@ -381,7 +381,7 @@ QTableWidgetItem* QTableWidget_TakeHorizontalHeaderItem(QTableWidget* self, int } void QTableWidget_SetVerticalHeaderLabels(QTableWidget* self, struct miqt_array* /* of struct miqt_string* */ labels) { - QList labels_QList; + QStringList labels_QList; labels_QList.reserve(labels->len); struct miqt_string** labels_arr = static_cast(labels->data); for(size_t i = 0; i < labels->len; ++i) { @@ -392,7 +392,7 @@ void QTableWidget_SetVerticalHeaderLabels(QTableWidget* self, struct miqt_array* } void QTableWidget_SetHorizontalHeaderLabels(QTableWidget* self, struct miqt_array* /* of struct miqt_string* */ labels) { - QList labels_QList; + QStringList labels_QList; labels_QList.reserve(labels->len); struct miqt_string** labels_arr = static_cast(labels->data); for(size_t i = 0; i < labels->len; ++i) { diff --git a/qt/gen_qtablewidget.go b/qt/gen_qtablewidget.go index 72f01de0..be22123b 100644 --- a/qt/gen_qtablewidget.go +++ b/qt/gen_qtablewidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -32,6 +33,13 @@ func (this *QTableWidgetSelectionRange) cPointer() *C.QTableWidgetSelectionRange return this.h } +func (this *QTableWidgetSelectionRange) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTableWidgetSelectionRange(h *C.QTableWidgetSelectionRange) *QTableWidgetSelectionRange { if h == nil { return nil @@ -39,7 +47,7 @@ func newQTableWidgetSelectionRange(h *C.QTableWidgetSelectionRange) *QTableWidge return &QTableWidgetSelectionRange{h: h} } -func newQTableWidgetSelectionRange_U(h unsafe.Pointer) *QTableWidgetSelectionRange { +func UnsafeNewQTableWidgetSelectionRange(h unsafe.Pointer) *QTableWidgetSelectionRange { return newQTableWidgetSelectionRange((*C.QTableWidgetSelectionRange)(h)) } @@ -114,6 +122,13 @@ func (this *QTableWidgetItem) cPointer() *C.QTableWidgetItem { return this.h } +func (this *QTableWidgetItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTableWidgetItem(h *C.QTableWidgetItem) *QTableWidgetItem { if h == nil { return nil @@ -121,7 +136,7 @@ func newQTableWidgetItem(h *C.QTableWidgetItem) *QTableWidgetItem { return &QTableWidgetItem{h: h} } -func newQTableWidgetItem_U(h unsafe.Pointer) *QTableWidgetItem { +func UnsafeNewQTableWidgetItem(h unsafe.Pointer) *QTableWidgetItem { return newQTableWidgetItem((*C.QTableWidgetItem)(h)) } @@ -133,7 +148,7 @@ func NewQTableWidgetItem() *QTableWidgetItem { // NewQTableWidgetItem2 constructs a new QTableWidgetItem object. func NewQTableWidgetItem2(text string) *QTableWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTableWidgetItem_new2((*C.struct_miqt_string)(text_ms)) return newQTableWidgetItem(ret) @@ -141,7 +156,7 @@ func NewQTableWidgetItem2(text string) *QTableWidgetItem { // NewQTableWidgetItem3 constructs a new QTableWidgetItem object. func NewQTableWidgetItem3(icon *QIcon, text string) *QTableWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTableWidgetItem_new3(icon.cPointer(), (*C.struct_miqt_string)(text_ms)) return newQTableWidgetItem(ret) @@ -161,7 +176,7 @@ func NewQTableWidgetItem5(typeVal int) *QTableWidgetItem { // NewQTableWidgetItem6 constructs a new QTableWidgetItem object. func NewQTableWidgetItem6(text string, typeVal int) *QTableWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTableWidgetItem_new6((*C.struct_miqt_string)(text_ms), (C.int)(typeVal)) return newQTableWidgetItem(ret) @@ -169,18 +184,18 @@ func NewQTableWidgetItem6(text string, typeVal int) *QTableWidgetItem { // NewQTableWidgetItem7 constructs a new QTableWidgetItem object. func NewQTableWidgetItem7(icon *QIcon, text string, typeVal int) *QTableWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTableWidgetItem_new7(icon.cPointer(), (*C.struct_miqt_string)(text_ms), (C.int)(typeVal)) return newQTableWidgetItem(ret) } func (this *QTableWidgetItem) Clone() *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidgetItem_Clone(this.h))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidgetItem_Clone(this.h))) } func (this *QTableWidgetItem) TableWidget() *QTableWidget { - return newQTableWidget_U(unsafe.Pointer(C.QTableWidgetItem_TableWidget(this.h))) + return UnsafeNewQTableWidget(unsafe.Pointer(C.QTableWidgetItem_TableWidget(this.h))) } func (this *QTableWidgetItem) Row() int { @@ -215,7 +230,7 @@ func (this *QTableWidgetItem) Text() string { } func (this *QTableWidgetItem) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTableWidgetItem_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -239,7 +254,7 @@ func (this *QTableWidgetItem) StatusTip() string { } func (this *QTableWidgetItem) SetStatusTip(statusTip string) { - statusTip_ms := miqt_strdupg(statusTip) + statusTip_ms := libmiqt.Strdupg(statusTip) defer C.free(statusTip_ms) C.QTableWidgetItem_SetStatusTip(this.h, (*C.struct_miqt_string)(statusTip_ms)) } @@ -252,7 +267,7 @@ func (this *QTableWidgetItem) ToolTip() string { } func (this *QTableWidgetItem) SetToolTip(toolTip string) { - toolTip_ms := miqt_strdupg(toolTip) + toolTip_ms := libmiqt.Strdupg(toolTip) defer C.free(toolTip_ms) C.QTableWidgetItem_SetToolTip(this.h, (*C.struct_miqt_string)(toolTip_ms)) } @@ -265,7 +280,7 @@ func (this *QTableWidgetItem) WhatsThis() string { } func (this *QTableWidgetItem) SetWhatsThis(whatsThis string) { - whatsThis_ms := miqt_strdupg(whatsThis) + whatsThis_ms := libmiqt.Strdupg(whatsThis) defer C.free(whatsThis_ms) C.QTableWidgetItem_SetWhatsThis(this.h, (*C.struct_miqt_string)(whatsThis_ms)) } @@ -409,14 +424,21 @@ func (this *QTableWidget) cPointer() *C.QTableWidget { return this.h } +func (this *QTableWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTableWidget(h *C.QTableWidget) *QTableWidget { if h == nil { return nil } - return &QTableWidget{h: h, QTableView: newQTableView_U(unsafe.Pointer(h))} + return &QTableWidget{h: h, QTableView: UnsafeNewQTableView(unsafe.Pointer(h))} } -func newQTableWidget_U(h unsafe.Pointer) *QTableWidget { +func UnsafeNewQTableWidget(h unsafe.Pointer) *QTableWidget { return newQTableWidget((*C.QTableWidget)(h)) } @@ -445,7 +467,7 @@ func NewQTableWidget4(rows int, columns int, parent *QWidget) *QTableWidget { } func (this *QTableWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTableWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTableWidget_MetaObject(this.h))) } func (this *QTableWidget) Metacast(param1 string) unsafe.Pointer { @@ -497,7 +519,7 @@ func (this *QTableWidget) Column(item *QTableWidgetItem) int { } func (this *QTableWidget) Item(row int, column int) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_Item(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_Item(this.h, (C.int)(row), (C.int)(column)))) } func (this *QTableWidget) SetItem(row int, column int, item *QTableWidgetItem) { @@ -505,11 +527,11 @@ func (this *QTableWidget) SetItem(row int, column int, item *QTableWidgetItem) { } func (this *QTableWidget) TakeItem(row int, column int) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_TakeItem(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_TakeItem(this.h, (C.int)(row), (C.int)(column)))) } func (this *QTableWidget) VerticalHeaderItem(row int) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_VerticalHeaderItem(this.h, (C.int)(row)))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_VerticalHeaderItem(this.h, (C.int)(row)))) } func (this *QTableWidget) SetVerticalHeaderItem(row int, item *QTableWidgetItem) { @@ -517,11 +539,11 @@ func (this *QTableWidget) SetVerticalHeaderItem(row int, item *QTableWidgetItem) } func (this *QTableWidget) TakeVerticalHeaderItem(row int) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_TakeVerticalHeaderItem(this.h, (C.int)(row)))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_TakeVerticalHeaderItem(this.h, (C.int)(row)))) } func (this *QTableWidget) HorizontalHeaderItem(column int) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_HorizontalHeaderItem(this.h, (C.int)(column)))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_HorizontalHeaderItem(this.h, (C.int)(column)))) } func (this *QTableWidget) SetHorizontalHeaderItem(column int, item *QTableWidgetItem) { @@ -529,7 +551,7 @@ func (this *QTableWidget) SetHorizontalHeaderItem(column int, item *QTableWidget } func (this *QTableWidget) TakeHorizontalHeaderItem(column int) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_TakeHorizontalHeaderItem(this.h, (C.int)(column)))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_TakeHorizontalHeaderItem(this.h, (C.int)(column)))) } func (this *QTableWidget) SetVerticalHeaderLabels(labels []string) { @@ -537,7 +559,7 @@ func (this *QTableWidget) SetVerticalHeaderLabels(labels []string) { labels_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(labels)))) defer C.free(unsafe.Pointer(labels_CArray)) for i := range labels { - labels_i_ms := miqt_strdupg(labels[i]) + labels_i_ms := libmiqt.Strdupg(labels[i]) defer C.free(labels_i_ms) labels_CArray[i] = (*C.struct_miqt_string)(labels_i_ms) } @@ -551,7 +573,7 @@ func (this *QTableWidget) SetHorizontalHeaderLabels(labels []string) { labels_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(labels)))) defer C.free(unsafe.Pointer(labels_CArray)) for i := range labels { - labels_i_ms := miqt_strdupg(labels[i]) + labels_i_ms := libmiqt.Strdupg(labels[i]) defer C.free(labels_i_ms) labels_CArray[i] = (*C.struct_miqt_string)(labels_i_ms) } @@ -569,7 +591,7 @@ func (this *QTableWidget) CurrentColumn() int { } func (this *QTableWidget) CurrentItem() *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_CurrentItem(this.h))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_CurrentItem(this.h))) } func (this *QTableWidget) SetCurrentItem(item *QTableWidgetItem) { @@ -617,7 +639,7 @@ func (this *QTableWidget) IsPersistentEditorOpen(item *QTableWidgetItem) bool { } func (this *QTableWidget) CellWidget(row int, column int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QTableWidget_CellWidget(this.h, (C.int)(row), (C.int)(column)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QTableWidget_CellWidget(this.h, (C.int)(row), (C.int)(column)))) } func (this *QTableWidget) SetCellWidget(row int, column int, widget *QWidget) { @@ -659,20 +681,20 @@ func (this *QTableWidget) SelectedItems() []*QTableWidgetItem { _ret := make([]*QTableWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QTableWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTableWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTableWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QTableWidget) FindItems(text string, flags MatchFlag) []*QTableWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QTableWidget_FindItems(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(flags)) _ret := make([]*QTableWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QTableWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTableWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTableWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -687,11 +709,11 @@ func (this *QTableWidget) VisualColumn(logicalColumn int) int { } func (this *QTableWidget) ItemAt(p *QPoint) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_ItemAt(this.h, p.cPointer()))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_ItemAt(this.h, p.cPointer()))) } func (this *QTableWidget) ItemAt2(x int, y int) *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) } func (this *QTableWidget) VisualItemRect(item *QTableWidgetItem) *QRect { @@ -702,7 +724,7 @@ func (this *QTableWidget) VisualItemRect(item *QTableWidgetItem) *QRect { } func (this *QTableWidget) ItemPrototype() *QTableWidgetItem { - return newQTableWidgetItem_U(unsafe.Pointer(C.QTableWidget_ItemPrototype(this.h))) + return UnsafeNewQTableWidgetItem(unsafe.Pointer(C.QTableWidget_ItemPrototype(this.h))) } func (this *QTableWidget) SetItemPrototype(item *QTableWidgetItem) { @@ -752,7 +774,7 @@ func miqt_exec_callback_QTableWidget_ItemPressed(cb C.intptr_t, item *C.QTableWi } // Convert all CABI parameters to Go parameters - slotval1 := newQTableWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTableWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -772,7 +794,7 @@ func miqt_exec_callback_QTableWidget_ItemClicked(cb C.intptr_t, item *C.QTableWi } // Convert all CABI parameters to Go parameters - slotval1 := newQTableWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTableWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -792,7 +814,7 @@ func miqt_exec_callback_QTableWidget_ItemDoubleClicked(cb C.intptr_t, item *C.QT } // Convert all CABI parameters to Go parameters - slotval1 := newQTableWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTableWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -812,7 +834,7 @@ func miqt_exec_callback_QTableWidget_ItemActivated(cb C.intptr_t, item *C.QTable } // Convert all CABI parameters to Go parameters - slotval1 := newQTableWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTableWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -832,7 +854,7 @@ func miqt_exec_callback_QTableWidget_ItemEntered(cb C.intptr_t, item *C.QTableWi } // Convert all CABI parameters to Go parameters - slotval1 := newQTableWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTableWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -852,7 +874,7 @@ func miqt_exec_callback_QTableWidget_ItemChanged(cb C.intptr_t, item *C.QTableWi } // Convert all CABI parameters to Go parameters - slotval1 := newQTableWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTableWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -872,8 +894,8 @@ func miqt_exec_callback_QTableWidget_CurrentItemChanged(cb C.intptr_t, current * } // Convert all CABI parameters to Go parameters - slotval1 := newQTableWidgetItem_U(unsafe.Pointer(current)) - slotval2 := newQTableWidgetItem_U(unsafe.Pointer(previous)) + slotval1 := UnsafeNewQTableWidgetItem(unsafe.Pointer(current)) + slotval2 := UnsafeNewQTableWidgetItem(unsafe.Pointer(previous)) gofunc(slotval1, slotval2) } diff --git a/qt/gen_qtablewidget.h b/qt/gen_qtablewidget.h index 72f3158c..443a3d44 100644 --- a/qt/gen_qtablewidget.h +++ b/qt/gen_qtablewidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtabwidget.cpp b/qt/gen_qtabwidget.cpp index 6b8c14b9..593d4f61 100644 --- a/qt/gen_qtabwidget.cpp +++ b/qt/gen_qtabwidget.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qtabwidget.h" +#include #include "gen_qtabwidget.h" #include "_cgo_export.h" diff --git a/qt/gen_qtabwidget.go b/qt/gen_qtabwidget.go index b105ff16..2d1f7073 100644 --- a/qt/gen_qtabwidget.go +++ b/qt/gen_qtabwidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -42,14 +43,21 @@ func (this *QTabWidget) cPointer() *C.QTabWidget { return this.h } +func (this *QTabWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTabWidget(h *C.QTabWidget) *QTabWidget { if h == nil { return nil } - return &QTabWidget{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QTabWidget{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQTabWidget_U(h unsafe.Pointer) *QTabWidget { +func UnsafeNewQTabWidget(h unsafe.Pointer) *QTabWidget { return newQTabWidget((*C.QTabWidget)(h)) } @@ -66,7 +74,7 @@ func NewQTabWidget2(parent *QWidget) *QTabWidget { } func (this *QTabWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTabWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTabWidget_MetaObject(this.h))) } func (this *QTabWidget) Metacast(param1 string) unsafe.Pointer { @@ -94,25 +102,25 @@ func QTabWidget_TrUtf8(s string) string { } func (this *QTabWidget) AddTab(widget *QWidget, param2 string) int { - param2_ms := miqt_strdupg(param2) + param2_ms := libmiqt.Strdupg(param2) defer C.free(param2_ms) return (int)(C.QTabWidget_AddTab(this.h, widget.cPointer(), (*C.struct_miqt_string)(param2_ms))) } func (this *QTabWidget) AddTab2(widget *QWidget, icon *QIcon, label string) int { - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QTabWidget_AddTab2(this.h, widget.cPointer(), icon.cPointer(), (*C.struct_miqt_string)(label_ms))) } func (this *QTabWidget) InsertTab(index int, widget *QWidget, param3 string) int { - param3_ms := miqt_strdupg(param3) + param3_ms := libmiqt.Strdupg(param3) defer C.free(param3_ms) return (int)(C.QTabWidget_InsertTab(this.h, (C.int)(index), widget.cPointer(), (*C.struct_miqt_string)(param3_ms))) } func (this *QTabWidget) InsertTab2(index int, widget *QWidget, icon *QIcon, label string) int { - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) return (int)(C.QTabWidget_InsertTab2(this.h, (C.int)(index), widget.cPointer(), icon.cPointer(), (*C.struct_miqt_string)(label_ms))) } @@ -145,7 +153,7 @@ func (this *QTabWidget) TabText(index int) string { } func (this *QTabWidget) SetTabText(index int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTabWidget_SetTabText(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms)) } @@ -162,7 +170,7 @@ func (this *QTabWidget) SetTabIcon(index int, icon *QIcon) { } func (this *QTabWidget) SetTabToolTip(index int, tip string) { - tip_ms := miqt_strdupg(tip) + tip_ms := libmiqt.Strdupg(tip) defer C.free(tip_ms) C.QTabWidget_SetTabToolTip(this.h, (C.int)(index), (*C.struct_miqt_string)(tip_ms)) } @@ -175,7 +183,7 @@ func (this *QTabWidget) TabToolTip(index int) string { } func (this *QTabWidget) SetTabWhatsThis(index int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTabWidget_SetTabWhatsThis(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms)) } @@ -192,11 +200,11 @@ func (this *QTabWidget) CurrentIndex() int { } func (this *QTabWidget) CurrentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QTabWidget_CurrentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QTabWidget_CurrentWidget(this.h))) } func (this *QTabWidget) Widget(index int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QTabWidget_Widget(this.h, (C.int)(index)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QTabWidget_Widget(this.h, (C.int)(index)))) } func (this *QTabWidget) IndexOf(widget *QWidget) int { @@ -266,7 +274,7 @@ func (this *QTabWidget) SetCornerWidget(w *QWidget) { } func (this *QTabWidget) CornerWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QTabWidget_CornerWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QTabWidget_CornerWidget(this.h))) } func (this *QTabWidget) ElideMode() TextElideMode { @@ -317,7 +325,7 @@ func (this *QTabWidget) Clear() { } func (this *QTabWidget) TabBar() *QTabBar { - return newQTabBar_U(unsafe.Pointer(C.QTabWidget_TabBar(this.h))) + return UnsafeNewQTabBar(unsafe.Pointer(C.QTabWidget_TabBar(this.h))) } func (this *QTabWidget) SetCurrentIndex(index int) { @@ -457,7 +465,7 @@ func (this *QTabWidget) SetCornerWidget2(w *QWidget, corner Corner) { } func (this *QTabWidget) CornerWidget1(corner Corner) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QTabWidget_CornerWidget1(this.h, (C.int)(corner)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QTabWidget_CornerWidget1(this.h, (C.int)(corner)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qtabwidget.h b/qt/gen_qtabwidget.h index 9aae61ac..da66ba7b 100644 --- a/qt/gen_qtabwidget.h +++ b/qt/gen_qtabwidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtemporarydir.cpp b/qt/gen_qtemporarydir.cpp index 451237ed..38e53b09 100644 --- a/qt/gen_qtemporarydir.cpp +++ b/qt/gen_qtemporarydir.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qtemporarydir.h" +#include #include "gen_qtemporarydir.h" #include "_cgo_export.h" diff --git a/qt/gen_qtemporarydir.go b/qt/gen_qtemporarydir.go index ed575258..e50874f6 100644 --- a/qt/gen_qtemporarydir.go +++ b/qt/gen_qtemporarydir.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QTemporaryDir) cPointer() *C.QTemporaryDir { return this.h } +func (this *QTemporaryDir) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTemporaryDir(h *C.QTemporaryDir) *QTemporaryDir { if h == nil { return nil @@ -31,7 +39,7 @@ func newQTemporaryDir(h *C.QTemporaryDir) *QTemporaryDir { return &QTemporaryDir{h: h} } -func newQTemporaryDir_U(h unsafe.Pointer) *QTemporaryDir { +func UnsafeNewQTemporaryDir(h unsafe.Pointer) *QTemporaryDir { return newQTemporaryDir((*C.QTemporaryDir)(h)) } @@ -43,7 +51,7 @@ func NewQTemporaryDir() *QTemporaryDir { // NewQTemporaryDir2 constructs a new QTemporaryDir object. func NewQTemporaryDir2(templateName string) *QTemporaryDir { - templateName_ms := miqt_strdupg(templateName) + templateName_ms := libmiqt.Strdupg(templateName) defer C.free(templateName_ms) ret := C.QTemporaryDir_new2((*C.struct_miqt_string)(templateName_ms)) return newQTemporaryDir(ret) @@ -80,7 +88,7 @@ func (this *QTemporaryDir) Path() string { } func (this *QTemporaryDir) FilePath(fileName string) string { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) var _ms *C.struct_miqt_string = C.QTemporaryDir_FilePath(this.h, (*C.struct_miqt_string)(fileName_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) diff --git a/qt/gen_qtemporarydir.h b/qt/gen_qtemporarydir.h index 3df0c9ff..7f508a67 100644 --- a/qt/gen_qtemporarydir.h +++ b/qt/gen_qtemporarydir.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtemporaryfile.cpp b/qt/gen_qtemporaryfile.cpp index 5c067369..13d7042d 100644 --- a/qt/gen_qtemporaryfile.cpp +++ b/qt/gen_qtemporaryfile.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qtemporaryfile.h" +#include #include "gen_qtemporaryfile.h" #include "_cgo_export.h" diff --git a/qt/gen_qtemporaryfile.go b/qt/gen_qtemporaryfile.go index 150f5743..6e7e51ad 100644 --- a/qt/gen_qtemporaryfile.go +++ b/qt/gen_qtemporaryfile.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QTemporaryFile) cPointer() *C.QTemporaryFile { return this.h } +func (this *QTemporaryFile) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTemporaryFile(h *C.QTemporaryFile) *QTemporaryFile { if h == nil { return nil } - return &QTemporaryFile{h: h, QFile: newQFile_U(unsafe.Pointer(h))} + return &QTemporaryFile{h: h, QFile: UnsafeNewQFile(unsafe.Pointer(h))} } -func newQTemporaryFile_U(h unsafe.Pointer) *QTemporaryFile { +func UnsafeNewQTemporaryFile(h unsafe.Pointer) *QTemporaryFile { return newQTemporaryFile((*C.QTemporaryFile)(h)) } @@ -44,7 +52,7 @@ func NewQTemporaryFile() *QTemporaryFile { // NewQTemporaryFile2 constructs a new QTemporaryFile object. func NewQTemporaryFile2(templateName string) *QTemporaryFile { - templateName_ms := miqt_strdupg(templateName) + templateName_ms := libmiqt.Strdupg(templateName) defer C.free(templateName_ms) ret := C.QTemporaryFile_new2((*C.struct_miqt_string)(templateName_ms)) return newQTemporaryFile(ret) @@ -58,14 +66,14 @@ func NewQTemporaryFile3(parent *QObject) *QTemporaryFile { // NewQTemporaryFile4 constructs a new QTemporaryFile object. func NewQTemporaryFile4(templateName string, parent *QObject) *QTemporaryFile { - templateName_ms := miqt_strdupg(templateName) + templateName_ms := libmiqt.Strdupg(templateName) defer C.free(templateName_ms) ret := C.QTemporaryFile_new4((*C.struct_miqt_string)(templateName_ms), parent.cPointer()) return newQTemporaryFile(ret) } func (this *QTemporaryFile) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTemporaryFile_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTemporaryFile_MetaObject(this.h))) } func (this *QTemporaryFile) Metacast(param1 string) unsafe.Pointer { @@ -119,35 +127,35 @@ func (this *QTemporaryFile) FileTemplate() string { } func (this *QTemporaryFile) SetFileTemplate(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTemporaryFile_SetFileTemplate(this.h, (*C.struct_miqt_string)(name_ms)) } func (this *QTemporaryFile) Rename(newName string) bool { - newName_ms := miqt_strdupg(newName) + newName_ms := libmiqt.Strdupg(newName) defer C.free(newName_ms) return (bool)(C.QTemporaryFile_Rename(this.h, (*C.struct_miqt_string)(newName_ms))) } func QTemporaryFile_CreateLocalFile(fileName string) *QTemporaryFile { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) - return newQTemporaryFile_U(unsafe.Pointer(C.QTemporaryFile_CreateLocalFile((*C.struct_miqt_string)(fileName_ms)))) + return UnsafeNewQTemporaryFile(unsafe.Pointer(C.QTemporaryFile_CreateLocalFile((*C.struct_miqt_string)(fileName_ms)))) } func QTemporaryFile_CreateLocalFileWithFile(file *QFile) *QTemporaryFile { - return newQTemporaryFile_U(unsafe.Pointer(C.QTemporaryFile_CreateLocalFileWithFile(file.cPointer()))) + return UnsafeNewQTemporaryFile(unsafe.Pointer(C.QTemporaryFile_CreateLocalFileWithFile(file.cPointer()))) } func QTemporaryFile_CreateNativeFile(fileName string) *QTemporaryFile { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) - return newQTemporaryFile_U(unsafe.Pointer(C.QTemporaryFile_CreateNativeFile((*C.struct_miqt_string)(fileName_ms)))) + return UnsafeNewQTemporaryFile(unsafe.Pointer(C.QTemporaryFile_CreateNativeFile((*C.struct_miqt_string)(fileName_ms)))) } func QTemporaryFile_CreateNativeFileWithFile(file *QFile) *QTemporaryFile { - return newQTemporaryFile_U(unsafe.Pointer(C.QTemporaryFile_CreateNativeFileWithFile(file.cPointer()))) + return UnsafeNewQTemporaryFile(unsafe.Pointer(C.QTemporaryFile_CreateNativeFileWithFile(file.cPointer()))) } func QTemporaryFile_Tr2(s string, c string) string { diff --git a/qt/gen_qtemporaryfile.h b/qt/gen_qtemporaryfile.h index 45c4e26d..731287dd 100644 --- a/qt/gen_qtemporaryfile.h +++ b/qt/gen_qtemporaryfile.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextboundaryfinder.cpp b/qt/gen_qtextboundaryfinder.cpp index 998f87b3..47ac570e 100644 --- a/qt/gen_qtextboundaryfinder.cpp +++ b/qt/gen_qtextboundaryfinder.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qtextboundaryfinder.h" +#include #include "gen_qtextboundaryfinder.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextboundaryfinder.go b/qt/gen_qtextboundaryfinder.go index 6579e37e..64fe0e18 100644 --- a/qt/gen_qtextboundaryfinder.go +++ b/qt/gen_qtextboundaryfinder.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -44,6 +45,13 @@ func (this *QTextBoundaryFinder) cPointer() *C.QTextBoundaryFinder { return this.h } +func (this *QTextBoundaryFinder) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextBoundaryFinder(h *C.QTextBoundaryFinder) *QTextBoundaryFinder { if h == nil { return nil @@ -51,7 +59,7 @@ func newQTextBoundaryFinder(h *C.QTextBoundaryFinder) *QTextBoundaryFinder { return &QTextBoundaryFinder{h: h} } -func newQTextBoundaryFinder_U(h unsafe.Pointer) *QTextBoundaryFinder { +func UnsafeNewQTextBoundaryFinder(h unsafe.Pointer) *QTextBoundaryFinder { return newQTextBoundaryFinder((*C.QTextBoundaryFinder)(h)) } @@ -69,7 +77,7 @@ func NewQTextBoundaryFinder2(other *QTextBoundaryFinder) *QTextBoundaryFinder { // NewQTextBoundaryFinder3 constructs a new QTextBoundaryFinder object. func NewQTextBoundaryFinder3(typeVal QTextBoundaryFinder__BoundaryType, stringVal string) *QTextBoundaryFinder { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) ret := C.QTextBoundaryFinder_new3((C.int)(typeVal), (*C.struct_miqt_string)(stringVal_ms)) return newQTextBoundaryFinder(ret) diff --git a/qt/gen_qtextboundaryfinder.h b/qt/gen_qtextboundaryfinder.h index d978bb41..0856de60 100644 --- a/qt/gen_qtextboundaryfinder.h +++ b/qt/gen_qtextboundaryfinder.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextbrowser.cpp b/qt/gen_qtextbrowser.cpp index aa9144b2..4de88743 100644 --- a/qt/gen_qtextbrowser.cpp +++ b/qt/gen_qtextbrowser.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qtextbrowser.h" +#include #include "gen_qtextbrowser.h" #include "_cgo_export.h" @@ -67,7 +67,7 @@ struct miqt_array* QTextBrowser_SearchPaths(const QTextBrowser* self) { } void QTextBrowser_SetSearchPaths(QTextBrowser* self, struct miqt_array* /* of struct miqt_string* */ paths) { - QList paths_QList; + QStringList paths_QList; paths_QList.reserve(paths->len); struct miqt_string** paths_arr = static_cast(paths->data); for(size_t i = 0; i < paths->len; ++i) { diff --git a/qt/gen_qtextbrowser.go b/qt/gen_qtextbrowser.go index ea671c81..7714a6e3 100644 --- a/qt/gen_qtextbrowser.go +++ b/qt/gen_qtextbrowser.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QTextBrowser) cPointer() *C.QTextBrowser { return this.h } +func (this *QTextBrowser) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextBrowser(h *C.QTextBrowser) *QTextBrowser { if h == nil { return nil } - return &QTextBrowser{h: h, QTextEdit: newQTextEdit_U(unsafe.Pointer(h))} + return &QTextBrowser{h: h, QTextEdit: UnsafeNewQTextEdit(unsafe.Pointer(h))} } -func newQTextBrowser_U(h unsafe.Pointer) *QTextBrowser { +func UnsafeNewQTextBrowser(h unsafe.Pointer) *QTextBrowser { return newQTextBrowser((*C.QTextBrowser)(h)) } @@ -50,7 +58,7 @@ func NewQTextBrowser2(parent *QWidget) *QTextBrowser { } func (this *QTextBrowser) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextBrowser_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextBrowser_MetaObject(this.h))) } func (this *QTextBrowser) Metacast(param1 string) unsafe.Pointer { @@ -107,7 +115,7 @@ func (this *QTextBrowser) SetSearchPaths(paths []string) { paths_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(paths)))) defer C.free(unsafe.Pointer(paths_CArray)) for i := range paths { - paths_i_ms := miqt_strdupg(paths[i]) + paths_i_ms := libmiqt.Strdupg(paths[i]) defer C.free(paths_i_ms) paths_CArray[i] = (*C.struct_miqt_string)(paths_i_ms) } @@ -269,7 +277,7 @@ func miqt_exec_callback_QTextBrowser_SourceChanged(cb C.intptr_t, param1 *C.QUrl } // Convert all CABI parameters to Go parameters - slotval1 := newQUrl_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQUrl(unsafe.Pointer(param1)) gofunc(slotval1) } @@ -289,13 +297,13 @@ func miqt_exec_callback_QTextBrowser_Highlighted(cb C.intptr_t, param1 *C.QUrl) } // Convert all CABI parameters to Go parameters - slotval1 := newQUrl_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQUrl(unsafe.Pointer(param1)) gofunc(slotval1) } func (this *QTextBrowser) HighlightedWithQString(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QTextBrowser_HighlightedWithQString(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -334,7 +342,7 @@ func miqt_exec_callback_QTextBrowser_AnchorClicked(cb C.intptr_t, param1 *C.QUrl } // Convert all CABI parameters to Go parameters - slotval1 := newQUrl_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQUrl(unsafe.Pointer(param1)) gofunc(slotval1) } diff --git a/qt/gen_qtextbrowser.h b/qt/gen_qtextbrowser.h index 2c7cdc5c..18bbdd8c 100644 --- a/qt/gen_qtextbrowser.h +++ b/qt/gen_qtextbrowser.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextcodec.cpp b/qt/gen_qtextcodec.cpp index bea43ffa..46ec2aca 100644 --- a/qt/gen_qtextcodec.cpp +++ b/qt/gen_qtextcodec.cpp @@ -8,7 +8,7 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QTextCodec__ConverterState #include #include -#include "qtextcodec.h" +#include #include "gen_qtextcodec.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextcodec.go b/qt/gen_qtextcodec.go index 80d6fde3..6e4e7b70 100644 --- a/qt/gen_qtextcodec.go +++ b/qt/gen_qtextcodec.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -33,6 +34,13 @@ func (this *QTextCodec) cPointer() *C.QTextCodec { return this.h } +func (this *QTextCodec) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextCodec(h *C.QTextCodec) *QTextCodec { if h == nil { return nil @@ -40,22 +48,22 @@ func newQTextCodec(h *C.QTextCodec) *QTextCodec { return &QTextCodec{h: h} } -func newQTextCodec_U(h unsafe.Pointer) *QTextCodec { +func UnsafeNewQTextCodec(h unsafe.Pointer) *QTextCodec { return newQTextCodec((*C.QTextCodec)(h)) } func QTextCodec_CodecForName(name *QByteArray) *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForName(name.cPointer()))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForName(name.cPointer()))) } func QTextCodec_CodecForNameWithName(name string) *QTextCodec { name_Cstring := C.CString(name) defer C.free(unsafe.Pointer(name_Cstring)) - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForNameWithName(name_Cstring))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForNameWithName(name_Cstring))) } func QTextCodec_CodecForMib(mib int) *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForMib((C.int)(mib)))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForMib((C.int)(mib)))) } func QTextCodec_AvailableCodecs() []QByteArray { @@ -84,7 +92,7 @@ func QTextCodec_AvailableMibs() []int { } func QTextCodec_CodecForLocale() *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForLocale())) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForLocale())) } func QTextCodec_SetCodecForLocale(c *QTextCodec) { @@ -92,19 +100,19 @@ func QTextCodec_SetCodecForLocale(c *QTextCodec) { } func QTextCodec_CodecForHtml(ba *QByteArray) *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForHtml(ba.cPointer()))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForHtml(ba.cPointer()))) } func QTextCodec_CodecForHtml2(ba *QByteArray, defaultCodec *QTextCodec) *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForHtml2(ba.cPointer(), defaultCodec.cPointer()))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForHtml2(ba.cPointer(), defaultCodec.cPointer()))) } func QTextCodec_CodecForUtfText(ba *QByteArray) *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForUtfText(ba.cPointer()))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForUtfText(ba.cPointer()))) } func QTextCodec_CodecForUtfText2(ba *QByteArray, defaultCodec *QTextCodec) *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextCodec_CodecForUtfText2(ba.cPointer(), defaultCodec.cPointer()))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForUtfText2(ba.cPointer(), defaultCodec.cPointer()))) } func (this *QTextCodec) CanEncode(param1 QChar) bool { @@ -112,7 +120,7 @@ func (this *QTextCodec) CanEncode(param1 QChar) bool { } func (this *QTextCodec) CanEncodeWithQString(param1 string) bool { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (bool)(C.QTextCodec_CanEncodeWithQString(this.h, (*C.struct_miqt_string)(param1_ms))) } @@ -134,7 +142,7 @@ func (this *QTextCodec) ToUnicodeWithChars(chars string) string { } func (this *QTextCodec) FromUnicode(uc string) *QByteArray { - uc_ms := miqt_strdupg(uc) + uc_ms := libmiqt.Strdupg(uc) defer C.free(uc_ms) _ret := C.QTextCodec_FromUnicode(this.h, (*C.struct_miqt_string)(uc_ms)) _goptr := newQByteArray(_ret) @@ -159,11 +167,11 @@ func (this *QTextCodec) FromUnicode2(in *QChar, length int) *QByteArray { } func (this *QTextCodec) MakeDecoder() *QTextDecoder { - return newQTextDecoder_U(unsafe.Pointer(C.QTextCodec_MakeDecoder(this.h))) + return UnsafeNewQTextDecoder(unsafe.Pointer(C.QTextCodec_MakeDecoder(this.h))) } func (this *QTextCodec) MakeEncoder() *QTextEncoder { - return newQTextEncoder_U(unsafe.Pointer(C.QTextCodec_MakeEncoder(this.h))) + return UnsafeNewQTextEncoder(unsafe.Pointer(C.QTextCodec_MakeEncoder(this.h))) } func (this *QTextCodec) Name() *QByteArray { @@ -208,11 +216,11 @@ func (this *QTextCodec) FromUnicode3(in *QChar, length int, state *QTextCodec__C } func (this *QTextCodec) MakeDecoder1(flags QTextCodec__ConversionFlag) *QTextDecoder { - return newQTextDecoder_U(unsafe.Pointer(C.QTextCodec_MakeDecoder1(this.h, (C.int)(flags)))) + return UnsafeNewQTextDecoder(unsafe.Pointer(C.QTextCodec_MakeDecoder1(this.h, (C.int)(flags)))) } func (this *QTextCodec) MakeEncoder1(flags QTextCodec__ConversionFlag) *QTextEncoder { - return newQTextEncoder_U(unsafe.Pointer(C.QTextCodec_MakeEncoder1(this.h, (C.int)(flags)))) + return UnsafeNewQTextEncoder(unsafe.Pointer(C.QTextCodec_MakeEncoder1(this.h, (C.int)(flags)))) } type QTextEncoder struct { @@ -226,6 +234,13 @@ func (this *QTextEncoder) cPointer() *C.QTextEncoder { return this.h } +func (this *QTextEncoder) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextEncoder(h *C.QTextEncoder) *QTextEncoder { if h == nil { return nil @@ -233,7 +248,7 @@ func newQTextEncoder(h *C.QTextEncoder) *QTextEncoder { return &QTextEncoder{h: h} } -func newQTextEncoder_U(h unsafe.Pointer) *QTextEncoder { +func UnsafeNewQTextEncoder(h unsafe.Pointer) *QTextEncoder { return newQTextEncoder((*C.QTextEncoder)(h)) } @@ -250,7 +265,7 @@ func NewQTextEncoder2(codec *QTextCodec, flags QTextCodec__ConversionFlag) *QTex } func (this *QTextEncoder) FromUnicode(str string) *QByteArray { - str_ms := miqt_strdupg(str) + str_ms := libmiqt.Strdupg(str) defer C.free(str_ms) _ret := C.QTextEncoder_FromUnicode(this.h, (*C.struct_miqt_string)(str_ms)) _goptr := newQByteArray(_ret) @@ -294,6 +309,13 @@ func (this *QTextDecoder) cPointer() *C.QTextDecoder { return this.h } +func (this *QTextDecoder) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextDecoder(h *C.QTextDecoder) *QTextDecoder { if h == nil { return nil @@ -301,7 +323,7 @@ func newQTextDecoder(h *C.QTextDecoder) *QTextDecoder { return &QTextDecoder{h: h} } -func newQTextDecoder_U(h unsafe.Pointer) *QTextDecoder { +func UnsafeNewQTextDecoder(h unsafe.Pointer) *QTextDecoder { return newQTextDecoder((*C.QTextDecoder)(h)) } @@ -366,6 +388,13 @@ func (this *QTextCodec__ConverterState) cPointer() *C.QTextCodec__ConverterState return this.h } +func (this *QTextCodec__ConverterState) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextCodec__ConverterState(h *C.QTextCodec__ConverterState) *QTextCodec__ConverterState { if h == nil { return nil @@ -373,7 +402,7 @@ func newQTextCodec__ConverterState(h *C.QTextCodec__ConverterState) *QTextCodec_ return &QTextCodec__ConverterState{h: h} } -func newQTextCodec__ConverterState_U(h unsafe.Pointer) *QTextCodec__ConverterState { +func UnsafeNewQTextCodec__ConverterState(h unsafe.Pointer) *QTextCodec__ConverterState { return newQTextCodec__ConverterState((*C.QTextCodec__ConverterState)(h)) } diff --git a/qt/gen_qtextcodec.h b/qt/gen_qtextcodec.h index d4940439..d7e0431f 100644 --- a/qt/gen_qtextcodec.h +++ b/qt/gen_qtextcodec.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextcursor.cpp b/qt/gen_qtextcursor.cpp index 525cb5a5..48b3a8b1 100644 --- a/qt/gen_qtextcursor.cpp +++ b/qt/gen_qtextcursor.cpp @@ -15,7 +15,7 @@ #include #include #include -#include "qtextcursor.h" +#include #include "gen_qtextcursor.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextcursor.go b/qt/gen_qtextcursor.go index 34d317f0..08c8915b 100644 --- a/qt/gen_qtextcursor.go +++ b/qt/gen_qtextcursor.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -70,6 +71,13 @@ func (this *QTextCursor) cPointer() *C.QTextCursor { return this.h } +func (this *QTextCursor) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextCursor(h *C.QTextCursor) *QTextCursor { if h == nil { return nil @@ -77,7 +85,7 @@ func newQTextCursor(h *C.QTextCursor) *QTextCursor { return &QTextCursor{h: h} } -func newQTextCursor_U(h unsafe.Pointer) *QTextCursor { +func UnsafeNewQTextCursor(h unsafe.Pointer) *QTextCursor { return newQTextCursor((*C.QTextCursor)(h)) } @@ -140,13 +148,13 @@ func (this *QTextCursor) Anchor() int { } func (this *QTextCursor) InsertText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextCursor_InsertText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QTextCursor) InsertText2(text string, format *QTextCharFormat) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextCursor_InsertText2(this.h, (*C.struct_miqt_string)(text_ms), format.cPointer()) } @@ -314,43 +322,43 @@ func (this *QTextCursor) InsertBlock2(format *QTextBlockFormat, charFormat *QTex } func (this *QTextCursor) InsertList(format *QTextListFormat) *QTextList { - return newQTextList_U(unsafe.Pointer(C.QTextCursor_InsertList(this.h, format.cPointer()))) + return UnsafeNewQTextList(unsafe.Pointer(C.QTextCursor_InsertList(this.h, format.cPointer()))) } func (this *QTextCursor) InsertListWithStyle(style QTextListFormat__Style) *QTextList { - return newQTextList_U(unsafe.Pointer(C.QTextCursor_InsertListWithStyle(this.h, (C.int)(style)))) + return UnsafeNewQTextList(unsafe.Pointer(C.QTextCursor_InsertListWithStyle(this.h, (C.int)(style)))) } func (this *QTextCursor) CreateList(format *QTextListFormat) *QTextList { - return newQTextList_U(unsafe.Pointer(C.QTextCursor_CreateList(this.h, format.cPointer()))) + return UnsafeNewQTextList(unsafe.Pointer(C.QTextCursor_CreateList(this.h, format.cPointer()))) } func (this *QTextCursor) CreateListWithStyle(style QTextListFormat__Style) *QTextList { - return newQTextList_U(unsafe.Pointer(C.QTextCursor_CreateListWithStyle(this.h, (C.int)(style)))) + return UnsafeNewQTextList(unsafe.Pointer(C.QTextCursor_CreateListWithStyle(this.h, (C.int)(style)))) } func (this *QTextCursor) CurrentList() *QTextList { - return newQTextList_U(unsafe.Pointer(C.QTextCursor_CurrentList(this.h))) + return UnsafeNewQTextList(unsafe.Pointer(C.QTextCursor_CurrentList(this.h))) } func (this *QTextCursor) InsertTable(rows int, cols int, format *QTextTableFormat) *QTextTable { - return newQTextTable_U(unsafe.Pointer(C.QTextCursor_InsertTable(this.h, (C.int)(rows), (C.int)(cols), format.cPointer()))) + return UnsafeNewQTextTable(unsafe.Pointer(C.QTextCursor_InsertTable(this.h, (C.int)(rows), (C.int)(cols), format.cPointer()))) } func (this *QTextCursor) InsertTable2(rows int, cols int) *QTextTable { - return newQTextTable_U(unsafe.Pointer(C.QTextCursor_InsertTable2(this.h, (C.int)(rows), (C.int)(cols)))) + return UnsafeNewQTextTable(unsafe.Pointer(C.QTextCursor_InsertTable2(this.h, (C.int)(rows), (C.int)(cols)))) } func (this *QTextCursor) CurrentTable() *QTextTable { - return newQTextTable_U(unsafe.Pointer(C.QTextCursor_CurrentTable(this.h))) + return UnsafeNewQTextTable(unsafe.Pointer(C.QTextCursor_CurrentTable(this.h))) } func (this *QTextCursor) InsertFrame(format *QTextFrameFormat) *QTextFrame { - return newQTextFrame_U(unsafe.Pointer(C.QTextCursor_InsertFrame(this.h, format.cPointer()))) + return UnsafeNewQTextFrame(unsafe.Pointer(C.QTextCursor_InsertFrame(this.h, format.cPointer()))) } func (this *QTextCursor) CurrentFrame() *QTextFrame { - return newQTextFrame_U(unsafe.Pointer(C.QTextCursor_CurrentFrame(this.h))) + return UnsafeNewQTextFrame(unsafe.Pointer(C.QTextCursor_CurrentFrame(this.h))) } func (this *QTextCursor) InsertFragment(fragment *QTextDocumentFragment) { @@ -358,7 +366,7 @@ func (this *QTextCursor) InsertFragment(fragment *QTextDocumentFragment) { } func (this *QTextCursor) InsertHtml(html string) { - html_ms := miqt_strdupg(html) + html_ms := libmiqt.Strdupg(html) defer C.free(html_ms) C.QTextCursor_InsertHtml(this.h, (*C.struct_miqt_string)(html_ms)) } @@ -372,7 +380,7 @@ func (this *QTextCursor) InsertImageWithFormat(format *QTextImageFormat) { } func (this *QTextCursor) InsertImageWithName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTextCursor_InsertImageWithName(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -430,7 +438,7 @@ func (this *QTextCursor) ColumnNumber() int { } func (this *QTextCursor) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QTextCursor_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QTextCursor_Document(this.h))) } func (this *QTextCursor) SetPosition2(pos int, mode QTextCursor__MoveMode) { @@ -446,7 +454,7 @@ func (this *QTextCursor) MovePosition3(op QTextCursor__MoveOperation, param2 QTe } func (this *QTextCursor) InsertImage2(image *QImage, name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTextCursor_InsertImage2(this.h, image.cPointer(), (*C.struct_miqt_string)(name_ms)) } diff --git a/qt/gen_qtextcursor.h b/qt/gen_qtextcursor.h index 0375461b..408ff664 100644 --- a/qt/gen_qtextcursor.h +++ b/qt/gen_qtextcursor.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextdocument.cpp b/qt/gen_qtextdocument.cpp index 32d0a835..aed279c4 100644 --- a/qt/gen_qtextdocument.cpp +++ b/qt/gen_qtextdocument.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "qtextdocument.h" +#include #include "gen_qtextdocument.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextdocument.go b/qt/gen_qtextdocument.go index 14747e71..e4d55ef4 100644 --- a/qt/gen_qtextdocument.go +++ b/qt/gen_qtextdocument.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -67,6 +68,13 @@ func (this *QAbstractUndoItem) cPointer() *C.QAbstractUndoItem { return this.h } +func (this *QAbstractUndoItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAbstractUndoItem(h *C.QAbstractUndoItem) *QAbstractUndoItem { if h == nil { return nil @@ -74,7 +82,7 @@ func newQAbstractUndoItem(h *C.QAbstractUndoItem) *QAbstractUndoItem { return &QAbstractUndoItem{h: h} } -func newQAbstractUndoItem_U(h unsafe.Pointer) *QAbstractUndoItem { +func UnsafeNewQAbstractUndoItem(h unsafe.Pointer) *QAbstractUndoItem { return newQAbstractUndoItem((*C.QAbstractUndoItem)(h)) } @@ -116,14 +124,21 @@ func (this *QTextDocument) cPointer() *C.QTextDocument { return this.h } +func (this *QTextDocument) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextDocument(h *C.QTextDocument) *QTextDocument { if h == nil { return nil } - return &QTextDocument{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QTextDocument{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQTextDocument_U(h unsafe.Pointer) *QTextDocument { +func UnsafeNewQTextDocument(h unsafe.Pointer) *QTextDocument { return newQTextDocument((*C.QTextDocument)(h)) } @@ -135,7 +150,7 @@ func NewQTextDocument() *QTextDocument { // NewQTextDocument2 constructs a new QTextDocument object. func NewQTextDocument2(text string) *QTextDocument { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTextDocument_new2((*C.struct_miqt_string)(text_ms)) return newQTextDocument(ret) @@ -149,14 +164,14 @@ func NewQTextDocument3(parent *QObject) *QTextDocument { // NewQTextDocument4 constructs a new QTextDocument object. func NewQTextDocument4(text string, parent *QObject) *QTextDocument { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTextDocument_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQTextDocument(ret) } func (this *QTextDocument) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextDocument_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextDocument_MetaObject(this.h))) } func (this *QTextDocument) Metacast(param1 string) unsafe.Pointer { @@ -184,7 +199,7 @@ func QTextDocument_TrUtf8(s string) string { } func (this *QTextDocument) Clone() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QTextDocument_Clone(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QTextDocument_Clone(this.h))) } func (this *QTextDocument) IsEmpty() bool { @@ -228,11 +243,11 @@ func (this *QTextDocument) SetDocumentLayout(layout *QAbstractTextDocumentLayout } func (this *QTextDocument) DocumentLayout() *QAbstractTextDocumentLayout { - return newQAbstractTextDocumentLayout_U(unsafe.Pointer(C.QTextDocument_DocumentLayout(this.h))) + return UnsafeNewQAbstractTextDocumentLayout(unsafe.Pointer(C.QTextDocument_DocumentLayout(this.h))) } func (this *QTextDocument) SetMetaInformation(info QTextDocument__MetaInformation, param2 string) { - param2_ms := miqt_strdupg(param2) + param2_ms := libmiqt.Strdupg(param2) defer C.free(param2_ms) C.QTextDocument_SetMetaInformation(this.h, (C.int)(info), (*C.struct_miqt_string)(param2_ms)) } @@ -252,7 +267,7 @@ func (this *QTextDocument) ToHtml() string { } func (this *QTextDocument) SetHtml(html string) { - html_ms := miqt_strdupg(html) + html_ms := libmiqt.Strdupg(html) defer C.free(html_ms) C.QTextDocument_SetHtml(this.h, (*C.struct_miqt_string)(html_ms)) } @@ -265,7 +280,7 @@ func (this *QTextDocument) ToMarkdown() string { } func (this *QTextDocument) SetMarkdown(markdown string) { - markdown_ms := miqt_strdupg(markdown) + markdown_ms := libmiqt.Strdupg(markdown) defer C.free(markdown_ms) C.QTextDocument_SetMarkdown(this.h, (*C.struct_miqt_string)(markdown_ms)) } @@ -285,7 +300,7 @@ func (this *QTextDocument) ToPlainText() string { } func (this *QTextDocument) SetPlainText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextDocument_SetPlainText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -298,7 +313,7 @@ func (this *QTextDocument) CharacterAt(pos int) *QChar { } func (this *QTextDocument) Find(subString string) *QTextCursor { - subString_ms := miqt_strdupg(subString) + subString_ms := libmiqt.Strdupg(subString) defer C.free(subString_ms) _ret := C.QTextDocument_Find(this.h, (*C.struct_miqt_string)(subString_ms)) _goptr := newQTextCursor(_ret) @@ -307,7 +322,7 @@ func (this *QTextDocument) Find(subString string) *QTextCursor { } func (this *QTextDocument) Find2(subString string, cursor *QTextCursor) *QTextCursor { - subString_ms := miqt_strdupg(subString) + subString_ms := libmiqt.Strdupg(subString) defer C.free(subString_ms) _ret := C.QTextDocument_Find2(this.h, (*C.struct_miqt_string)(subString_ms), cursor.cPointer()) _goptr := newQTextCursor(_ret) @@ -344,19 +359,19 @@ func (this *QTextDocument) Find5(expr *QRegularExpression, cursor *QTextCursor) } func (this *QTextDocument) FrameAt(pos int) *QTextFrame { - return newQTextFrame_U(unsafe.Pointer(C.QTextDocument_FrameAt(this.h, (C.int)(pos)))) + return UnsafeNewQTextFrame(unsafe.Pointer(C.QTextDocument_FrameAt(this.h, (C.int)(pos)))) } func (this *QTextDocument) RootFrame() *QTextFrame { - return newQTextFrame_U(unsafe.Pointer(C.QTextDocument_RootFrame(this.h))) + return UnsafeNewQTextFrame(unsafe.Pointer(C.QTextDocument_RootFrame(this.h))) } func (this *QTextDocument) Object(objectIndex int) *QTextObject { - return newQTextObject_U(unsafe.Pointer(C.QTextDocument_Object(this.h, (C.int)(objectIndex)))) + return UnsafeNewQTextObject(unsafe.Pointer(C.QTextDocument_Object(this.h, (C.int)(objectIndex)))) } func (this *QTextDocument) ObjectForFormat(param1 *QTextFormat) *QTextObject { - return newQTextObject_U(unsafe.Pointer(C.QTextDocument_ObjectForFormat(this.h, param1.cPointer()))) + return UnsafeNewQTextObject(unsafe.Pointer(C.QTextDocument_ObjectForFormat(this.h, param1.cPointer()))) } func (this *QTextDocument) FindBlock(pos int) *QTextBlock { @@ -535,7 +550,7 @@ func (this *QTextDocument) CharacterCount() int { } func (this *QTextDocument) SetDefaultStyleSheet(sheet string) { - sheet_ms := miqt_strdupg(sheet) + sheet_ms := libmiqt.Strdupg(sheet) defer C.free(sheet_ms) C.QTextDocument_SetDefaultStyleSheet(this.h, (*C.struct_miqt_string)(sheet_ms)) } @@ -730,7 +745,7 @@ func miqt_exec_callback_QTextDocument_CursorPositionChanged(cb C.intptr_t, curso } // Convert all CABI parameters to Go parameters - slotval1 := newQTextCursor_U(unsafe.Pointer(cursor)) + slotval1 := UnsafeNewQTextCursor(unsafe.Pointer(cursor)) gofunc(slotval1) } @@ -770,7 +785,7 @@ func miqt_exec_callback_QTextDocument_BaseUrlChanged(cb C.intptr_t, url *C.QUrl) } // Convert all CABI parameters to Go parameters - slotval1 := newQUrl_U(unsafe.Pointer(url)) + slotval1 := UnsafeNewQUrl(unsafe.Pointer(url)) gofunc(slotval1) } @@ -853,7 +868,7 @@ func QTextDocument_TrUtf83(s string, c string, n int) string { } func (this *QTextDocument) Clone1(parent *QObject) *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QTextDocument_Clone1(this.h, parent.cPointer()))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QTextDocument_Clone1(this.h, parent.cPointer()))) } func (this *QTextDocument) ToHtml1(encoding *QByteArray) string { @@ -871,13 +886,13 @@ func (this *QTextDocument) ToMarkdown1(features QTextDocument__MarkdownFeature) } func (this *QTextDocument) SetMarkdown2(markdown string, features QTextDocument__MarkdownFeature) { - markdown_ms := miqt_strdupg(markdown) + markdown_ms := libmiqt.Strdupg(markdown) defer C.free(markdown_ms) C.QTextDocument_SetMarkdown2(this.h, (*C.struct_miqt_string)(markdown_ms), (C.int)(features)) } func (this *QTextDocument) Find22(subString string, from int) *QTextCursor { - subString_ms := miqt_strdupg(subString) + subString_ms := libmiqt.Strdupg(subString) defer C.free(subString_ms) _ret := C.QTextDocument_Find22(this.h, (*C.struct_miqt_string)(subString_ms), (C.int)(from)) _goptr := newQTextCursor(_ret) @@ -886,7 +901,7 @@ func (this *QTextDocument) Find22(subString string, from int) *QTextCursor { } func (this *QTextDocument) Find32(subString string, from int, options QTextDocument__FindFlag) *QTextCursor { - subString_ms := miqt_strdupg(subString) + subString_ms := libmiqt.Strdupg(subString) defer C.free(subString_ms) _ret := C.QTextDocument_Find32(this.h, (*C.struct_miqt_string)(subString_ms), (C.int)(from), (C.int)(options)) _goptr := newQTextCursor(_ret) @@ -895,7 +910,7 @@ func (this *QTextDocument) Find32(subString string, from int, options QTextDocum } func (this *QTextDocument) Find33(subString string, cursor *QTextCursor, options QTextDocument__FindFlag) *QTextCursor { - subString_ms := miqt_strdupg(subString) + subString_ms := libmiqt.Strdupg(subString) defer C.free(subString_ms) _ret := C.QTextDocument_Find33(this.h, (*C.struct_miqt_string)(subString_ms), cursor.cPointer(), (C.int)(options)) _goptr := newQTextCursor(_ret) diff --git a/qt/gen_qtextdocument.h b/qt/gen_qtextdocument.h index 4ad9ff3b..aae489d5 100644 --- a/qt/gen_qtextdocument.h +++ b/qt/gen_qtextdocument.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextdocumentfragment.cpp b/qt/gen_qtextdocumentfragment.cpp index 5918ee1f..e7d5e497 100644 --- a/qt/gen_qtextdocumentfragment.cpp +++ b/qt/gen_qtextdocumentfragment.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qtextdocumentfragment.h" +#include #include "gen_qtextdocumentfragment.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextdocumentfragment.go b/qt/gen_qtextdocumentfragment.go index 9291fc1e..72987254 100644 --- a/qt/gen_qtextdocumentfragment.go +++ b/qt/gen_qtextdocumentfragment.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QTextDocumentFragment) cPointer() *C.QTextDocumentFragment { return this.h } +func (this *QTextDocumentFragment) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextDocumentFragment(h *C.QTextDocumentFragment) *QTextDocumentFragment { if h == nil { return nil @@ -31,7 +39,7 @@ func newQTextDocumentFragment(h *C.QTextDocumentFragment) *QTextDocumentFragment return &QTextDocumentFragment{h: h} } -func newQTextDocumentFragment_U(h unsafe.Pointer) *QTextDocumentFragment { +func UnsafeNewQTextDocumentFragment(h unsafe.Pointer) *QTextDocumentFragment { return newQTextDocumentFragment((*C.QTextDocumentFragment)(h)) } @@ -82,7 +90,7 @@ func (this *QTextDocumentFragment) ToHtml() string { } func QTextDocumentFragment_FromPlainText(plainText string) *QTextDocumentFragment { - plainText_ms := miqt_strdupg(plainText) + plainText_ms := libmiqt.Strdupg(plainText) defer C.free(plainText_ms) _ret := C.QTextDocumentFragment_FromPlainText((*C.struct_miqt_string)(plainText_ms)) _goptr := newQTextDocumentFragment(_ret) @@ -91,7 +99,7 @@ func QTextDocumentFragment_FromPlainText(plainText string) *QTextDocumentFragmen } func QTextDocumentFragment_FromHtml(html string) *QTextDocumentFragment { - html_ms := miqt_strdupg(html) + html_ms := libmiqt.Strdupg(html) defer C.free(html_ms) _ret := C.QTextDocumentFragment_FromHtml((*C.struct_miqt_string)(html_ms)) _goptr := newQTextDocumentFragment(_ret) @@ -100,7 +108,7 @@ func QTextDocumentFragment_FromHtml(html string) *QTextDocumentFragment { } func QTextDocumentFragment_FromHtml2(html string, resourceProvider *QTextDocument) *QTextDocumentFragment { - html_ms := miqt_strdupg(html) + html_ms := libmiqt.Strdupg(html) defer C.free(html_ms) _ret := C.QTextDocumentFragment_FromHtml2((*C.struct_miqt_string)(html_ms), resourceProvider.cPointer()) _goptr := newQTextDocumentFragment(_ret) diff --git a/qt/gen_qtextdocumentfragment.h b/qt/gen_qtextdocumentfragment.h index b80b94b8..1503816f 100644 --- a/qt/gen_qtextdocumentfragment.h +++ b/qt/gen_qtextdocumentfragment.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextdocumentwriter.cpp b/qt/gen_qtextdocumentwriter.cpp index f32c105c..06a92db0 100644 --- a/qt/gen_qtextdocumentwriter.cpp +++ b/qt/gen_qtextdocumentwriter.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qtextdocumentwriter.h" +#include #include "gen_qtextdocumentwriter.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextdocumentwriter.go b/qt/gen_qtextdocumentwriter.go index 91af0334..7d05cac6 100644 --- a/qt/gen_qtextdocumentwriter.go +++ b/qt/gen_qtextdocumentwriter.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QTextDocumentWriter) cPointer() *C.QTextDocumentWriter { return this.h } +func (this *QTextDocumentWriter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextDocumentWriter(h *C.QTextDocumentWriter) *QTextDocumentWriter { if h == nil { return nil @@ -31,7 +39,7 @@ func newQTextDocumentWriter(h *C.QTextDocumentWriter) *QTextDocumentWriter { return &QTextDocumentWriter{h: h} } -func newQTextDocumentWriter_U(h unsafe.Pointer) *QTextDocumentWriter { +func UnsafeNewQTextDocumentWriter(h unsafe.Pointer) *QTextDocumentWriter { return newQTextDocumentWriter((*C.QTextDocumentWriter)(h)) } @@ -49,7 +57,7 @@ func NewQTextDocumentWriter2(device *QIODevice, format *QByteArray) *QTextDocume // NewQTextDocumentWriter3 constructs a new QTextDocumentWriter object. func NewQTextDocumentWriter3(fileName string) *QTextDocumentWriter { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QTextDocumentWriter_new3((*C.struct_miqt_string)(fileName_ms)) return newQTextDocumentWriter(ret) @@ -57,7 +65,7 @@ func NewQTextDocumentWriter3(fileName string) *QTextDocumentWriter { // NewQTextDocumentWriter4 constructs a new QTextDocumentWriter object. func NewQTextDocumentWriter4(fileName string, format *QByteArray) *QTextDocumentWriter { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) ret := C.QTextDocumentWriter_new4((*C.struct_miqt_string)(fileName_ms), format.cPointer()) return newQTextDocumentWriter(ret) @@ -79,11 +87,11 @@ func (this *QTextDocumentWriter) SetDevice(device *QIODevice) { } func (this *QTextDocumentWriter) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QTextDocumentWriter_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QTextDocumentWriter_Device(this.h))) } func (this *QTextDocumentWriter) SetFileName(fileName string) { - fileName_ms := miqt_strdupg(fileName) + fileName_ms := libmiqt.Strdupg(fileName) defer C.free(fileName_ms) C.QTextDocumentWriter_SetFileName(this.h, (*C.struct_miqt_string)(fileName_ms)) } @@ -108,7 +116,7 @@ func (this *QTextDocumentWriter) SetCodec(codec *QTextCodec) { } func (this *QTextDocumentWriter) Codec() *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextDocumentWriter_Codec(this.h))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextDocumentWriter_Codec(this.h))) } func QTextDocumentWriter_SupportedDocumentFormats() []QByteArray { diff --git a/qt/gen_qtextdocumentwriter.h b/qt/gen_qtextdocumentwriter.h index ace1ba3f..e94507f8 100644 --- a/qt/gen_qtextdocumentwriter.h +++ b/qt/gen_qtextdocumentwriter.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextedit.cpp b/qt/gen_qtextedit.cpp index 6558db80..1aec3831 100644 --- a/qt/gen_qtextedit.cpp +++ b/qt/gen_qtextedit.cpp @@ -19,7 +19,7 @@ #include #include #include -#include "qtextedit.h" +#include #include "gen_qtextedit.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextedit.go b/qt/gen_qtextedit.go index 0072a13c..fb904f4b 100644 --- a/qt/gen_qtextedit.go +++ b/qt/gen_qtextedit.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -43,14 +44,21 @@ func (this *QTextEdit) cPointer() *C.QTextEdit { return this.h } +func (this *QTextEdit) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextEdit(h *C.QTextEdit) *QTextEdit { if h == nil { return nil } - return &QTextEdit{h: h, QAbstractScrollArea: newQAbstractScrollArea_U(unsafe.Pointer(h))} + return &QTextEdit{h: h, QAbstractScrollArea: UnsafeNewQAbstractScrollArea(unsafe.Pointer(h))} } -func newQTextEdit_U(h unsafe.Pointer) *QTextEdit { +func UnsafeNewQTextEdit(h unsafe.Pointer) *QTextEdit { return newQTextEdit((*C.QTextEdit)(h)) } @@ -62,7 +70,7 @@ func NewQTextEdit() *QTextEdit { // NewQTextEdit2 constructs a new QTextEdit object. func NewQTextEdit2(text string) *QTextEdit { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTextEdit_new2((*C.struct_miqt_string)(text_ms)) return newQTextEdit(ret) @@ -76,14 +84,14 @@ func NewQTextEdit3(parent *QWidget) *QTextEdit { // NewQTextEdit4 constructs a new QTextEdit object. func NewQTextEdit4(text string, parent *QWidget) *QTextEdit { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTextEdit_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQTextEdit(ret) } func (this *QTextEdit) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextEdit_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextEdit_MetaObject(this.h))) } func (this *QTextEdit) Metacast(param1 string) unsafe.Pointer { @@ -115,11 +123,11 @@ func (this *QTextEdit) SetDocument(document *QTextDocument) { } func (this *QTextEdit) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QTextEdit_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QTextEdit_Document(this.h))) } func (this *QTextEdit) SetPlaceholderText(placeholderText string) { - placeholderText_ms := miqt_strdupg(placeholderText) + placeholderText_ms := libmiqt.Strdupg(placeholderText) defer C.free(placeholderText_ms) C.QTextEdit_SetPlaceholderText(this.h, (*C.struct_miqt_string)(placeholderText_ms)) } @@ -238,7 +246,7 @@ func (this *QTextEdit) SetTabChangesFocus(b bool) { } func (this *QTextEdit) SetDocumentTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QTextEdit_SetDocumentTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -283,7 +291,7 @@ func (this *QTextEdit) SetWordWrapMode(policy QTextOption__WrapMode) { } func (this *QTextEdit) Find(exp string) bool { - exp_ms := miqt_strdupg(exp) + exp_ms := libmiqt.Strdupg(exp) defer C.free(exp_ms) return (bool)(C.QTextEdit_Find(this.h, (*C.struct_miqt_string)(exp_ms))) } @@ -329,11 +337,11 @@ func (this *QTextEdit) LoadResource(typeVal int, name *QUrl) *QVariant { } func (this *QTextEdit) CreateStandardContextMenu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QTextEdit_CreateStandardContextMenu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QTextEdit_CreateStandardContextMenu(this.h))) } func (this *QTextEdit) CreateStandardContextMenuWithPosition(position *QPoint) *QMenu { - return newQMenu_U(unsafe.Pointer(C.QTextEdit_CreateStandardContextMenuWithPosition(this.h, position.cPointer()))) + return UnsafeNewQMenu(unsafe.Pointer(C.QTextEdit_CreateStandardContextMenuWithPosition(this.h, position.cPointer()))) } func (this *QTextEdit) CursorForPosition(pos *QPoint) *QTextCursor { @@ -461,7 +469,7 @@ func (this *QTextEdit) SetFontPointSize(s float64) { } func (this *QTextEdit) SetFontFamily(fontFamily string) { - fontFamily_ms := miqt_strdupg(fontFamily) + fontFamily_ms := libmiqt.Strdupg(fontFamily) defer C.free(fontFamily_ms) C.QTextEdit_SetFontFamily(this.h, (*C.struct_miqt_string)(fontFamily_ms)) } @@ -495,25 +503,25 @@ func (this *QTextEdit) SetAlignment(a AlignmentFlag) { } func (this *QTextEdit) SetPlainText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextEdit_SetPlainText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QTextEdit) SetHtml(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextEdit_SetHtml(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QTextEdit) SetMarkdown(markdown string) { - markdown_ms := miqt_strdupg(markdown) + markdown_ms := libmiqt.Strdupg(markdown) defer C.free(markdown_ms) C.QTextEdit_SetMarkdown(this.h, (*C.struct_miqt_string)(markdown_ms)) } func (this *QTextEdit) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextEdit_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -547,25 +555,25 @@ func (this *QTextEdit) SelectAll() { } func (this *QTextEdit) InsertPlainText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextEdit_InsertPlainText(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QTextEdit) InsertHtml(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextEdit_InsertHtml(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QTextEdit) Append(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextEdit_Append(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QTextEdit) ScrollToAnchor(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTextEdit_ScrollToAnchor(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -650,7 +658,7 @@ func miqt_exec_callback_QTextEdit_CurrentCharFormatChanged(cb C.intptr_t, format } // Convert all CABI parameters to Go parameters - slotval1 := newQTextCharFormat_U(unsafe.Pointer(format)) + slotval1 := UnsafeNewQTextCharFormat(unsafe.Pointer(format)) gofunc(slotval1) } @@ -754,7 +762,7 @@ func QTextEdit_TrUtf83(s string, c string, n int) string { } func (this *QTextEdit) Find22(exp string, options QTextDocument__FindFlag) bool { - exp_ms := miqt_strdupg(exp) + exp_ms := libmiqt.Strdupg(exp) defer C.free(exp_ms) return (bool)(C.QTextEdit_Find22(this.h, (*C.struct_miqt_string)(exp_ms), (C.int)(options))) } @@ -811,6 +819,13 @@ func (this *QTextEdit__ExtraSelection) cPointer() *C.QTextEdit__ExtraSelection { return this.h } +func (this *QTextEdit__ExtraSelection) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextEdit__ExtraSelection(h *C.QTextEdit__ExtraSelection) *QTextEdit__ExtraSelection { if h == nil { return nil @@ -818,7 +833,7 @@ func newQTextEdit__ExtraSelection(h *C.QTextEdit__ExtraSelection) *QTextEdit__Ex return &QTextEdit__ExtraSelection{h: h} } -func newQTextEdit__ExtraSelection_U(h unsafe.Pointer) *QTextEdit__ExtraSelection { +func UnsafeNewQTextEdit__ExtraSelection(h unsafe.Pointer) *QTextEdit__ExtraSelection { return newQTextEdit__ExtraSelection((*C.QTextEdit__ExtraSelection)(h)) } diff --git a/qt/gen_qtextedit.h b/qt/gen_qtextedit.h index 5bd7e451..0a10286c 100644 --- a/qt/gen_qtextedit.h +++ b/qt/gen_qtextedit.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextformat.cpp b/qt/gen_qtextformat.cpp index 7570bf57..46942565 100644 --- a/qt/gen_qtextformat.cpp +++ b/qt/gen_qtextformat.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "qtextformat.h" +#include #include "gen_qtextformat.h" #include "_cgo_export.h" @@ -329,7 +329,7 @@ struct miqt_string* QTextCharFormat_FontFamily(const QTextCharFormat* self) { } void QTextCharFormat_SetFontFamilies(QTextCharFormat* self, struct miqt_array* /* of struct miqt_string* */ families) { - QList families_QList; + QStringList families_QList; families_QList.reserve(families->len); struct miqt_string** families_arr = static_cast(families->data); for(size_t i = 0; i < families->len; ++i) { @@ -567,7 +567,7 @@ struct miqt_string* QTextCharFormat_AnchorName(const QTextCharFormat* self) { } void QTextCharFormat_SetAnchorNames(QTextCharFormat* self, struct miqt_array* /* of struct miqt_string* */ names) { - QList names_QList; + QStringList names_QList; names_QList.reserve(names->len); struct miqt_string** names_arr = static_cast(names->data); for(size_t i = 0; i < names->len; ++i) { diff --git a/qt/gen_qtextformat.go b/qt/gen_qtextformat.go index 0259f20c..60524903 100644 --- a/qt/gen_qtextformat.go +++ b/qt/gen_qtextformat.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -260,6 +261,13 @@ func (this *QTextLength) cPointer() *C.QTextLength { return this.h } +func (this *QTextLength) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextLength(h *C.QTextLength) *QTextLength { if h == nil { return nil @@ -267,7 +275,7 @@ func newQTextLength(h *C.QTextLength) *QTextLength { return &QTextLength{h: h} } -func newQTextLength_U(h unsafe.Pointer) *QTextLength { +func UnsafeNewQTextLength(h unsafe.Pointer) *QTextLength { return newQTextLength((*C.QTextLength)(h)) } @@ -334,6 +342,13 @@ func (this *QTextFormat) cPointer() *C.QTextFormat { return this.h } +func (this *QTextFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextFormat(h *C.QTextFormat) *QTextFormat { if h == nil { return nil @@ -341,7 +356,7 @@ func newQTextFormat(h *C.QTextFormat) *QTextFormat { return &QTextFormat{h: h} } -func newQTextFormat_U(h unsafe.Pointer) *QTextFormat { +func UnsafeNewQTextFormat(h unsafe.Pointer) *QTextFormat { return newQTextFormat((*C.QTextFormat)(h)) } @@ -648,14 +663,21 @@ func (this *QTextCharFormat) cPointer() *C.QTextCharFormat { return this.h } +func (this *QTextCharFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextCharFormat(h *C.QTextCharFormat) *QTextCharFormat { if h == nil { return nil } - return &QTextCharFormat{h: h, QTextFormat: newQTextFormat_U(unsafe.Pointer(h))} + return &QTextCharFormat{h: h, QTextFormat: UnsafeNewQTextFormat(unsafe.Pointer(h))} } -func newQTextCharFormat_U(h unsafe.Pointer) *QTextCharFormat { +func UnsafeNewQTextCharFormat(h unsafe.Pointer) *QTextCharFormat { return newQTextCharFormat((*C.QTextCharFormat)(h)) } @@ -691,7 +713,7 @@ func (this *QTextCharFormat) Font() *QFont { } func (this *QTextCharFormat) SetFontFamily(family string) { - family_ms := miqt_strdupg(family) + family_ms := libmiqt.Strdupg(family) defer C.free(family_ms) C.QTextCharFormat_SetFontFamily(this.h, (*C.struct_miqt_string)(family_ms)) } @@ -708,7 +730,7 @@ func (this *QTextCharFormat) SetFontFamilies(families []string) { families_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(families)))) defer C.free(unsafe.Pointer(families_CArray)) for i := range families { - families_i_ms := miqt_strdupg(families[i]) + families_i_ms := libmiqt.Strdupg(families[i]) defer C.free(families_i_ms) families_CArray[i] = (*C.struct_miqt_string)(families_i_ms) } @@ -725,7 +747,7 @@ func (this *QTextCharFormat) FontFamilies() *QVariant { } func (this *QTextCharFormat) SetFontStyleName(styleName string) { - styleName_ms := miqt_strdupg(styleName) + styleName_ms := libmiqt.Strdupg(styleName) defer C.free(styleName_ms) C.QTextCharFormat_SetFontStyleName(this.h, (*C.struct_miqt_string)(styleName_ms)) } @@ -904,7 +926,7 @@ func (this *QTextCharFormat) TextOutline() *QPen { } func (this *QTextCharFormat) SetToolTip(tip string) { - tip_ms := miqt_strdupg(tip) + tip_ms := libmiqt.Strdupg(tip) defer C.free(tip_ms) C.QTextCharFormat_SetToolTip(this.h, (*C.struct_miqt_string)(tip_ms)) } @@ -925,7 +947,7 @@ func (this *QTextCharFormat) IsAnchor() bool { } func (this *QTextCharFormat) SetAnchorHref(value string) { - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) C.QTextCharFormat_SetAnchorHref(this.h, (*C.struct_miqt_string)(value_ms)) } @@ -938,7 +960,7 @@ func (this *QTextCharFormat) AnchorHref() string { } func (this *QTextCharFormat) SetAnchorName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTextCharFormat_SetAnchorName(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -955,7 +977,7 @@ func (this *QTextCharFormat) SetAnchorNames(names []string) { names_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(names)))) defer C.free(unsafe.Pointer(names_CArray)) for i := range names { - names_i_ms := miqt_strdupg(names[i]) + names_i_ms := libmiqt.Strdupg(names[i]) defer C.free(names_i_ms) names_CArray[i] = (*C.struct_miqt_string)(names_i_ms) } @@ -1024,14 +1046,21 @@ func (this *QTextBlockFormat) cPointer() *C.QTextBlockFormat { return this.h } +func (this *QTextBlockFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextBlockFormat(h *C.QTextBlockFormat) *QTextBlockFormat { if h == nil { return nil } - return &QTextBlockFormat{h: h, QTextFormat: newQTextFormat_U(unsafe.Pointer(h))} + return &QTextBlockFormat{h: h, QTextFormat: UnsafeNewQTextFormat(unsafe.Pointer(h))} } -func newQTextBlockFormat_U(h unsafe.Pointer) *QTextBlockFormat { +func UnsafeNewQTextBlockFormat(h unsafe.Pointer) *QTextBlockFormat { return newQTextBlockFormat((*C.QTextBlockFormat)(h)) } @@ -1207,14 +1236,21 @@ func (this *QTextListFormat) cPointer() *C.QTextListFormat { return this.h } +func (this *QTextListFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextListFormat(h *C.QTextListFormat) *QTextListFormat { if h == nil { return nil } - return &QTextListFormat{h: h, QTextFormat: newQTextFormat_U(unsafe.Pointer(h))} + return &QTextListFormat{h: h, QTextFormat: UnsafeNewQTextFormat(unsafe.Pointer(h))} } -func newQTextListFormat_U(h unsafe.Pointer) *QTextListFormat { +func UnsafeNewQTextListFormat(h unsafe.Pointer) *QTextListFormat { return newQTextListFormat((*C.QTextListFormat)(h)) } @@ -1251,7 +1287,7 @@ func (this *QTextListFormat) Indent() int { } func (this *QTextListFormat) SetNumberPrefix(numberPrefix string) { - numberPrefix_ms := miqt_strdupg(numberPrefix) + numberPrefix_ms := libmiqt.Strdupg(numberPrefix) defer C.free(numberPrefix_ms) C.QTextListFormat_SetNumberPrefix(this.h, (*C.struct_miqt_string)(numberPrefix_ms)) } @@ -1264,7 +1300,7 @@ func (this *QTextListFormat) NumberPrefix() string { } func (this *QTextListFormat) SetNumberSuffix(numberSuffix string) { - numberSuffix_ms := miqt_strdupg(numberSuffix) + numberSuffix_ms := libmiqt.Strdupg(numberSuffix) defer C.free(numberSuffix_ms) C.QTextListFormat_SetNumberSuffix(this.h, (*C.struct_miqt_string)(numberSuffix_ms)) } @@ -1302,14 +1338,21 @@ func (this *QTextImageFormat) cPointer() *C.QTextImageFormat { return this.h } +func (this *QTextImageFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextImageFormat(h *C.QTextImageFormat) *QTextImageFormat { if h == nil { return nil } - return &QTextImageFormat{h: h, QTextCharFormat: newQTextCharFormat_U(unsafe.Pointer(h))} + return &QTextImageFormat{h: h, QTextCharFormat: UnsafeNewQTextCharFormat(unsafe.Pointer(h))} } -func newQTextImageFormat_U(h unsafe.Pointer) *QTextImageFormat { +func UnsafeNewQTextImageFormat(h unsafe.Pointer) *QTextImageFormat { return newQTextImageFormat((*C.QTextImageFormat)(h)) } @@ -1324,7 +1367,7 @@ func (this *QTextImageFormat) IsValid() bool { } func (this *QTextImageFormat) SetName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTextImageFormat_SetName(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -1390,14 +1433,21 @@ func (this *QTextFrameFormat) cPointer() *C.QTextFrameFormat { return this.h } +func (this *QTextFrameFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextFrameFormat(h *C.QTextFrameFormat) *QTextFrameFormat { if h == nil { return nil } - return &QTextFrameFormat{h: h, QTextFormat: newQTextFormat_U(unsafe.Pointer(h))} + return &QTextFrameFormat{h: h, QTextFormat: UnsafeNewQTextFormat(unsafe.Pointer(h))} } -func newQTextFrameFormat_U(h unsafe.Pointer) *QTextFrameFormat { +func UnsafeNewQTextFrameFormat(h unsafe.Pointer) *QTextFrameFormat { return newQTextFrameFormat((*C.QTextFrameFormat)(h)) } @@ -1564,14 +1614,21 @@ func (this *QTextTableFormat) cPointer() *C.QTextTableFormat { return this.h } +func (this *QTextTableFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextTableFormat(h *C.QTextTableFormat) *QTextTableFormat { if h == nil { return nil } - return &QTextTableFormat{h: h, QTextFrameFormat: newQTextFrameFormat_U(unsafe.Pointer(h))} + return &QTextTableFormat{h: h, QTextFrameFormat: UnsafeNewQTextFrameFormat(unsafe.Pointer(h))} } -func newQTextTableFormat_U(h unsafe.Pointer) *QTextTableFormat { +func UnsafeNewQTextTableFormat(h unsafe.Pointer) *QTextTableFormat { return newQTextTableFormat((*C.QTextTableFormat)(h)) } @@ -1689,14 +1746,21 @@ func (this *QTextTableCellFormat) cPointer() *C.QTextTableCellFormat { return this.h } +func (this *QTextTableCellFormat) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextTableCellFormat(h *C.QTextTableCellFormat) *QTextTableCellFormat { if h == nil { return nil } - return &QTextTableCellFormat{h: h, QTextCharFormat: newQTextCharFormat_U(unsafe.Pointer(h))} + return &QTextTableCellFormat{h: h, QTextCharFormat: UnsafeNewQTextCharFormat(unsafe.Pointer(h))} } -func newQTextTableCellFormat_U(h unsafe.Pointer) *QTextTableCellFormat { +func UnsafeNewQTextTableCellFormat(h unsafe.Pointer) *QTextTableCellFormat { return newQTextTableCellFormat((*C.QTextTableCellFormat)(h)) } diff --git a/qt/gen_qtextformat.h b/qt/gen_qtextformat.h index 77d18477..1903cec3 100644 --- a/qt/gen_qtextformat.h +++ b/qt/gen_qtextformat.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextlayout.cpp b/qt/gen_qtextlayout.cpp index 2942f0ce..7b7550c1 100644 --- a/qt/gen_qtextlayout.cpp +++ b/qt/gen_qtextlayout.cpp @@ -16,7 +16,7 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QTextLayout__FormatRange #include #include -#include "qtextlayout.h" +#include #include "gen_qtextlayout.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextlayout.go b/qt/gen_qtextlayout.go index 5c91e1fe..7ca27295 100644 --- a/qt/gen_qtextlayout.go +++ b/qt/gen_qtextlayout.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -45,6 +46,13 @@ func (this *QTextInlineObject) cPointer() *C.QTextInlineObject { return this.h } +func (this *QTextInlineObject) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextInlineObject(h *C.QTextInlineObject) *QTextInlineObject { if h == nil { return nil @@ -52,7 +60,7 @@ func newQTextInlineObject(h *C.QTextInlineObject) *QTextInlineObject { return &QTextInlineObject{h: h} } -func newQTextInlineObject_U(h unsafe.Pointer) *QTextInlineObject { +func UnsafeNewQTextInlineObject(h unsafe.Pointer) *QTextInlineObject { return newQTextInlineObject((*C.QTextInlineObject)(h)) } @@ -145,6 +153,13 @@ func (this *QTextLayout) cPointer() *C.QTextLayout { return this.h } +func (this *QTextLayout) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextLayout(h *C.QTextLayout) *QTextLayout { if h == nil { return nil @@ -152,7 +167,7 @@ func newQTextLayout(h *C.QTextLayout) *QTextLayout { return &QTextLayout{h: h} } -func newQTextLayout_U(h unsafe.Pointer) *QTextLayout { +func UnsafeNewQTextLayout(h unsafe.Pointer) *QTextLayout { return newQTextLayout((*C.QTextLayout)(h)) } @@ -164,7 +179,7 @@ func NewQTextLayout() *QTextLayout { // NewQTextLayout2 constructs a new QTextLayout object. func NewQTextLayout2(text string) *QTextLayout { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTextLayout_new2((*C.struct_miqt_string)(text_ms)) return newQTextLayout(ret) @@ -172,7 +187,7 @@ func NewQTextLayout2(text string) *QTextLayout { // NewQTextLayout3 constructs a new QTextLayout object. func NewQTextLayout3(text string, font *QFont) *QTextLayout { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTextLayout_new3((*C.struct_miqt_string)(text_ms), font.cPointer()) return newQTextLayout(ret) @@ -186,7 +201,7 @@ func NewQTextLayout4(b *QTextBlock) *QTextLayout { // NewQTextLayout5 constructs a new QTextLayout object. func NewQTextLayout5(text string, font *QFont, paintdevice *QPaintDevice) *QTextLayout { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QTextLayout_new5((*C.struct_miqt_string)(text_ms), font.cPointer(), paintdevice.cPointer()) return newQTextLayout(ret) @@ -208,7 +223,7 @@ func (this *QTextLayout) SetRawFont(rawFont *QRawFont) { } func (this *QTextLayout) SetText(stringVal string) { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) C.QTextLayout_SetText(this.h, (*C.struct_miqt_string)(stringVal_ms)) } @@ -225,11 +240,11 @@ func (this *QTextLayout) SetTextOption(option *QTextOption) { } func (this *QTextLayout) TextOption() *QTextOption { - return newQTextOption_U(unsafe.Pointer(C.QTextLayout_TextOption(this.h))) + return UnsafeNewQTextOption(unsafe.Pointer(C.QTextLayout_TextOption(this.h))) } func (this *QTextLayout) SetPreeditArea(position int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTextLayout_SetPreeditArea(this.h, (C.int)(position), (*C.struct_miqt_string)(text_ms)) } @@ -519,6 +534,13 @@ func (this *QTextLine) cPointer() *C.QTextLine { return this.h } +func (this *QTextLine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextLine(h *C.QTextLine) *QTextLine { if h == nil { return nil @@ -526,7 +548,7 @@ func newQTextLine(h *C.QTextLine) *QTextLine { return &QTextLine{h: h} } -func newQTextLine_U(h unsafe.Pointer) *QTextLine { +func UnsafeNewQTextLine(h unsafe.Pointer) *QTextLine { return newQTextLine((*C.QTextLine)(h)) } @@ -732,6 +754,13 @@ func (this *QTextLayout__FormatRange) cPointer() *C.QTextLayout__FormatRange { return this.h } +func (this *QTextLayout__FormatRange) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextLayout__FormatRange(h *C.QTextLayout__FormatRange) *QTextLayout__FormatRange { if h == nil { return nil @@ -739,7 +768,7 @@ func newQTextLayout__FormatRange(h *C.QTextLayout__FormatRange) *QTextLayout__Fo return &QTextLayout__FormatRange{h: h} } -func newQTextLayout__FormatRange_U(h unsafe.Pointer) *QTextLayout__FormatRange { +func UnsafeNewQTextLayout__FormatRange(h unsafe.Pointer) *QTextLayout__FormatRange { return newQTextLayout__FormatRange((*C.QTextLayout__FormatRange)(h)) } diff --git a/qt/gen_qtextlayout.h b/qt/gen_qtextlayout.h index a0803074..dcdcf9b3 100644 --- a/qt/gen_qtextlayout.h +++ b/qt/gen_qtextlayout.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextlist.cpp b/qt/gen_qtextlist.cpp index 10b71004..803287ea 100644 --- a/qt/gen_qtextlist.cpp +++ b/qt/gen_qtextlist.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qtextlist.h" +#include #include "gen_qtextlist.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextlist.go b/qt/gen_qtextlist.go index b5747e0e..0b16e612 100644 --- a/qt/gen_qtextlist.go +++ b/qt/gen_qtextlist.go @@ -25,14 +25,21 @@ func (this *QTextList) cPointer() *C.QTextList { return this.h } +func (this *QTextList) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextList(h *C.QTextList) *QTextList { if h == nil { return nil } - return &QTextList{h: h, QTextBlockGroup: newQTextBlockGroup_U(unsafe.Pointer(h))} + return &QTextList{h: h, QTextBlockGroup: UnsafeNewQTextBlockGroup(unsafe.Pointer(h))} } -func newQTextList_U(h unsafe.Pointer) *QTextList { +func UnsafeNewQTextList(h unsafe.Pointer) *QTextList { return newQTextList((*C.QTextList)(h)) } @@ -43,7 +50,7 @@ func NewQTextList(doc *QTextDocument) *QTextList { } func (this *QTextList) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextList_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextList_MetaObject(this.h))) } func (this *QTextList) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qtextlist.h b/qt/gen_qtextlist.h index 9c7cc929..1d06242b 100644 --- a/qt/gen_qtextlist.h +++ b/qt/gen_qtextlist.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextobject.cpp b/qt/gen_qtextobject.cpp index 9e130d48..3d80a9cb 100644 --- a/qt/gen_qtextobject.cpp +++ b/qt/gen_qtextobject.cpp @@ -22,7 +22,7 @@ #define WORKAROUND_INNER_CLASS_DEFINITION_QTextLayout__FormatRange #include #include -#include "qtextobject.h" +#include #include "gen_qtextobject.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextobject.go b/qt/gen_qtextobject.go index d72ab9a2..3d04f08b 100644 --- a/qt/gen_qtextobject.go +++ b/qt/gen_qtextobject.go @@ -25,19 +25,26 @@ func (this *QTextObject) cPointer() *C.QTextObject { return this.h } +func (this *QTextObject) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextObject(h *C.QTextObject) *QTextObject { if h == nil { return nil } - return &QTextObject{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QTextObject{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQTextObject_U(h unsafe.Pointer) *QTextObject { +func UnsafeNewQTextObject(h unsafe.Pointer) *QTextObject { return newQTextObject((*C.QTextObject)(h)) } func (this *QTextObject) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextObject_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextObject_MetaObject(this.h))) } func (this *QTextObject) Metacast(param1 string) unsafe.Pointer { @@ -76,7 +83,7 @@ func (this *QTextObject) FormatIndex() int { } func (this *QTextObject) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QTextObject_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QTextObject_Document(this.h))) } func (this *QTextObject) ObjectIndex() int { @@ -139,19 +146,26 @@ func (this *QTextBlockGroup) cPointer() *C.QTextBlockGroup { return this.h } +func (this *QTextBlockGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextBlockGroup(h *C.QTextBlockGroup) *QTextBlockGroup { if h == nil { return nil } - return &QTextBlockGroup{h: h, QTextObject: newQTextObject_U(unsafe.Pointer(h))} + return &QTextBlockGroup{h: h, QTextObject: UnsafeNewQTextObject(unsafe.Pointer(h))} } -func newQTextBlockGroup_U(h unsafe.Pointer) *QTextBlockGroup { +func UnsafeNewQTextBlockGroup(h unsafe.Pointer) *QTextBlockGroup { return newQTextBlockGroup((*C.QTextBlockGroup)(h)) } func (this *QTextBlockGroup) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextBlockGroup_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextBlockGroup_MetaObject(this.h))) } func (this *QTextBlockGroup) Metacast(param1 string) unsafe.Pointer { @@ -233,6 +247,13 @@ func (this *QTextFrameLayoutData) cPointer() *C.QTextFrameLayoutData { return this.h } +func (this *QTextFrameLayoutData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextFrameLayoutData(h *C.QTextFrameLayoutData) *QTextFrameLayoutData { if h == nil { return nil @@ -240,7 +261,7 @@ func newQTextFrameLayoutData(h *C.QTextFrameLayoutData) *QTextFrameLayoutData { return &QTextFrameLayoutData{h: h} } -func newQTextFrameLayoutData_U(h unsafe.Pointer) *QTextFrameLayoutData { +func UnsafeNewQTextFrameLayoutData(h unsafe.Pointer) *QTextFrameLayoutData { return newQTextFrameLayoutData((*C.QTextFrameLayoutData)(h)) } @@ -274,14 +295,21 @@ func (this *QTextFrame) cPointer() *C.QTextFrame { return this.h } +func (this *QTextFrame) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextFrame(h *C.QTextFrame) *QTextFrame { if h == nil { return nil } - return &QTextFrame{h: h, QTextObject: newQTextObject_U(unsafe.Pointer(h))} + return &QTextFrame{h: h, QTextObject: UnsafeNewQTextObject(unsafe.Pointer(h))} } -func newQTextFrame_U(h unsafe.Pointer) *QTextFrame { +func UnsafeNewQTextFrame(h unsafe.Pointer) *QTextFrame { return newQTextFrame((*C.QTextFrame)(h)) } @@ -292,7 +320,7 @@ func NewQTextFrame(doc *QTextDocument) *QTextFrame { } func (this *QTextFrame) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextFrame_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextFrame_MetaObject(this.h))) } func (this *QTextFrame) Metacast(param1 string) unsafe.Pointer { @@ -353,7 +381,7 @@ func (this *QTextFrame) LastPosition() int { } func (this *QTextFrame) LayoutData() *QTextFrameLayoutData { - return newQTextFrameLayoutData_U(unsafe.Pointer(C.QTextFrame_LayoutData(this.h))) + return UnsafeNewQTextFrameLayoutData(unsafe.Pointer(C.QTextFrame_LayoutData(this.h))) } func (this *QTextFrame) SetLayoutData(data *QTextFrameLayoutData) { @@ -365,14 +393,14 @@ func (this *QTextFrame) ChildFrames() []*QTextFrame { _ret := make([]*QTextFrame, int(_ma.len)) _outCast := (*[0xffff]*C.QTextFrame)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTextFrame_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTextFrame(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QTextFrame) ParentFrame() *QTextFrame { - return newQTextFrame_U(unsafe.Pointer(C.QTextFrame_ParentFrame(this.h))) + return UnsafeNewQTextFrame(unsafe.Pointer(C.QTextFrame_ParentFrame(this.h))) } func (this *QTextFrame) Begin() *QTextFrame__iterator { @@ -458,6 +486,13 @@ func (this *QTextBlockUserData) cPointer() *C.QTextBlockUserData { return this.h } +func (this *QTextBlockUserData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextBlockUserData(h *C.QTextBlockUserData) *QTextBlockUserData { if h == nil { return nil @@ -465,7 +500,7 @@ func newQTextBlockUserData(h *C.QTextBlockUserData) *QTextBlockUserData { return &QTextBlockUserData{h: h} } -func newQTextBlockUserData_U(h unsafe.Pointer) *QTextBlockUserData { +func UnsafeNewQTextBlockUserData(h unsafe.Pointer) *QTextBlockUserData { return newQTextBlockUserData((*C.QTextBlockUserData)(h)) } @@ -498,6 +533,13 @@ func (this *QTextBlock) cPointer() *C.QTextBlock { return this.h } +func (this *QTextBlock) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextBlock(h *C.QTextBlock) *QTextBlock { if h == nil { return nil @@ -505,7 +547,7 @@ func newQTextBlock(h *C.QTextBlock) *QTextBlock { return &QTextBlock{h: h} } -func newQTextBlock_U(h unsafe.Pointer) *QTextBlock { +func UnsafeNewQTextBlock(h unsafe.Pointer) *QTextBlock { return newQTextBlock((*C.QTextBlock)(h)) } @@ -554,7 +596,7 @@ func (this *QTextBlock) Contains(position int) bool { } func (this *QTextBlock) Layout() *QTextLayout { - return newQTextLayout_U(unsafe.Pointer(C.QTextBlock_Layout(this.h))) + return UnsafeNewQTextLayout(unsafe.Pointer(C.QTextBlock_Layout(this.h))) } func (this *QTextBlock) ClearLayout() { @@ -609,15 +651,15 @@ func (this *QTextBlock) TextFormats() []QTextLayout__FormatRange { } func (this *QTextBlock) Document() *QTextDocument { - return newQTextDocument_U(unsafe.Pointer(C.QTextBlock_Document(this.h))) + return UnsafeNewQTextDocument(unsafe.Pointer(C.QTextBlock_Document(this.h))) } func (this *QTextBlock) TextList() *QTextList { - return newQTextList_U(unsafe.Pointer(C.QTextBlock_TextList(this.h))) + return UnsafeNewQTextList(unsafe.Pointer(C.QTextBlock_TextList(this.h))) } func (this *QTextBlock) UserData() *QTextBlockUserData { - return newQTextBlockUserData_U(unsafe.Pointer(C.QTextBlock_UserData(this.h))) + return UnsafeNewQTextBlockUserData(unsafe.Pointer(C.QTextBlock_UserData(this.h))) } func (this *QTextBlock) SetUserData(data *QTextBlockUserData) { @@ -721,6 +763,13 @@ func (this *QTextFragment) cPointer() *C.QTextFragment { return this.h } +func (this *QTextFragment) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextFragment(h *C.QTextFragment) *QTextFragment { if h == nil { return nil @@ -728,7 +777,7 @@ func newQTextFragment(h *C.QTextFragment) *QTextFragment { return &QTextFragment{h: h} } -func newQTextFragment_U(h unsafe.Pointer) *QTextFragment { +func UnsafeNewQTextFragment(h unsafe.Pointer) *QTextFragment { return newQTextFragment((*C.QTextFragment)(h)) } @@ -861,6 +910,13 @@ func (this *QTextFrame__iterator) cPointer() *C.QTextFrame__iterator { return this.h } +func (this *QTextFrame__iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextFrame__iterator(h *C.QTextFrame__iterator) *QTextFrame__iterator { if h == nil { return nil @@ -868,7 +924,7 @@ func newQTextFrame__iterator(h *C.QTextFrame__iterator) *QTextFrame__iterator { return &QTextFrame__iterator{h: h} } -func newQTextFrame__iterator_U(h unsafe.Pointer) *QTextFrame__iterator { +func UnsafeNewQTextFrame__iterator(h unsafe.Pointer) *QTextFrame__iterator { return newQTextFrame__iterator((*C.QTextFrame__iterator)(h)) } @@ -889,11 +945,11 @@ func (this *QTextFrame__iterator) OperatorAssign(o *QTextFrame__iterator) { } func (this *QTextFrame__iterator) ParentFrame() *QTextFrame { - return newQTextFrame_U(unsafe.Pointer(C.QTextFrame__iterator_ParentFrame(this.h))) + return UnsafeNewQTextFrame(unsafe.Pointer(C.QTextFrame__iterator_ParentFrame(this.h))) } func (this *QTextFrame__iterator) CurrentFrame() *QTextFrame { - return newQTextFrame_U(unsafe.Pointer(C.QTextFrame__iterator_CurrentFrame(this.h))) + return UnsafeNewQTextFrame(unsafe.Pointer(C.QTextFrame__iterator_CurrentFrame(this.h))) } func (this *QTextFrame__iterator) CurrentBlock() *QTextBlock { @@ -916,7 +972,7 @@ func (this *QTextFrame__iterator) OperatorNotEqual(o *QTextFrame__iterator) bool } func (this *QTextFrame__iterator) OperatorPlusPlus() *QTextFrame__iterator { - return newQTextFrame__iterator_U(unsafe.Pointer(C.QTextFrame__iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQTextFrame__iterator(unsafe.Pointer(C.QTextFrame__iterator_OperatorPlusPlus(this.h))) } func (this *QTextFrame__iterator) OperatorPlusPlusWithInt(param1 int) *QTextFrame__iterator { @@ -927,7 +983,7 @@ func (this *QTextFrame__iterator) OperatorPlusPlusWithInt(param1 int) *QTextFram } func (this *QTextFrame__iterator) OperatorMinusMinus() *QTextFrame__iterator { - return newQTextFrame__iterator_U(unsafe.Pointer(C.QTextFrame__iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQTextFrame__iterator(unsafe.Pointer(C.QTextFrame__iterator_OperatorMinusMinus(this.h))) } func (this *QTextFrame__iterator) OperatorMinusMinusWithInt(param1 int) *QTextFrame__iterator { @@ -962,6 +1018,13 @@ func (this *QTextBlock__iterator) cPointer() *C.QTextBlock__iterator { return this.h } +func (this *QTextBlock__iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextBlock__iterator(h *C.QTextBlock__iterator) *QTextBlock__iterator { if h == nil { return nil @@ -969,7 +1032,7 @@ func newQTextBlock__iterator(h *C.QTextBlock__iterator) *QTextBlock__iterator { return &QTextBlock__iterator{h: h} } -func newQTextBlock__iterator_U(h unsafe.Pointer) *QTextBlock__iterator { +func UnsafeNewQTextBlock__iterator(h unsafe.Pointer) *QTextBlock__iterator { return newQTextBlock__iterator((*C.QTextBlock__iterator)(h)) } @@ -1009,7 +1072,7 @@ func (this *QTextBlock__iterator) OperatorNotEqual(o *QTextBlock__iterator) bool } func (this *QTextBlock__iterator) OperatorPlusPlus() *QTextBlock__iterator { - return newQTextBlock__iterator_U(unsafe.Pointer(C.QTextBlock__iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQTextBlock__iterator(unsafe.Pointer(C.QTextBlock__iterator_OperatorPlusPlus(this.h))) } func (this *QTextBlock__iterator) OperatorPlusPlusWithInt(param1 int) *QTextBlock__iterator { @@ -1020,7 +1083,7 @@ func (this *QTextBlock__iterator) OperatorPlusPlusWithInt(param1 int) *QTextBloc } func (this *QTextBlock__iterator) OperatorMinusMinus() *QTextBlock__iterator { - return newQTextBlock__iterator_U(unsafe.Pointer(C.QTextBlock__iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQTextBlock__iterator(unsafe.Pointer(C.QTextBlock__iterator_OperatorMinusMinus(this.h))) } func (this *QTextBlock__iterator) OperatorMinusMinusWithInt(param1 int) *QTextBlock__iterator { diff --git a/qt/gen_qtextobject.h b/qt/gen_qtextobject.h index ed10931b..ec8a73ce 100644 --- a/qt/gen_qtextobject.h +++ b/qt/gen_qtextobject.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextoption.cpp b/qt/gen_qtextoption.cpp index b1ac162e..e134b722 100644 --- a/qt/gen_qtextoption.cpp +++ b/qt/gen_qtextoption.cpp @@ -2,7 +2,7 @@ #include #include #define WORKAROUND_INNER_CLASS_DEFINITION_QTextOption__Tab -#include "qtextoption.h" +#include #include "gen_qtextoption.h" #include "_cgo_export.h" @@ -77,7 +77,7 @@ double QTextOption_TabStopDistance(const QTextOption* self) { } void QTextOption_SetTabArray(QTextOption* self, struct miqt_array* /* of double */ tabStops) { - QList tabStops_QList; + QList tabStops_QList; tabStops_QList.reserve(tabStops->len); double* tabStops_arr = static_cast(tabStops->data); for(size_t i = 0; i < tabStops->len; ++i) { diff --git a/qt/gen_qtextoption.go b/qt/gen_qtextoption.go index 5e84ea0e..483bf188 100644 --- a/qt/gen_qtextoption.go +++ b/qt/gen_qtextoption.go @@ -54,6 +54,13 @@ func (this *QTextOption) cPointer() *C.QTextOption { return this.h } +func (this *QTextOption) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextOption(h *C.QTextOption) *QTextOption { if h == nil { return nil @@ -61,7 +68,7 @@ func newQTextOption(h *C.QTextOption) *QTextOption { return &QTextOption{h: h} } -func newQTextOption_U(h unsafe.Pointer) *QTextOption { +func UnsafeNewQTextOption(h unsafe.Pointer) *QTextOption { return newQTextOption((*C.QTextOption)(h)) } @@ -217,6 +224,13 @@ func (this *QTextOption__Tab) cPointer() *C.QTextOption__Tab { return this.h } +func (this *QTextOption__Tab) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextOption__Tab(h *C.QTextOption__Tab) *QTextOption__Tab { if h == nil { return nil @@ -224,7 +238,7 @@ func newQTextOption__Tab(h *C.QTextOption__Tab) *QTextOption__Tab { return &QTextOption__Tab{h: h} } -func newQTextOption__Tab_U(h unsafe.Pointer) *QTextOption__Tab { +func UnsafeNewQTextOption__Tab(h unsafe.Pointer) *QTextOption__Tab { return newQTextOption__Tab((*C.QTextOption__Tab)(h)) } diff --git a/qt/gen_qtextoption.h b/qt/gen_qtextoption.h index 31f59aa1..8c9c0581 100644 --- a/qt/gen_qtextoption.h +++ b/qt/gen_qtextoption.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtextstream.cpp b/qt/gen_qtextstream.cpp index 4ee72500..f9aa1047 100644 --- a/qt/gen_qtextstream.cpp +++ b/qt/gen_qtextstream.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qtextstream.h" +#include #include "gen_qtextstream.h" #include "_cgo_export.h" diff --git a/qt/gen_qtextstream.go b/qt/gen_qtextstream.go index 0d746c68..8b84206b 100644 --- a/qt/gen_qtextstream.go +++ b/qt/gen_qtextstream.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -60,6 +61,13 @@ func (this *QTextStream) cPointer() *C.QTextStream { return this.h } +func (this *QTextStream) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextStream(h *C.QTextStream) *QTextStream { if h == nil { return nil @@ -67,7 +75,7 @@ func newQTextStream(h *C.QTextStream) *QTextStream { return &QTextStream{h: h} } -func newQTextStream_U(h unsafe.Pointer) *QTextStream { +func UnsafeNewQTextStream(h unsafe.Pointer) *QTextStream { return newQTextStream((*C.QTextStream)(h)) } @@ -118,7 +126,7 @@ func (this *QTextStream) SetCodecWithCodecName(codecName string) { } func (this *QTextStream) Codec() *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QTextStream_Codec(this.h))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextStream_Codec(this.h))) } func (this *QTextStream) SetAutoDetectUnicode(enabled bool) { @@ -153,7 +161,7 @@ func (this *QTextStream) SetDevice(device *QIODevice) { } func (this *QTextStream) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QTextStream_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QTextStream_Device(this.h))) } func (this *QTextStream) String() string { @@ -280,135 +288,135 @@ func (this *QTextStream) RealNumberPrecision() int { } func (this *QTextStream) OperatorShiftRight(ch *QChar) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRight(this.h, ch.cPointer()))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRight(this.h, ch.cPointer()))) } func (this *QTextStream) OperatorShiftRightWithCh(ch *int8) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithCh(this.h, (*C.char)(unsafe.Pointer(ch))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithCh(this.h, (*C.char)(unsafe.Pointer(ch))))) } func (this *QTextStream) OperatorShiftRightWithShort(i *int16) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithShort(this.h, (*C.int16_t)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithShort(this.h, (*C.int16_t)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithUnsignedshort(i *uint16) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithUnsignedshort(this.h, (*C.uint16_t)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithUnsignedshort(this.h, (*C.uint16_t)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithInt(i *int) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithInt(this.h, (*C.int)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithInt(this.h, (*C.int)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithUnsignedint(i *uint) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithUnsignedint(this.h, (*C.uint)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithUnsignedint(this.h, (*C.uint)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithLong(i *int64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithLong(this.h, (*C.long)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithLong(this.h, (*C.long)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithUnsignedlong(i *uint64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithUnsignedlong(this.h, (*C.ulong)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithUnsignedlong(this.h, (*C.ulong)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithQlonglong(i *int64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithQlonglong(this.h, (*C.longlong)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithQlonglong(this.h, (*C.longlong)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithQulonglong(i *uint64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithQulonglong(this.h, (*C.ulonglong)(unsafe.Pointer(i))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithQulonglong(this.h, (*C.ulonglong)(unsafe.Pointer(i))))) } func (this *QTextStream) OperatorShiftRightWithFloat(f *float32) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithFloat(this.h, (*C.float)(unsafe.Pointer(f))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithFloat(this.h, (*C.float)(unsafe.Pointer(f))))) } func (this *QTextStream) OperatorShiftRightWithDouble(f *float64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithDouble(this.h, (*C.double)(unsafe.Pointer(f))))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithDouble(this.h, (*C.double)(unsafe.Pointer(f))))) } func (this *QTextStream) OperatorShiftRightWithQString(s string) *QTextStream { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) } func (this *QTextStream) OperatorShiftRightWithArray(array *QByteArray) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithArray(this.h, array.cPointer()))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithArray(this.h, array.cPointer()))) } func (this *QTextStream) OperatorShiftRightWithChar(c string) *QTextStream { c_Cstring := C.CString(c) defer C.free(unsafe.Pointer(c_Cstring)) - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithChar(this.h, c_Cstring))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftRightWithChar(this.h, c_Cstring))) } func (this *QTextStream) OperatorShiftLeft(ch QChar) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeft(this.h, ch.cPointer()))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeft(this.h, ch.cPointer()))) } func (this *QTextStream) OperatorShiftLeftWithCh(ch int8) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithCh(this.h, (C.char)(ch)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithCh(this.h, (C.char)(ch)))) } func (this *QTextStream) OperatorShiftLeftWithShort(i int16) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithShort(this.h, (C.int16_t)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithShort(this.h, (C.int16_t)(i)))) } func (this *QTextStream) OperatorShiftLeftWithUnsignedshort(i uint16) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithUnsignedshort(this.h, (C.uint16_t)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithUnsignedshort(this.h, (C.uint16_t)(i)))) } func (this *QTextStream) OperatorShiftLeftWithInt(i int) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithInt(this.h, (C.int)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithInt(this.h, (C.int)(i)))) } func (this *QTextStream) OperatorShiftLeftWithUnsignedint(i uint) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithUnsignedint(this.h, (C.uint)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithUnsignedint(this.h, (C.uint)(i)))) } func (this *QTextStream) OperatorShiftLeftWithLong(i int64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithLong(this.h, (C.long)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithLong(this.h, (C.long)(i)))) } func (this *QTextStream) OperatorShiftLeftWithUnsignedlong(i uint64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithUnsignedlong(this.h, (C.ulong)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithUnsignedlong(this.h, (C.ulong)(i)))) } func (this *QTextStream) OperatorShiftLeftWithQlonglong(i int64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithQlonglong(this.h, (C.longlong)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithQlonglong(this.h, (C.longlong)(i)))) } func (this *QTextStream) OperatorShiftLeftWithQulonglong(i uint64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithQulonglong(this.h, (C.ulonglong)(i)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithQulonglong(this.h, (C.ulonglong)(i)))) } func (this *QTextStream) OperatorShiftLeftWithFloat(f float32) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithFloat(this.h, (C.float)(f)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithFloat(this.h, (C.float)(f)))) } func (this *QTextStream) OperatorShiftLeftWithDouble(f float64) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithDouble(this.h, (C.double)(f)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithDouble(this.h, (C.double)(f)))) } func (this *QTextStream) OperatorShiftLeftWithQString(s string) *QTextStream { - s_ms := miqt_strdupg(s) + s_ms := libmiqt.Strdupg(s) defer C.free(s_ms) - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithQString(this.h, (*C.struct_miqt_string)(s_ms)))) } func (this *QTextStream) OperatorShiftLeftWithArray(array *QByteArray) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithArray(this.h, array.cPointer()))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithArray(this.h, array.cPointer()))) } func (this *QTextStream) OperatorShiftLeftWithChar(c string) *QTextStream { c_Cstring := C.CString(c) defer C.free(unsafe.Pointer(c_Cstring)) - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithChar(this.h, c_Cstring))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithChar(this.h, c_Cstring))) } func (this *QTextStream) OperatorShiftLeftWithPtr(ptr unsafe.Pointer) *QTextStream { - return newQTextStream_U(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithPtr(this.h, ptr))) + return UnsafeNewQTextStream(unsafe.Pointer(C.QTextStream_OperatorShiftLeftWithPtr(this.h, ptr))) } func (this *QTextStream) ReadLine1(maxlen int64) string { diff --git a/qt/gen_qtextstream.h b/qt/gen_qtextstream.h index f8c9a463..f8e2f5e6 100644 --- a/qt/gen_qtextstream.h +++ b/qt/gen_qtextstream.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtexttable.cpp b/qt/gen_qtexttable.cpp index b89e415d..96ed3655 100644 --- a/qt/gen_qtexttable.cpp +++ b/qt/gen_qtexttable.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qtexttable.h" +#include #include "gen_qtexttable.h" #include "_cgo_export.h" diff --git a/qt/gen_qtexttable.go b/qt/gen_qtexttable.go index 18d0690a..7daa736e 100644 --- a/qt/gen_qtexttable.go +++ b/qt/gen_qtexttable.go @@ -24,6 +24,13 @@ func (this *QTextTableCell) cPointer() *C.QTextTableCell { return this.h } +func (this *QTextTableCell) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextTableCell(h *C.QTextTableCell) *QTextTableCell { if h == nil { return nil @@ -31,7 +38,7 @@ func newQTextTableCell(h *C.QTextTableCell) *QTextTableCell { return &QTextTableCell{h: h} } -func newQTextTableCell_U(h unsafe.Pointer) *QTextTableCell { +func UnsafeNewQTextTableCell(h unsafe.Pointer) *QTextTableCell { return newQTextTableCell((*C.QTextTableCell)(h)) } @@ -156,14 +163,21 @@ func (this *QTextTable) cPointer() *C.QTextTable { return this.h } +func (this *QTextTable) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTextTable(h *C.QTextTable) *QTextTable { if h == nil { return nil } - return &QTextTable{h: h, QTextFrame: newQTextFrame_U(unsafe.Pointer(h))} + return &QTextTable{h: h, QTextFrame: UnsafeNewQTextFrame(unsafe.Pointer(h))} } -func newQTextTable_U(h unsafe.Pointer) *QTextTable { +func UnsafeNewQTextTable(h unsafe.Pointer) *QTextTable { return newQTextTable((*C.QTextTable)(h)) } @@ -174,7 +188,7 @@ func NewQTextTable(doc *QTextDocument) *QTextTable { } func (this *QTextTable) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTextTable_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTextTable_MetaObject(this.h))) } func (this *QTextTable) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qtexttable.h b/qt/gen_qtexttable.h index 7a03bfbe..525fb0d4 100644 --- a/qt/gen_qtexttable.h +++ b/qt/gen_qtexttable.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qthread.cpp b/qt/gen_qthread.cpp index bb456774..132253fa 100644 --- a/qt/gen_qthread.cpp +++ b/qt/gen_qthread.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qthread.h" +#include #include "gen_qthread.h" #include "_cgo_export.h" diff --git a/qt/gen_qthread.go b/qt/gen_qthread.go index b1cb5b30..b73849c9 100644 --- a/qt/gen_qthread.go +++ b/qt/gen_qthread.go @@ -38,14 +38,21 @@ func (this *QThread) cPointer() *C.QThread { return this.h } +func (this *QThread) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQThread(h *C.QThread) *QThread { if h == nil { return nil } - return &QThread{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QThread{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQThread_U(h unsafe.Pointer) *QThread { +func UnsafeNewQThread(h unsafe.Pointer) *QThread { return newQThread((*C.QThread)(h)) } @@ -62,7 +69,7 @@ func NewQThread2(parent *QObject) *QThread { } func (this *QThread) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QThread_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QThread_MetaObject(this.h))) } func (this *QThread) Metacast(param1 string) unsafe.Pointer { @@ -94,7 +101,7 @@ func QThread_CurrentThreadId() unsafe.Pointer { } func QThread_CurrentThread() *QThread { - return newQThread_U(unsafe.Pointer(C.QThread_CurrentThread())) + return UnsafeNewQThread(unsafe.Pointer(C.QThread_CurrentThread())) } func QThread_IdealThreadCount() int { @@ -142,7 +149,7 @@ func (this *QThread) Exit() { } func (this *QThread) EventDispatcher() *QAbstractEventDispatcher { - return newQAbstractEventDispatcher_U(unsafe.Pointer(C.QThread_EventDispatcher(this.h))) + return UnsafeNewQAbstractEventDispatcher(unsafe.Pointer(C.QThread_EventDispatcher(this.h))) } func (this *QThread) SetEventDispatcher(eventDispatcher *QAbstractEventDispatcher) { diff --git a/qt/gen_qthread.h b/qt/gen_qthread.h index 2fc08a82..7141e4b0 100644 --- a/qt/gen_qthread.h +++ b/qt/gen_qthread.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qthreadpool.cpp b/qt/gen_qthreadpool.cpp index d7b199e2..7a00c7d0 100644 --- a/qt/gen_qthreadpool.cpp +++ b/qt/gen_qthreadpool.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qthreadpool.h" +#include #include "gen_qthreadpool.h" #include "_cgo_export.h" diff --git a/qt/gen_qthreadpool.go b/qt/gen_qthreadpool.go index 84912258..2c8e69d2 100644 --- a/qt/gen_qthreadpool.go +++ b/qt/gen_qthreadpool.go @@ -25,14 +25,21 @@ func (this *QThreadPool) cPointer() *C.QThreadPool { return this.h } +func (this *QThreadPool) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQThreadPool(h *C.QThreadPool) *QThreadPool { if h == nil { return nil } - return &QThreadPool{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QThreadPool{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQThreadPool_U(h unsafe.Pointer) *QThreadPool { +func UnsafeNewQThreadPool(h unsafe.Pointer) *QThreadPool { return newQThreadPool((*C.QThreadPool)(h)) } @@ -49,7 +56,7 @@ func NewQThreadPool2(parent *QObject) *QThreadPool { } func (this *QThreadPool) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QThreadPool_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QThreadPool_MetaObject(this.h))) } func (this *QThreadPool) Metacast(param1 string) unsafe.Pointer { @@ -77,7 +84,7 @@ func QThreadPool_TrUtf8(s string) string { } func QThreadPool_GlobalInstance() *QThreadPool { - return newQThreadPool_U(unsafe.Pointer(C.QThreadPool_GlobalInstance())) + return UnsafeNewQThreadPool(unsafe.Pointer(C.QThreadPool_GlobalInstance())) } func (this *QThreadPool) Start(runnable *QRunnable) { diff --git a/qt/gen_qthreadpool.h b/qt/gen_qthreadpool.h index 28ff6621..889ab12e 100644 --- a/qt/gen_qthreadpool.h +++ b/qt/gen_qthreadpool.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qthreadstorage.cpp b/qt/gen_qthreadstorage.cpp index 0dc81734..c144d63d 100644 --- a/qt/gen_qthreadstorage.cpp +++ b/qt/gen_qthreadstorage.cpp @@ -1,5 +1,5 @@ #include -#include "qthreadstorage.h" +#include #include "gen_qthreadstorage.h" #include "_cgo_export.h" diff --git a/qt/gen_qthreadstorage.go b/qt/gen_qthreadstorage.go index ddfc5461..d2a0a70b 100644 --- a/qt/gen_qthreadstorage.go +++ b/qt/gen_qthreadstorage.go @@ -24,6 +24,13 @@ func (this *QThreadStorageData) cPointer() *C.QThreadStorageData { return this.h } +func (this *QThreadStorageData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQThreadStorageData(h *C.QThreadStorageData) *QThreadStorageData { if h == nil { return nil @@ -31,7 +38,7 @@ func newQThreadStorageData(h *C.QThreadStorageData) *QThreadStorageData { return &QThreadStorageData{h: h} } -func newQThreadStorageData_U(h unsafe.Pointer) *QThreadStorageData { +func UnsafeNewQThreadStorageData(h unsafe.Pointer) *QThreadStorageData { return newQThreadStorageData((*C.QThreadStorageData)(h)) } diff --git a/qt/gen_qthreadstorage.h b/qt/gen_qthreadstorage.h index 6b8d8e81..c32ed704 100644 --- a/qt/gen_qthreadstorage.h +++ b/qt/gen_qthreadstorage.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtimeline.cpp b/qt/gen_qtimeline.cpp index e5db9dc6..82c604db 100644 --- a/qt/gen_qtimeline.cpp +++ b/qt/gen_qtimeline.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qtimeline.h" +#include #include "gen_qtimeline.h" #include "_cgo_export.h" diff --git a/qt/gen_qtimeline.go b/qt/gen_qtimeline.go index 848b634e..c9a4749b 100644 --- a/qt/gen_qtimeline.go +++ b/qt/gen_qtimeline.go @@ -51,14 +51,21 @@ func (this *QTimeLine) cPointer() *C.QTimeLine { return this.h } +func (this *QTimeLine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTimeLine(h *C.QTimeLine) *QTimeLine { if h == nil { return nil } - return &QTimeLine{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QTimeLine{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQTimeLine_U(h unsafe.Pointer) *QTimeLine { +func UnsafeNewQTimeLine(h unsafe.Pointer) *QTimeLine { return newQTimeLine((*C.QTimeLine)(h)) } @@ -81,7 +88,7 @@ func NewQTimeLine3(duration int, parent *QObject) *QTimeLine { } func (this *QTimeLine) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTimeLine_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTimeLine_MetaObject(this.h))) } func (this *QTimeLine) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qtimeline.h b/qt/gen_qtimeline.h index a424d865..e27ad8f7 100644 --- a/qt/gen_qtimeline.h +++ b/qt/gen_qtimeline.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtimer.cpp b/qt/gen_qtimer.cpp index 295438e6..0fba022b 100644 --- a/qt/gen_qtimer.cpp +++ b/qt/gen_qtimer.cpp @@ -4,7 +4,7 @@ #include #include #include -#include "qtimer.h" +#include #include "gen_qtimer.h" #include "_cgo_export.h" diff --git a/qt/gen_qtimer.go b/qt/gen_qtimer.go index bc09d160..d1dc29e9 100644 --- a/qt/gen_qtimer.go +++ b/qt/gen_qtimer.go @@ -25,14 +25,21 @@ func (this *QTimer) cPointer() *C.QTimer { return this.h } +func (this *QTimer) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTimer(h *C.QTimer) *QTimer { if h == nil { return nil } - return &QTimer{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QTimer{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQTimer_U(h unsafe.Pointer) *QTimer { +func UnsafeNewQTimer(h unsafe.Pointer) *QTimer { return newQTimer((*C.QTimer)(h)) } @@ -49,7 +56,7 @@ func NewQTimer2(parent *QObject) *QTimer { } func (this *QTimer) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTimer_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTimer_MetaObject(this.h))) } func (this *QTimer) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qtimer.h b/qt/gen_qtimer.h index cbd475bc..c803ad84 100644 --- a/qt/gen_qtimer.h +++ b/qt/gen_qtimer.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtimezone.cpp b/qt/gen_qtimezone.cpp index 84fb402d..b95add98 100644 --- a/qt/gen_qtimezone.cpp +++ b/qt/gen_qtimezone.cpp @@ -7,7 +7,7 @@ #include #include #define WORKAROUND_INNER_CLASS_DEFINITION_QTimeZone__OffsetData -#include "qtimezone.h" +#include #include "gen_qtimezone.h" #include "_cgo_export.h" diff --git a/qt/gen_qtimezone.go b/qt/gen_qtimezone.go index c12a6039..4f6ee7c7 100644 --- a/qt/gen_qtimezone.go +++ b/qt/gen_qtimezone.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -48,6 +49,13 @@ func (this *QTimeZone) cPointer() *C.QTimeZone { return this.h } +func (this *QTimeZone) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTimeZone(h *C.QTimeZone) *QTimeZone { if h == nil { return nil @@ -55,7 +63,7 @@ func newQTimeZone(h *C.QTimeZone) *QTimeZone { return &QTimeZone{h: h} } -func newQTimeZone_U(h unsafe.Pointer) *QTimeZone { +func UnsafeNewQTimeZone(h unsafe.Pointer) *QTimeZone { return newQTimeZone((*C.QTimeZone)(h)) } @@ -79,9 +87,9 @@ func NewQTimeZone3(offsetSeconds int) *QTimeZone { // NewQTimeZone4 constructs a new QTimeZone object. func NewQTimeZone4(zoneId *QByteArray, offsetSeconds int, name string, abbreviation string) *QTimeZone { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - abbreviation_ms := miqt_strdupg(abbreviation) + abbreviation_ms := libmiqt.Strdupg(abbreviation) defer C.free(abbreviation_ms) ret := C.QTimeZone_new4(zoneId.cPointer(), (C.int)(offsetSeconds), (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(abbreviation_ms)) return newQTimeZone(ret) @@ -95,9 +103,9 @@ func NewQTimeZone5(other *QTimeZone) *QTimeZone { // NewQTimeZone6 constructs a new QTimeZone object. func NewQTimeZone6(zoneId *QByteArray, offsetSeconds int, name string, abbreviation string, country QLocale__Country) *QTimeZone { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - abbreviation_ms := miqt_strdupg(abbreviation) + abbreviation_ms := libmiqt.Strdupg(abbreviation) defer C.free(abbreviation_ms) ret := C.QTimeZone_new6(zoneId.cPointer(), (C.int)(offsetSeconds), (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(abbreviation_ms), (C.int)(country)) return newQTimeZone(ret) @@ -105,11 +113,11 @@ func NewQTimeZone6(zoneId *QByteArray, offsetSeconds int, name string, abbreviat // NewQTimeZone7 constructs a new QTimeZone object. func NewQTimeZone7(zoneId *QByteArray, offsetSeconds int, name string, abbreviation string, country QLocale__Country, comment string) *QTimeZone { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - abbreviation_ms := miqt_strdupg(abbreviation) + abbreviation_ms := libmiqt.Strdupg(abbreviation) defer C.free(abbreviation_ms) - comment_ms := miqt_strdupg(comment) + comment_ms := libmiqt.Strdupg(comment) defer C.free(comment_ms) ret := C.QTimeZone_new7(zoneId.cPointer(), (C.int)(offsetSeconds), (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(abbreviation_ms), (C.int)(country), (*C.struct_miqt_string)(comment_ms)) return newQTimeZone(ret) @@ -402,6 +410,13 @@ func (this *QTimeZone__OffsetData) cPointer() *C.QTimeZone__OffsetData { return this.h } +func (this *QTimeZone__OffsetData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTimeZone__OffsetData(h *C.QTimeZone__OffsetData) *QTimeZone__OffsetData { if h == nil { return nil @@ -409,7 +424,7 @@ func newQTimeZone__OffsetData(h *C.QTimeZone__OffsetData) *QTimeZone__OffsetData return &QTimeZone__OffsetData{h: h} } -func newQTimeZone__OffsetData_U(h unsafe.Pointer) *QTimeZone__OffsetData { +func UnsafeNewQTimeZone__OffsetData(h unsafe.Pointer) *QTimeZone__OffsetData { return newQTimeZone__OffsetData((*C.QTimeZone__OffsetData)(h)) } diff --git a/qt/gen_qtimezone.h b/qt/gen_qtimezone.h index c3cf9a04..8a209d12 100644 --- a/qt/gen_qtimezone.h +++ b/qt/gen_qtimezone.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtoolbar.cpp b/qt/gen_qtoolbar.cpp index 54870e16..2e26c2fd 100644 --- a/qt/gen_qtoolbar.cpp +++ b/qt/gen_qtoolbar.cpp @@ -9,7 +9,7 @@ #include #include #include -#include "qtoolbar.h" +#include #include "gen_qtoolbar.h" #include "_cgo_export.h" diff --git a/qt/gen_qtoolbar.go b/qt/gen_qtoolbar.go index 6951aaeb..d812fecd 100644 --- a/qt/gen_qtoolbar.go +++ b/qt/gen_qtoolbar.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,20 +27,27 @@ func (this *QToolBar) cPointer() *C.QToolBar { return this.h } +func (this *QToolBar) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQToolBar(h *C.QToolBar) *QToolBar { if h == nil { return nil } - return &QToolBar{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QToolBar{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQToolBar_U(h unsafe.Pointer) *QToolBar { +func UnsafeNewQToolBar(h unsafe.Pointer) *QToolBar { return newQToolBar((*C.QToolBar)(h)) } // NewQToolBar constructs a new QToolBar object. func NewQToolBar(title string) *QToolBar { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QToolBar_new((*C.struct_miqt_string)(title_ms)) return newQToolBar(ret) @@ -53,7 +61,7 @@ func NewQToolBar2() *QToolBar { // NewQToolBar3 constructs a new QToolBar object. func NewQToolBar3(title string, parent *QWidget) *QToolBar { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) ret := C.QToolBar_new3((*C.struct_miqt_string)(title_ms), parent.cPointer()) return newQToolBar(ret) @@ -66,7 +74,7 @@ func NewQToolBar4(parent *QWidget) *QToolBar { } func (this *QToolBar) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QToolBar_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QToolBar_MetaObject(this.h))) } func (this *QToolBar) Metacast(param1 string) unsafe.Pointer { @@ -126,31 +134,31 @@ func (this *QToolBar) Clear() { } func (this *QToolBar) AddAction(text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QToolBar_AddAction(this.h, (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_AddAction(this.h, (*C.struct_miqt_string)(text_ms)))) } func (this *QToolBar) AddAction2(icon *QIcon, text string) *QAction { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) - return newQAction_U(unsafe.Pointer(C.QToolBar_AddAction2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_AddAction2(this.h, icon.cPointer(), (*C.struct_miqt_string)(text_ms)))) } func (this *QToolBar) AddSeparator() *QAction { - return newQAction_U(unsafe.Pointer(C.QToolBar_AddSeparator(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_AddSeparator(this.h))) } func (this *QToolBar) InsertSeparator(before *QAction) *QAction { - return newQAction_U(unsafe.Pointer(C.QToolBar_InsertSeparator(this.h, before.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_InsertSeparator(this.h, before.cPointer()))) } func (this *QToolBar) AddWidget(widget *QWidget) *QAction { - return newQAction_U(unsafe.Pointer(C.QToolBar_AddWidget(this.h, widget.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_AddWidget(this.h, widget.cPointer()))) } func (this *QToolBar) InsertWidget(before *QAction, widget *QWidget) *QAction { - return newQAction_U(unsafe.Pointer(C.QToolBar_InsertWidget(this.h, before.cPointer(), widget.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_InsertWidget(this.h, before.cPointer(), widget.cPointer()))) } func (this *QToolBar) ActionGeometry(action *QAction) *QRect { @@ -161,15 +169,15 @@ func (this *QToolBar) ActionGeometry(action *QAction) *QRect { } func (this *QToolBar) ActionAt(p *QPoint) *QAction { - return newQAction_U(unsafe.Pointer(C.QToolBar_ActionAt(this.h, p.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_ActionAt(this.h, p.cPointer()))) } func (this *QToolBar) ActionAt2(x int, y int) *QAction { - return newQAction_U(unsafe.Pointer(C.QToolBar_ActionAt2(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_ActionAt2(this.h, (C.int)(x), (C.int)(y)))) } func (this *QToolBar) ToggleViewAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QToolBar_ToggleViewAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolBar_ToggleViewAction(this.h))) } func (this *QToolBar) IconSize() *QSize { @@ -184,7 +192,7 @@ func (this *QToolBar) ToolButtonStyle() ToolButtonStyle { } func (this *QToolBar) WidgetForAction(action *QAction) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QToolBar_WidgetForAction(this.h, action.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QToolBar_WidgetForAction(this.h, action.cPointer()))) } func (this *QToolBar) IsFloatable() bool { @@ -222,7 +230,7 @@ func miqt_exec_callback_QToolBar_ActionTriggered(cb C.intptr_t, action *C.QActio } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(action)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(action)) gofunc(slotval1) } @@ -302,7 +310,7 @@ func miqt_exec_callback_QToolBar_IconSizeChanged(cb C.intptr_t, iconSize *C.QSiz } // Convert all CABI parameters to Go parameters - slotval1 := newQSize_U(unsafe.Pointer(iconSize)) + slotval1 := UnsafeNewQSize(unsafe.Pointer(iconSize)) gofunc(slotval1) } diff --git a/qt/gen_qtoolbar.h b/qt/gen_qtoolbar.h index 7d45a060..c62510f4 100644 --- a/qt/gen_qtoolbar.h +++ b/qt/gen_qtoolbar.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtoolbox.cpp b/qt/gen_qtoolbox.cpp index a406aea8..1da3fe0b 100644 --- a/qt/gen_qtoolbox.cpp +++ b/qt/gen_qtoolbox.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qtoolbox.h" +#include #include "gen_qtoolbox.h" #include "_cgo_export.h" diff --git a/qt/gen_qtoolbox.go b/qt/gen_qtoolbox.go index 9653713c..7050e30a 100644 --- a/qt/gen_qtoolbox.go +++ b/qt/gen_qtoolbox.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QToolBox) cPointer() *C.QToolBox { return this.h } +func (this *QToolBox) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQToolBox(h *C.QToolBox) *QToolBox { if h == nil { return nil } - return &QToolBox{h: h, QFrame: newQFrame_U(unsafe.Pointer(h))} + return &QToolBox{h: h, QFrame: UnsafeNewQFrame(unsafe.Pointer(h))} } -func newQToolBox_U(h unsafe.Pointer) *QToolBox { +func UnsafeNewQToolBox(h unsafe.Pointer) *QToolBox { return newQToolBox((*C.QToolBox)(h)) } @@ -56,7 +64,7 @@ func NewQToolBox3(parent *QWidget, f WindowType) *QToolBox { } func (this *QToolBox) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QToolBox_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QToolBox_MetaObject(this.h))) } func (this *QToolBox) Metacast(param1 string) unsafe.Pointer { @@ -84,25 +92,25 @@ func QToolBox_TrUtf8(s string) string { } func (this *QToolBox) AddItem(widget *QWidget, text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QToolBox_AddItem(this.h, widget.cPointer(), (*C.struct_miqt_string)(text_ms))) } func (this *QToolBox) AddItem2(widget *QWidget, icon *QIcon, text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QToolBox_AddItem2(this.h, widget.cPointer(), icon.cPointer(), (*C.struct_miqt_string)(text_ms))) } func (this *QToolBox) InsertItem(index int, widget *QWidget, text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QToolBox_InsertItem(this.h, (C.int)(index), widget.cPointer(), (*C.struct_miqt_string)(text_ms))) } func (this *QToolBox) InsertItem2(index int, widget *QWidget, icon *QIcon, text string) int { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) return (int)(C.QToolBox_InsertItem2(this.h, (C.int)(index), widget.cPointer(), icon.cPointer(), (*C.struct_miqt_string)(text_ms))) } @@ -120,7 +128,7 @@ func (this *QToolBox) IsItemEnabled(index int) bool { } func (this *QToolBox) SetItemText(index int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QToolBox_SetItemText(this.h, (C.int)(index), (*C.struct_miqt_string)(text_ms)) } @@ -144,7 +152,7 @@ func (this *QToolBox) ItemIcon(index int) *QIcon { } func (this *QToolBox) SetItemToolTip(index int, toolTip string) { - toolTip_ms := miqt_strdupg(toolTip) + toolTip_ms := libmiqt.Strdupg(toolTip) defer C.free(toolTip_ms) C.QToolBox_SetItemToolTip(this.h, (C.int)(index), (*C.struct_miqt_string)(toolTip_ms)) } @@ -161,11 +169,11 @@ func (this *QToolBox) CurrentIndex() int { } func (this *QToolBox) CurrentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QToolBox_CurrentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QToolBox_CurrentWidget(this.h))) } func (this *QToolBox) Widget(index int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QToolBox_Widget(this.h, (C.int)(index)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QToolBox_Widget(this.h, (C.int)(index)))) } func (this *QToolBox) IndexOf(widget *QWidget) int { diff --git a/qt/gen_qtoolbox.h b/qt/gen_qtoolbox.h index 007ed2dc..c5eec96f 100644 --- a/qt/gen_qtoolbox.h +++ b/qt/gen_qtoolbox.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtoolbutton.cpp b/qt/gen_qtoolbutton.cpp index 958ef70d..a341d58b 100644 --- a/qt/gen_qtoolbutton.cpp +++ b/qt/gen_qtoolbutton.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qtoolbutton.h" +#include #include "gen_qtoolbutton.h" #include "_cgo_export.h" diff --git a/qt/gen_qtoolbutton.go b/qt/gen_qtoolbutton.go index 567081fd..5fdd75f6 100644 --- a/qt/gen_qtoolbutton.go +++ b/qt/gen_qtoolbutton.go @@ -34,14 +34,21 @@ func (this *QToolButton) cPointer() *C.QToolButton { return this.h } +func (this *QToolButton) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQToolButton(h *C.QToolButton) *QToolButton { if h == nil { return nil } - return &QToolButton{h: h, QAbstractButton: newQAbstractButton_U(unsafe.Pointer(h))} + return &QToolButton{h: h, QAbstractButton: UnsafeNewQAbstractButton(unsafe.Pointer(h))} } -func newQToolButton_U(h unsafe.Pointer) *QToolButton { +func UnsafeNewQToolButton(h unsafe.Pointer) *QToolButton { return newQToolButton((*C.QToolButton)(h)) } @@ -58,7 +65,7 @@ func NewQToolButton2(parent *QWidget) *QToolButton { } func (this *QToolButton) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QToolButton_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QToolButton_MetaObject(this.h))) } func (this *QToolButton) Metacast(param1 string) unsafe.Pointer { @@ -116,7 +123,7 @@ func (this *QToolButton) SetMenu(menu *QMenu) { } func (this *QToolButton) Menu() *QMenu { - return newQMenu_U(unsafe.Pointer(C.QToolButton_Menu(this.h))) + return UnsafeNewQMenu(unsafe.Pointer(C.QToolButton_Menu(this.h))) } func (this *QToolButton) SetPopupMode(mode QToolButton__ToolButtonPopupMode) { @@ -128,7 +135,7 @@ func (this *QToolButton) PopupMode() QToolButton__ToolButtonPopupMode { } func (this *QToolButton) DefaultAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QToolButton_DefaultAction(this.h))) + return UnsafeNewQAction(unsafe.Pointer(C.QToolButton_DefaultAction(this.h))) } func (this *QToolButton) SetAutoRaise(enable bool) { @@ -166,7 +173,7 @@ func miqt_exec_callback_QToolButton_Triggered(cb C.intptr_t, param1 *C.QAction) } // Convert all CABI parameters to Go parameters - slotval1 := newQAction_U(unsafe.Pointer(param1)) + slotval1 := UnsafeNewQAction(unsafe.Pointer(param1)) gofunc(slotval1) } diff --git a/qt/gen_qtoolbutton.h b/qt/gen_qtoolbutton.h index ddd48377..70ba41ac 100644 --- a/qt/gen_qtoolbutton.h +++ b/qt/gen_qtoolbutton.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtooltip.cpp b/qt/gen_qtooltip.cpp index 109be637..40f43b12 100644 --- a/qt/gen_qtooltip.cpp +++ b/qt/gen_qtooltip.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qtooltip.h" +#include #include "gen_qtooltip.h" #include "_cgo_export.h" diff --git a/qt/gen_qtooltip.go b/qt/gen_qtooltip.go index d76d6e8f..7c19a395 100644 --- a/qt/gen_qtooltip.go +++ b/qt/gen_qtooltip.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QToolTip) cPointer() *C.QToolTip { return this.h } +func (this *QToolTip) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQToolTip(h *C.QToolTip) *QToolTip { if h == nil { return nil @@ -31,24 +39,24 @@ func newQToolTip(h *C.QToolTip) *QToolTip { return &QToolTip{h: h} } -func newQToolTip_U(h unsafe.Pointer) *QToolTip { +func UnsafeNewQToolTip(h unsafe.Pointer) *QToolTip { return newQToolTip((*C.QToolTip)(h)) } func QToolTip_ShowText(pos *QPoint, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QToolTip_ShowText(pos.cPointer(), (*C.struct_miqt_string)(text_ms)) } func QToolTip_ShowText2(pos *QPoint, text string, w *QWidget, rect *QRect) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QToolTip_ShowText2(pos.cPointer(), (*C.struct_miqt_string)(text_ms), w.cPointer(), rect.cPointer()) } func QToolTip_ShowText3(pos *QPoint, text string, w *QWidget, rect *QRect, msecShowTime int) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QToolTip_ShowText3(pos.cPointer(), (*C.struct_miqt_string)(text_ms), w.cPointer(), rect.cPointer(), (C.int)(msecShowTime)) } @@ -91,7 +99,7 @@ func QToolTip_SetFont(font *QFont) { } func QToolTip_ShowText32(pos *QPoint, text string, w *QWidget) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QToolTip_ShowText32(pos.cPointer(), (*C.struct_miqt_string)(text_ms), w.cPointer()) } diff --git a/qt/gen_qtooltip.h b/qt/gen_qtooltip.h index 5a729b98..3ca73776 100644 --- a/qt/gen_qtooltip.h +++ b/qt/gen_qtooltip.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtouchdevice.cpp b/qt/gen_qtouchdevice.cpp index 09c598ff..69fdb534 100644 --- a/qt/gen_qtouchdevice.cpp +++ b/qt/gen_qtouchdevice.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qtouchdevice.h" +#include #include "gen_qtouchdevice.h" #include "_cgo_export.h" diff --git a/qt/gen_qtouchdevice.go b/qt/gen_qtouchdevice.go index a80541c0..c3a57e46 100644 --- a/qt/gen_qtouchdevice.go +++ b/qt/gen_qtouchdevice.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -43,6 +44,13 @@ func (this *QTouchDevice) cPointer() *C.QTouchDevice { return this.h } +func (this *QTouchDevice) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTouchDevice(h *C.QTouchDevice) *QTouchDevice { if h == nil { return nil @@ -50,7 +58,7 @@ func newQTouchDevice(h *C.QTouchDevice) *QTouchDevice { return &QTouchDevice{h: h} } -func newQTouchDevice_U(h unsafe.Pointer) *QTouchDevice { +func UnsafeNewQTouchDevice(h unsafe.Pointer) *QTouchDevice { return newQTouchDevice((*C.QTouchDevice)(h)) } @@ -65,7 +73,7 @@ func QTouchDevice_Devices() []*QTouchDevice { _ret := make([]*QTouchDevice, int(_ma.len)) _outCast := (*[0xffff]*C.QTouchDevice)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTouchDevice_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTouchDevice(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -91,7 +99,7 @@ func (this *QTouchDevice) MaximumTouchPoints() int { } func (this *QTouchDevice) SetName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QTouchDevice_SetName(this.h, (*C.struct_miqt_string)(name_ms)) } diff --git a/qt/gen_qtouchdevice.h b/qt/gen_qtouchdevice.h index c658d9fc..bbb09fba 100644 --- a/qt/gen_qtouchdevice.h +++ b/qt/gen_qtouchdevice.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtransform.cpp b/qt/gen_qtransform.cpp index 97647c42..260a853b 100644 --- a/qt/gen_qtransform.cpp +++ b/qt/gen_qtransform.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qtransform.h" +#include #include "gen_qtransform.h" #include "_cgo_export.h" diff --git a/qt/gen_qtransform.go b/qt/gen_qtransform.go index 780817ce..3bd56dac 100644 --- a/qt/gen_qtransform.go +++ b/qt/gen_qtransform.go @@ -35,6 +35,13 @@ func (this *QTransform) cPointer() *C.QTransform { return this.h } +func (this *QTransform) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTransform(h *C.QTransform) *QTransform { if h == nil { return nil @@ -42,7 +49,7 @@ func newQTransform(h *C.QTransform) *QTransform { return &QTransform{h: h} } -func newQTransform_U(h unsafe.Pointer) *QTransform { +func UnsafeNewQTransform(h unsafe.Pointer) *QTransform { return newQTransform((*C.QTransform)(h)) } @@ -198,23 +205,23 @@ func (this *QTransform) Transposed() *QTransform { } func (this *QTransform) Translate(dx float64, dy float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_Translate(this.h, (C.double)(dx), (C.double)(dy)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_Translate(this.h, (C.double)(dx), (C.double)(dy)))) } func (this *QTransform) Scale(sx float64, sy float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_Scale(this.h, (C.double)(sx), (C.double)(sy)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_Scale(this.h, (C.double)(sx), (C.double)(sy)))) } func (this *QTransform) Shear(sh float64, sv float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_Shear(this.h, (C.double)(sh), (C.double)(sv)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_Shear(this.h, (C.double)(sh), (C.double)(sv)))) } func (this *QTransform) Rotate(a float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_Rotate(this.h, (C.double)(a)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_Rotate(this.h, (C.double)(a)))) } func (this *QTransform) RotateRadians(a float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_RotateRadians(this.h, (C.double)(a)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_RotateRadians(this.h, (C.double)(a)))) } func (this *QTransform) OperatorEqual(param1 *QTransform) bool { @@ -226,7 +233,7 @@ func (this *QTransform) OperatorNotEqual(param1 *QTransform) bool { } func (this *QTransform) OperatorMultiplyAssign(param1 *QTransform) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_OperatorMultiplyAssign(this.h, param1.cPointer()))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_OperatorMultiplyAssign(this.h, param1.cPointer()))) } func (this *QTransform) OperatorMultiply(o *QTransform) *QTransform { @@ -305,23 +312,23 @@ func (this *QTransform) Map3(x float64, y float64, tx *float64, ty *float64) { } func (this *QTransform) ToAffine() *QMatrix { - return newQMatrix_U(unsafe.Pointer(C.QTransform_ToAffine(this.h))) + return UnsafeNewQMatrix(unsafe.Pointer(C.QTransform_ToAffine(this.h))) } func (this *QTransform) OperatorMultiplyAssignWithDiv(div float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_OperatorMultiplyAssignWithDiv(this.h, (C.double)(div)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_OperatorMultiplyAssignWithDiv(this.h, (C.double)(div)))) } func (this *QTransform) OperatorDivideAssign(div float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_OperatorDivideAssign(this.h, (C.double)(div)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_OperatorDivideAssign(this.h, (C.double)(div)))) } func (this *QTransform) OperatorPlusAssign(div float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_OperatorPlusAssign(this.h, (C.double)(div)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_OperatorPlusAssign(this.h, (C.double)(div)))) } func (this *QTransform) OperatorMinusAssign(div float64) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_OperatorMinusAssign(this.h, (C.double)(div)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_OperatorMinusAssign(this.h, (C.double)(div)))) } func QTransform_FromTranslate(dx float64, dy float64) *QTransform { @@ -346,11 +353,11 @@ func (this *QTransform) Inverted1(invertible *bool) *QTransform { } func (this *QTransform) Rotate2(a float64, axis Axis) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_Rotate2(this.h, (C.double)(a), (C.int)(axis)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_Rotate2(this.h, (C.double)(a), (C.int)(axis)))) } func (this *QTransform) RotateRadians2(a float64, axis Axis) *QTransform { - return newQTransform_U(unsafe.Pointer(C.QTransform_RotateRadians2(this.h, (C.double)(a), (C.int)(axis)))) + return UnsafeNewQTransform(unsafe.Pointer(C.QTransform_RotateRadians2(this.h, (C.double)(a), (C.int)(axis)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qtransform.h b/qt/gen_qtransform.h index d736a884..ad07f7e6 100644 --- a/qt/gen_qtransform.h +++ b/qt/gen_qtransform.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtranslator.cpp b/qt/gen_qtranslator.cpp index 58c39b7f..2abeb958 100644 --- a/qt/gen_qtranslator.cpp +++ b/qt/gen_qtranslator.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qtranslator.h" +#include #include "gen_qtranslator.h" #include "_cgo_export.h" diff --git a/qt/gen_qtranslator.go b/qt/gen_qtranslator.go index 4f784dda..38aae842 100644 --- a/qt/gen_qtranslator.go +++ b/qt/gen_qtranslator.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QTranslator) cPointer() *C.QTranslator { return this.h } +func (this *QTranslator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTranslator(h *C.QTranslator) *QTranslator { if h == nil { return nil } - return &QTranslator{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QTranslator{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQTranslator_U(h unsafe.Pointer) *QTranslator { +func UnsafeNewQTranslator(h unsafe.Pointer) *QTranslator { return newQTranslator((*C.QTranslator)(h)) } @@ -49,7 +57,7 @@ func NewQTranslator2(parent *QObject) *QTranslator { } func (this *QTranslator) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTranslator_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTranslator_MetaObject(this.h))) } func (this *QTranslator) Metacast(param1 string) unsafe.Pointer { @@ -106,13 +114,13 @@ func (this *QTranslator) FilePath() string { } func (this *QTranslator) Load(filename string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) return (bool)(C.QTranslator_Load(this.h, (*C.struct_miqt_string)(filename_ms))) } func (this *QTranslator) Load2(locale *QLocale, filename string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) return (bool)(C.QTranslator_Load2(this.h, locale.cPointer(), (*C.struct_miqt_string)(filename_ms))) } @@ -192,67 +200,67 @@ func (this *QTranslator) Translate4(context string, sourceText string, disambigu } func (this *QTranslator) Load22(filename string, directory string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) return (bool)(C.QTranslator_Load22(this.h, (*C.struct_miqt_string)(filename_ms), (*C.struct_miqt_string)(directory_ms))) } func (this *QTranslator) Load32(filename string, directory string, search_delimiters string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) - search_delimiters_ms := miqt_strdupg(search_delimiters) + search_delimiters_ms := libmiqt.Strdupg(search_delimiters) defer C.free(search_delimiters_ms) return (bool)(C.QTranslator_Load32(this.h, (*C.struct_miqt_string)(filename_ms), (*C.struct_miqt_string)(directory_ms), (*C.struct_miqt_string)(search_delimiters_ms))) } func (this *QTranslator) Load4(filename string, directory string, search_delimiters string, suffix string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) - search_delimiters_ms := miqt_strdupg(search_delimiters) + search_delimiters_ms := libmiqt.Strdupg(search_delimiters) defer C.free(search_delimiters_ms) - suffix_ms := miqt_strdupg(suffix) + suffix_ms := libmiqt.Strdupg(suffix) defer C.free(suffix_ms) return (bool)(C.QTranslator_Load4(this.h, (*C.struct_miqt_string)(filename_ms), (*C.struct_miqt_string)(directory_ms), (*C.struct_miqt_string)(search_delimiters_ms), (*C.struct_miqt_string)(suffix_ms))) } func (this *QTranslator) Load33(locale *QLocale, filename string, prefix string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) return (bool)(C.QTranslator_Load33(this.h, locale.cPointer(), (*C.struct_miqt_string)(filename_ms), (*C.struct_miqt_string)(prefix_ms))) } func (this *QTranslator) Load42(locale *QLocale, filename string, prefix string, directory string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) return (bool)(C.QTranslator_Load42(this.h, locale.cPointer(), (*C.struct_miqt_string)(filename_ms), (*C.struct_miqt_string)(prefix_ms), (*C.struct_miqt_string)(directory_ms))) } func (this *QTranslator) Load5(locale *QLocale, filename string, prefix string, directory string, suffix string) bool { - filename_ms := miqt_strdupg(filename) + filename_ms := libmiqt.Strdupg(filename) defer C.free(filename_ms) - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) - suffix_ms := miqt_strdupg(suffix) + suffix_ms := libmiqt.Strdupg(suffix) defer C.free(suffix_ms) return (bool)(C.QTranslator_Load5(this.h, locale.cPointer(), (*C.struct_miqt_string)(filename_ms), (*C.struct_miqt_string)(prefix_ms), (*C.struct_miqt_string)(directory_ms), (*C.struct_miqt_string)(suffix_ms))) } func (this *QTranslator) Load34(data *byte, lenVal int, directory string) bool { - directory_ms := miqt_strdupg(directory) + directory_ms := libmiqt.Strdupg(directory) defer C.free(directory_ms) return (bool)(C.QTranslator_Load34(this.h, (*C.uchar)(unsafe.Pointer(data)), (C.int)(lenVal), (*C.struct_miqt_string)(directory_ms))) } diff --git a/qt/gen_qtranslator.h b/qt/gen_qtranslator.h index 155bc195..551a9793 100644 --- a/qt/gen_qtranslator.h +++ b/qt/gen_qtranslator.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtransposeproxymodel.cpp b/qt/gen_qtransposeproxymodel.cpp index 9a207d5b..9373cf37 100644 --- a/qt/gen_qtransposeproxymodel.cpp +++ b/qt/gen_qtransposeproxymodel.cpp @@ -8,7 +8,7 @@ #include #include #include -#include "qtransposeproxymodel.h" +#include #include "gen_qtransposeproxymodel.h" #include "_cgo_export.h" diff --git a/qt/gen_qtransposeproxymodel.go b/qt/gen_qtransposeproxymodel.go index 6d945344..f6599365 100644 --- a/qt/gen_qtransposeproxymodel.go +++ b/qt/gen_qtransposeproxymodel.go @@ -25,14 +25,21 @@ func (this *QTransposeProxyModel) cPointer() *C.QTransposeProxyModel { return this.h } +func (this *QTransposeProxyModel) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTransposeProxyModel(h *C.QTransposeProxyModel) *QTransposeProxyModel { if h == nil { return nil } - return &QTransposeProxyModel{h: h, QAbstractProxyModel: newQAbstractProxyModel_U(unsafe.Pointer(h))} + return &QTransposeProxyModel{h: h, QAbstractProxyModel: UnsafeNewQAbstractProxyModel(unsafe.Pointer(h))} } -func newQTransposeProxyModel_U(h unsafe.Pointer) *QTransposeProxyModel { +func UnsafeNewQTransposeProxyModel(h unsafe.Pointer) *QTransposeProxyModel { return newQTransposeProxyModel((*C.QTransposeProxyModel)(h)) } @@ -49,7 +56,7 @@ func NewQTransposeProxyModel2(parent *QObject) *QTransposeProxyModel { } func (this *QTransposeProxyModel) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTransposeProxyModel_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTransposeProxyModel_MetaObject(this.h))) } func (this *QTransposeProxyModel) Metacast(param1 string) unsafe.Pointer { diff --git a/qt/gen_qtransposeproxymodel.h b/qt/gen_qtransposeproxymodel.h index f254e896..ad9deaea 100644 --- a/qt/gen_qtransposeproxymodel.h +++ b/qt/gen_qtransposeproxymodel.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtreeview.cpp b/qt/gen_qtreeview.cpp index e5959c1d..d228d2ed 100644 --- a/qt/gen_qtreeview.cpp +++ b/qt/gen_qtreeview.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qtreeview.h" +#include #include "gen_qtreeview.h" #include "_cgo_export.h" diff --git a/qt/gen_qtreeview.go b/qt/gen_qtreeview.go index 39bcc8a7..b5ef984d 100644 --- a/qt/gen_qtreeview.go +++ b/qt/gen_qtreeview.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QTreeView) cPointer() *C.QTreeView { return this.h } +func (this *QTreeView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTreeView(h *C.QTreeView) *QTreeView { if h == nil { return nil } - return &QTreeView{h: h, QAbstractItemView: newQAbstractItemView_U(unsafe.Pointer(h))} + return &QTreeView{h: h, QAbstractItemView: UnsafeNewQAbstractItemView(unsafe.Pointer(h))} } -func newQTreeView_U(h unsafe.Pointer) *QTreeView { +func UnsafeNewQTreeView(h unsafe.Pointer) *QTreeView { return newQTreeView((*C.QTreeView)(h)) } @@ -50,7 +58,7 @@ func NewQTreeView2(parent *QWidget) *QTreeView { } func (this *QTreeView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTreeView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTreeView_MetaObject(this.h))) } func (this *QTreeView) Metacast(param1 string) unsafe.Pointer { @@ -90,7 +98,7 @@ func (this *QTreeView) SetSelectionModel(selectionModel *QItemSelectionModel) { } func (this *QTreeView) Header() *QHeaderView { - return newQHeaderView_U(unsafe.Pointer(C.QTreeView_Header(this.h))) + return UnsafeNewQHeaderView(unsafe.Pointer(C.QTreeView_Header(this.h))) } func (this *QTreeView) SetHeader(header *QHeaderView) { @@ -246,7 +254,7 @@ func (this *QTreeView) TreePosition() int { } func (this *QTreeView) KeyboardSearch(search string) { - search_ms := miqt_strdupg(search) + search_ms := libmiqt.Strdupg(search) defer C.free(search_ms) C.QTreeView_KeyboardSearch(this.h, (*C.struct_miqt_string)(search_ms)) } @@ -314,7 +322,7 @@ func miqt_exec_callback_QTreeView_Expanded(cb C.intptr_t, index *C.QModelIndex) } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } @@ -334,7 +342,7 @@ func miqt_exec_callback_QTreeView_Collapsed(cb C.intptr_t, index *C.QModelIndex) } // Convert all CABI parameters to Go parameters - slotval1 := newQModelIndex_U(unsafe.Pointer(index)) + slotval1 := UnsafeNewQModelIndex(unsafe.Pointer(index)) gofunc(slotval1) } diff --git a/qt/gen_qtreeview.h b/qt/gen_qtreeview.h index 3f7a7458..2bed43bd 100644 --- a/qt/gen_qtreeview.h +++ b/qt/gen_qtreeview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtreewidget.cpp b/qt/gen_qtreewidget.cpp index f47cbdd1..e8fefdcb 100644 --- a/qt/gen_qtreewidget.cpp +++ b/qt/gen_qtreewidget.cpp @@ -16,7 +16,7 @@ #include #include #include -#include "qtreewidget.h" +#include #include "gen_qtreewidget.h" #include "_cgo_export.h" @@ -25,7 +25,7 @@ QTreeWidgetItem* QTreeWidgetItem_new() { } QTreeWidgetItem* QTreeWidgetItem_new2(struct miqt_array* /* of struct miqt_string* */ strings) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -40,7 +40,7 @@ QTreeWidgetItem* QTreeWidgetItem_new3(QTreeWidget* treeview) { } QTreeWidgetItem* QTreeWidgetItem_new4(QTreeWidget* treeview, struct miqt_array* /* of struct miqt_string* */ strings) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -59,7 +59,7 @@ QTreeWidgetItem* QTreeWidgetItem_new6(QTreeWidgetItem* parent) { } QTreeWidgetItem* QTreeWidgetItem_new7(QTreeWidgetItem* parent, struct miqt_array* /* of struct miqt_string* */ strings) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -82,7 +82,7 @@ QTreeWidgetItem* QTreeWidgetItem_new10(int typeVal) { } QTreeWidgetItem* QTreeWidgetItem_new11(struct miqt_array* /* of struct miqt_string* */ strings, int typeVal) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -97,7 +97,7 @@ QTreeWidgetItem* QTreeWidgetItem_new12(QTreeWidget* treeview, int typeVal) { } QTreeWidgetItem* QTreeWidgetItem_new13(QTreeWidget* treeview, struct miqt_array* /* of struct miqt_string* */ strings, int typeVal) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -116,7 +116,7 @@ QTreeWidgetItem* QTreeWidgetItem_new15(QTreeWidgetItem* parent, int typeVal) { } QTreeWidgetItem* QTreeWidgetItem_new16(QTreeWidgetItem* parent, struct miqt_array* /* of struct miqt_string* */ strings, int typeVal) { - QList strings_QList; + QStringList strings_QList; strings_QList.reserve(strings->len); struct miqt_string** strings_arr = static_cast(strings->data); for(size_t i = 0; i < strings->len; ++i) { @@ -378,7 +378,7 @@ QTreeWidgetItem* QTreeWidgetItem_TakeChild(QTreeWidgetItem* self, int index) { } void QTreeWidgetItem_AddChildren(QTreeWidgetItem* self, struct miqt_array* /* of QTreeWidgetItem* */ children) { - QList children_QList; + QList children_QList; children_QList.reserve(children->len); QTreeWidgetItem** children_arr = static_cast(children->data); for(size_t i = 0; i < children->len; ++i) { @@ -388,7 +388,7 @@ void QTreeWidgetItem_AddChildren(QTreeWidgetItem* self, struct miqt_array* /* of } void QTreeWidgetItem_InsertChildren(QTreeWidgetItem* self, int index, struct miqt_array* /* of QTreeWidgetItem* */ children) { - QList children_QList; + QList children_QList; children_QList.reserve(children->len); QTreeWidgetItem** children_arr = static_cast(children->data); for(size_t i = 0; i < children->len; ++i) { @@ -489,7 +489,7 @@ int QTreeWidget_IndexOfTopLevelItem(const QTreeWidget* self, QTreeWidgetItem* it } void QTreeWidget_InsertTopLevelItems(QTreeWidget* self, int index, struct miqt_array* /* of QTreeWidgetItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QTreeWidgetItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -499,7 +499,7 @@ void QTreeWidget_InsertTopLevelItems(QTreeWidget* self, int index, struct miqt_a } void QTreeWidget_AddTopLevelItems(QTreeWidget* self, struct miqt_array* /* of QTreeWidgetItem* */ items) { - QList items_QList; + QList items_QList; items_QList.reserve(items->len); QTreeWidgetItem** items_arr = static_cast(items->data); for(size_t i = 0; i < items->len; ++i) { @@ -517,7 +517,7 @@ void QTreeWidget_SetHeaderItem(QTreeWidget* self, QTreeWidgetItem* item) { } void QTreeWidget_SetHeaderLabels(QTreeWidget* self, struct miqt_array* /* of struct miqt_string* */ labels) { - QList labels_QList; + QStringList labels_QList; labels_QList.reserve(labels->len); struct miqt_string** labels_arr = static_cast(labels->data); for(size_t i = 0; i < labels->len; ++i) { diff --git a/qt/gen_qtreewidget.go b/qt/gen_qtreewidget.go index a204daf7..9fed4211 100644 --- a/qt/gen_qtreewidget.go +++ b/qt/gen_qtreewidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -40,6 +41,13 @@ func (this *QTreeWidgetItem) cPointer() *C.QTreeWidgetItem { return this.h } +func (this *QTreeWidgetItem) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTreeWidgetItem(h *C.QTreeWidgetItem) *QTreeWidgetItem { if h == nil { return nil @@ -47,7 +55,7 @@ func newQTreeWidgetItem(h *C.QTreeWidgetItem) *QTreeWidgetItem { return &QTreeWidgetItem{h: h} } -func newQTreeWidgetItem_U(h unsafe.Pointer) *QTreeWidgetItem { +func UnsafeNewQTreeWidgetItem(h unsafe.Pointer) *QTreeWidgetItem { return newQTreeWidgetItem((*C.QTreeWidgetItem)(h)) } @@ -63,7 +71,7 @@ func NewQTreeWidgetItem2(strings []string) *QTreeWidgetItem { strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -85,7 +93,7 @@ func NewQTreeWidgetItem4(treeview *QTreeWidget, strings []string) *QTreeWidgetIt strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -113,7 +121,7 @@ func NewQTreeWidgetItem7(parent *QTreeWidgetItem, strings []string) *QTreeWidget strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -147,7 +155,7 @@ func NewQTreeWidgetItem11(strings []string, typeVal int) *QTreeWidgetItem { strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -169,7 +177,7 @@ func NewQTreeWidgetItem13(treeview *QTreeWidget, strings []string, typeVal int) strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -197,7 +205,7 @@ func NewQTreeWidgetItem16(parent *QTreeWidgetItem, strings []string, typeVal int strings_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(strings)))) defer C.free(unsafe.Pointer(strings_CArray)) for i := range strings { - strings_i_ms := miqt_strdupg(strings[i]) + strings_i_ms := libmiqt.Strdupg(strings[i]) defer C.free(strings_i_ms) strings_CArray[i] = (*C.struct_miqt_string)(strings_i_ms) } @@ -214,11 +222,11 @@ func NewQTreeWidgetItem17(parent *QTreeWidgetItem, after *QTreeWidgetItem, typeV } func (this *QTreeWidgetItem) Clone() *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidgetItem_Clone(this.h))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidgetItem_Clone(this.h))) } func (this *QTreeWidgetItem) TreeWidget() *QTreeWidget { - return newQTreeWidget_U(unsafe.Pointer(C.QTreeWidgetItem_TreeWidget(this.h))) + return UnsafeNewQTreeWidget(unsafe.Pointer(C.QTreeWidgetItem_TreeWidget(this.h))) } func (this *QTreeWidgetItem) SetSelected(selectVal bool) { @@ -285,7 +293,7 @@ func (this *QTreeWidgetItem) Text(column int) string { } func (this *QTreeWidgetItem) SetText(column int, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QTreeWidgetItem_SetText(this.h, (C.int)(column), (*C.struct_miqt_string)(text_ms)) } @@ -309,7 +317,7 @@ func (this *QTreeWidgetItem) StatusTip(column int) string { } func (this *QTreeWidgetItem) SetStatusTip(column int, statusTip string) { - statusTip_ms := miqt_strdupg(statusTip) + statusTip_ms := libmiqt.Strdupg(statusTip) defer C.free(statusTip_ms) C.QTreeWidgetItem_SetStatusTip(this.h, (C.int)(column), (*C.struct_miqt_string)(statusTip_ms)) } @@ -322,7 +330,7 @@ func (this *QTreeWidgetItem) ToolTip(column int) string { } func (this *QTreeWidgetItem) SetToolTip(column int, toolTip string) { - toolTip_ms := miqt_strdupg(toolTip) + toolTip_ms := libmiqt.Strdupg(toolTip) defer C.free(toolTip_ms) C.QTreeWidgetItem_SetToolTip(this.h, (C.int)(column), (*C.struct_miqt_string)(toolTip_ms)) } @@ -335,7 +343,7 @@ func (this *QTreeWidgetItem) WhatsThis(column int) string { } func (this *QTreeWidgetItem) SetWhatsThis(column int, whatsThis string) { - whatsThis_ms := miqt_strdupg(whatsThis) + whatsThis_ms := libmiqt.Strdupg(whatsThis) defer C.free(whatsThis_ms) C.QTreeWidgetItem_SetWhatsThis(this.h, (C.int)(column), (*C.struct_miqt_string)(whatsThis_ms)) } @@ -450,11 +458,11 @@ func (this *QTreeWidgetItem) OperatorAssign(other *QTreeWidgetItem) { } func (this *QTreeWidgetItem) Parent() *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidgetItem_Parent(this.h))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidgetItem_Parent(this.h))) } func (this *QTreeWidgetItem) Child(index int) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidgetItem_Child(this.h, (C.int)(index)))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidgetItem_Child(this.h, (C.int)(index)))) } func (this *QTreeWidgetItem) ChildCount() int { @@ -482,7 +490,7 @@ func (this *QTreeWidgetItem) RemoveChild(child *QTreeWidgetItem) { } func (this *QTreeWidgetItem) TakeChild(index int) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidgetItem_TakeChild(this.h, (C.int)(index)))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidgetItem_TakeChild(this.h, (C.int)(index)))) } func (this *QTreeWidgetItem) AddChildren(children []*QTreeWidgetItem) { @@ -514,7 +522,7 @@ func (this *QTreeWidgetItem) TakeChildren() []*QTreeWidgetItem { _ret := make([]*QTreeWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QTreeWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTreeWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTreeWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -554,14 +562,21 @@ func (this *QTreeWidget) cPointer() *C.QTreeWidget { return this.h } +func (this *QTreeWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTreeWidget(h *C.QTreeWidget) *QTreeWidget { if h == nil { return nil } - return &QTreeWidget{h: h, QTreeView: newQTreeView_U(unsafe.Pointer(h))} + return &QTreeWidget{h: h, QTreeView: UnsafeNewQTreeView(unsafe.Pointer(h))} } -func newQTreeWidget_U(h unsafe.Pointer) *QTreeWidget { +func UnsafeNewQTreeWidget(h unsafe.Pointer) *QTreeWidget { return newQTreeWidget((*C.QTreeWidget)(h)) } @@ -578,7 +593,7 @@ func NewQTreeWidget2(parent *QWidget) *QTreeWidget { } func (this *QTreeWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QTreeWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QTreeWidget_MetaObject(this.h))) } func (this *QTreeWidget) Metacast(param1 string) unsafe.Pointer { @@ -614,11 +629,11 @@ func (this *QTreeWidget) SetColumnCount(columns int) { } func (this *QTreeWidget) InvisibleRootItem() *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_InvisibleRootItem(this.h))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_InvisibleRootItem(this.h))) } func (this *QTreeWidget) TopLevelItem(index int) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_TopLevelItem(this.h, (C.int)(index)))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_TopLevelItem(this.h, (C.int)(index)))) } func (this *QTreeWidget) TopLevelItemCount() int { @@ -634,7 +649,7 @@ func (this *QTreeWidget) AddTopLevelItem(item *QTreeWidgetItem) { } func (this *QTreeWidget) TakeTopLevelItem(index int) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_TakeTopLevelItem(this.h, (C.int)(index)))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_TakeTopLevelItem(this.h, (C.int)(index)))) } func (this *QTreeWidget) IndexOfTopLevelItem(item *QTreeWidgetItem) int { @@ -666,7 +681,7 @@ func (this *QTreeWidget) AddTopLevelItems(items []*QTreeWidgetItem) { } func (this *QTreeWidget) HeaderItem() *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_HeaderItem(this.h))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_HeaderItem(this.h))) } func (this *QTreeWidget) SetHeaderItem(item *QTreeWidgetItem) { @@ -678,7 +693,7 @@ func (this *QTreeWidget) SetHeaderLabels(labels []string) { labels_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(labels)))) defer C.free(unsafe.Pointer(labels_CArray)) for i := range labels { - labels_i_ms := miqt_strdupg(labels[i]) + labels_i_ms := libmiqt.Strdupg(labels[i]) defer C.free(labels_i_ms) labels_CArray[i] = (*C.struct_miqt_string)(labels_i_ms) } @@ -688,13 +703,13 @@ func (this *QTreeWidget) SetHeaderLabels(labels []string) { } func (this *QTreeWidget) SetHeaderLabel(label string) { - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) C.QTreeWidget_SetHeaderLabel(this.h, (*C.struct_miqt_string)(label_ms)) } func (this *QTreeWidget) CurrentItem() *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_CurrentItem(this.h))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_CurrentItem(this.h))) } func (this *QTreeWidget) CurrentColumn() int { @@ -714,11 +729,11 @@ func (this *QTreeWidget) SetCurrentItem3(item *QTreeWidgetItem, column int, comm } func (this *QTreeWidget) ItemAt(p *QPoint) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_ItemAt(this.h, p.cPointer()))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_ItemAt(this.h, p.cPointer()))) } func (this *QTreeWidget) ItemAt2(x int, y int) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_ItemAt2(this.h, (C.int)(x), (C.int)(y)))) } func (this *QTreeWidget) VisualItemRect(item *QTreeWidgetItem) *QRect { @@ -753,7 +768,7 @@ func (this *QTreeWidget) IsPersistentEditorOpen(item *QTreeWidgetItem) bool { } func (this *QTreeWidget) ItemWidget(item *QTreeWidgetItem, column int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QTreeWidget_ItemWidget(this.h, item.cPointer(), (C.int)(column)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QTreeWidget_ItemWidget(this.h, item.cPointer(), (C.int)(column)))) } func (this *QTreeWidget) SetItemWidget(item *QTreeWidgetItem, column int, widget *QWidget) { @@ -777,20 +792,20 @@ func (this *QTreeWidget) SelectedItems() []*QTreeWidgetItem { _ret := make([]*QTreeWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QTreeWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTreeWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTreeWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QTreeWidget) FindItems(text string, flags MatchFlag) []*QTreeWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QTreeWidget_FindItems(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(flags)) _ret := make([]*QTreeWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QTreeWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTreeWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTreeWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret @@ -821,11 +836,11 @@ func (this *QTreeWidget) SetFirstItemColumnSpanned(item *QTreeWidgetItem, span b } func (this *QTreeWidget) ItemAbove(item *QTreeWidgetItem) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_ItemAbove(this.h, item.cPointer()))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_ItemAbove(this.h, item.cPointer()))) } func (this *QTreeWidget) ItemBelow(item *QTreeWidgetItem) *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidget_ItemBelow(this.h, item.cPointer()))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidget_ItemBelow(this.h, item.cPointer()))) } func (this *QTreeWidget) SetSelectionModel(selectionModel *QItemSelectionModel) { @@ -863,7 +878,7 @@ func miqt_exec_callback_QTreeWidget_ItemPressed(cb C.intptr_t, item *C.QTreeWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) slotval2 := (int)(column) gofunc(slotval1, slotval2) @@ -884,7 +899,7 @@ func miqt_exec_callback_QTreeWidget_ItemClicked(cb C.intptr_t, item *C.QTreeWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) slotval2 := (int)(column) gofunc(slotval1, slotval2) @@ -905,7 +920,7 @@ func miqt_exec_callback_QTreeWidget_ItemDoubleClicked(cb C.intptr_t, item *C.QTr } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) slotval2 := (int)(column) gofunc(slotval1, slotval2) @@ -926,7 +941,7 @@ func miqt_exec_callback_QTreeWidget_ItemActivated(cb C.intptr_t, item *C.QTreeWi } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) slotval2 := (int)(column) gofunc(slotval1, slotval2) @@ -947,7 +962,7 @@ func miqt_exec_callback_QTreeWidget_ItemEntered(cb C.intptr_t, item *C.QTreeWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) slotval2 := (int)(column) gofunc(slotval1, slotval2) @@ -968,7 +983,7 @@ func miqt_exec_callback_QTreeWidget_ItemChanged(cb C.intptr_t, item *C.QTreeWidg } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) slotval2 := (int)(column) gofunc(slotval1, slotval2) @@ -989,7 +1004,7 @@ func miqt_exec_callback_QTreeWidget_ItemExpanded(cb C.intptr_t, item *C.QTreeWid } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -1009,7 +1024,7 @@ func miqt_exec_callback_QTreeWidget_ItemCollapsed(cb C.intptr_t, item *C.QTreeWi } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(item)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(item)) gofunc(slotval1) } @@ -1029,8 +1044,8 @@ func miqt_exec_callback_QTreeWidget_CurrentItemChanged(cb C.intptr_t, current *C } // Convert all CABI parameters to Go parameters - slotval1 := newQTreeWidgetItem_U(unsafe.Pointer(current)) - slotval2 := newQTreeWidgetItem_U(unsafe.Pointer(previous)) + slotval1 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(current)) + slotval2 := UnsafeNewQTreeWidgetItem(unsafe.Pointer(previous)) gofunc(slotval1, slotval2) } @@ -1113,13 +1128,13 @@ func (this *QTreeWidget) IsPersistentEditorOpen2(item *QTreeWidgetItem, column i } func (this *QTreeWidget) FindItems3(text string, flags MatchFlag, column int) []*QTreeWidgetItem { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) var _ma *C.struct_miqt_array = C.QTreeWidget_FindItems3(this.h, (*C.struct_miqt_string)(text_ms), (C.int)(flags), (C.int)(column)) _ret := make([]*QTreeWidgetItem, int(_ma.len)) _outCast := (*[0xffff]*C.QTreeWidgetItem)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQTreeWidgetItem_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQTreeWidgetItem(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret diff --git a/qt/gen_qtreewidget.h b/qt/gen_qtreewidget.h index 44b39c63..fcc6680b 100644 --- a/qt/gen_qtreewidget.h +++ b/qt/gen_qtreewidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qtreewidgetitemiterator.cpp b/qt/gen_qtreewidgetitemiterator.cpp index 60db7b65..03cda8d7 100644 --- a/qt/gen_qtreewidgetitemiterator.cpp +++ b/qt/gen_qtreewidgetitemiterator.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "qtreewidgetitemiterator.h" +#include #include "gen_qtreewidgetitemiterator.h" #include "_cgo_export.h" diff --git a/qt/gen_qtreewidgetitemiterator.go b/qt/gen_qtreewidgetitemiterator.go index 065d3e3a..6a4a86c5 100644 --- a/qt/gen_qtreewidgetitemiterator.go +++ b/qt/gen_qtreewidgetitemiterator.go @@ -49,6 +49,13 @@ func (this *QTreeWidgetItemIterator) cPointer() *C.QTreeWidgetItemIterator { return this.h } +func (this *QTreeWidgetItemIterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQTreeWidgetItemIterator(h *C.QTreeWidgetItemIterator) *QTreeWidgetItemIterator { if h == nil { return nil @@ -56,7 +63,7 @@ func newQTreeWidgetItemIterator(h *C.QTreeWidgetItemIterator) *QTreeWidgetItemIt return &QTreeWidgetItemIterator{h: h} } -func newQTreeWidgetItemIterator_U(h unsafe.Pointer) *QTreeWidgetItemIterator { +func UnsafeNewQTreeWidgetItemIterator(h unsafe.Pointer) *QTreeWidgetItemIterator { return newQTreeWidgetItemIterator((*C.QTreeWidgetItemIterator)(h)) } @@ -95,7 +102,7 @@ func (this *QTreeWidgetItemIterator) OperatorAssign(it *QTreeWidgetItemIterator) } func (this *QTreeWidgetItemIterator) OperatorPlusPlus() *QTreeWidgetItemIterator { - return newQTreeWidgetItemIterator_U(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorPlusPlus(this.h))) + return UnsafeNewQTreeWidgetItemIterator(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorPlusPlus(this.h))) } func (this *QTreeWidgetItemIterator) OperatorPlusPlusWithInt(param1 int) *QTreeWidgetItemIterator { @@ -106,11 +113,11 @@ func (this *QTreeWidgetItemIterator) OperatorPlusPlusWithInt(param1 int) *QTreeW } func (this *QTreeWidgetItemIterator) OperatorPlusAssign(n int) *QTreeWidgetItemIterator { - return newQTreeWidgetItemIterator_U(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorPlusAssign(this.h, (C.int)(n)))) + return UnsafeNewQTreeWidgetItemIterator(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorPlusAssign(this.h, (C.int)(n)))) } func (this *QTreeWidgetItemIterator) OperatorMinusMinus() *QTreeWidgetItemIterator { - return newQTreeWidgetItemIterator_U(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorMinusMinus(this.h))) + return UnsafeNewQTreeWidgetItemIterator(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorMinusMinus(this.h))) } func (this *QTreeWidgetItemIterator) OperatorMinusMinusWithInt(param1 int) *QTreeWidgetItemIterator { @@ -121,11 +128,11 @@ func (this *QTreeWidgetItemIterator) OperatorMinusMinusWithInt(param1 int) *QTre } func (this *QTreeWidgetItemIterator) OperatorMinusAssign(n int) *QTreeWidgetItemIterator { - return newQTreeWidgetItemIterator_U(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorMinusAssign(this.h, (C.int)(n)))) + return UnsafeNewQTreeWidgetItemIterator(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorMinusAssign(this.h, (C.int)(n)))) } func (this *QTreeWidgetItemIterator) OperatorMultiply() *QTreeWidgetItem { - return newQTreeWidgetItem_U(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorMultiply(this.h))) + return UnsafeNewQTreeWidgetItem(unsafe.Pointer(C.QTreeWidgetItemIterator_OperatorMultiply(this.h))) } // Delete this object from C++ memory. diff --git a/qt/gen_qtreewidgetitemiterator.h b/qt/gen_qtreewidgetitemiterator.h index 68de3210..90b67f44 100644 --- a/qt/gen_qtreewidgetitemiterator.h +++ b/qt/gen_qtreewidgetitemiterator.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qundogroup.cpp b/qt/gen_qundogroup.cpp index d8195847..14af56d4 100644 --- a/qt/gen_qundogroup.cpp +++ b/qt/gen_qundogroup.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qundogroup.h" +#include #include "gen_qundogroup.h" #include "_cgo_export.h" diff --git a/qt/gen_qundogroup.go b/qt/gen_qundogroup.go index 403b7d7a..ca2626a7 100644 --- a/qt/gen_qundogroup.go +++ b/qt/gen_qundogroup.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -26,14 +27,21 @@ func (this *QUndoGroup) cPointer() *C.QUndoGroup { return this.h } +func (this *QUndoGroup) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQUndoGroup(h *C.QUndoGroup) *QUndoGroup { if h == nil { return nil } - return &QUndoGroup{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QUndoGroup{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQUndoGroup_U(h unsafe.Pointer) *QUndoGroup { +func UnsafeNewQUndoGroup(h unsafe.Pointer) *QUndoGroup { return newQUndoGroup((*C.QUndoGroup)(h)) } @@ -50,7 +58,7 @@ func NewQUndoGroup2(parent *QObject) *QUndoGroup { } func (this *QUndoGroup) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QUndoGroup_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QUndoGroup_MetaObject(this.h))) } func (this *QUndoGroup) Metacast(param1 string) unsafe.Pointer { @@ -90,22 +98,22 @@ func (this *QUndoGroup) Stacks() []*QUndoStack { _ret := make([]*QUndoStack, int(_ma.len)) _outCast := (*[0xffff]*C.QUndoStack)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQUndoStack_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQUndoStack(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QUndoGroup) ActiveStack() *QUndoStack { - return newQUndoStack_U(unsafe.Pointer(C.QUndoGroup_ActiveStack(this.h))) + return UnsafeNewQUndoStack(unsafe.Pointer(C.QUndoGroup_ActiveStack(this.h))) } func (this *QUndoGroup) CreateUndoAction(parent *QObject) *QAction { - return newQAction_U(unsafe.Pointer(C.QUndoGroup_CreateUndoAction(this.h, parent.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoGroup_CreateUndoAction(this.h, parent.cPointer()))) } func (this *QUndoGroup) CreateRedoAction(parent *QObject) *QAction { - return newQAction_U(unsafe.Pointer(C.QUndoGroup_CreateRedoAction(this.h, parent.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoGroup_CreateRedoAction(this.h, parent.cPointer()))) } func (this *QUndoGroup) CanUndo() bool { @@ -161,7 +169,7 @@ func miqt_exec_callback_QUndoGroup_ActiveStackChanged(cb C.intptr_t, stack *C.QU } // Convert all CABI parameters to Go parameters - slotval1 := newQUndoStack_U(unsafe.Pointer(stack)) + slotval1 := UnsafeNewQUndoStack(unsafe.Pointer(stack)) gofunc(slotval1) } @@ -247,7 +255,7 @@ func miqt_exec_callback_QUndoGroup_CanRedoChanged(cb C.intptr_t, canRedo C.bool) } func (this *QUndoGroup) UndoTextChanged(undoText string) { - undoText_ms := miqt_strdupg(undoText) + undoText_ms := libmiqt.Strdupg(undoText) defer C.free(undoText_ms) C.QUndoGroup_UndoTextChanged(this.h, (*C.struct_miqt_string)(undoText_ms)) } @@ -272,7 +280,7 @@ func miqt_exec_callback_QUndoGroup_UndoTextChanged(cb C.intptr_t, undoText *C.st } func (this *QUndoGroup) RedoTextChanged(redoText string) { - redoText_ms := miqt_strdupg(redoText) + redoText_ms := libmiqt.Strdupg(redoText) defer C.free(redoText_ms) C.QUndoGroup_RedoTextChanged(this.h, (*C.struct_miqt_string)(redoText_ms)) } @@ -341,15 +349,15 @@ func QUndoGroup_TrUtf83(s string, c string, n int) string { } func (this *QUndoGroup) CreateUndoAction2(parent *QObject, prefix string) *QAction { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - return newQAction_U(unsafe.Pointer(C.QUndoGroup_CreateUndoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoGroup_CreateUndoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) } func (this *QUndoGroup) CreateRedoAction2(parent *QObject, prefix string) *QAction { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - return newQAction_U(unsafe.Pointer(C.QUndoGroup_CreateRedoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoGroup_CreateRedoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qundogroup.h b/qt/gen_qundogroup.h index de24e389..f2a123dc 100644 --- a/qt/gen_qundogroup.h +++ b/qt/gen_qundogroup.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qundostack.cpp b/qt/gen_qundostack.cpp index eb6cfb85..432507c3 100644 --- a/qt/gen_qundostack.cpp +++ b/qt/gen_qundostack.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qundostack.h" +#include #include "gen_qundostack.h" #include "_cgo_export.h" diff --git a/qt/gen_qundostack.go b/qt/gen_qundostack.go index 1b2d0b33..1eaf79c5 100644 --- a/qt/gen_qundostack.go +++ b/qt/gen_qundostack.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -25,6 +26,13 @@ func (this *QUndoCommand) cPointer() *C.QUndoCommand { return this.h } +func (this *QUndoCommand) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQUndoCommand(h *C.QUndoCommand) *QUndoCommand { if h == nil { return nil @@ -32,7 +40,7 @@ func newQUndoCommand(h *C.QUndoCommand) *QUndoCommand { return &QUndoCommand{h: h} } -func newQUndoCommand_U(h unsafe.Pointer) *QUndoCommand { +func UnsafeNewQUndoCommand(h unsafe.Pointer) *QUndoCommand { return newQUndoCommand((*C.QUndoCommand)(h)) } @@ -44,7 +52,7 @@ func NewQUndoCommand() *QUndoCommand { // NewQUndoCommand2 constructs a new QUndoCommand object. func NewQUndoCommand2(text string) *QUndoCommand { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QUndoCommand_new2((*C.struct_miqt_string)(text_ms)) return newQUndoCommand(ret) @@ -58,7 +66,7 @@ func NewQUndoCommand3(parent *QUndoCommand) *QUndoCommand { // NewQUndoCommand4 constructs a new QUndoCommand object. func NewQUndoCommand4(text string, parent *QUndoCommand) *QUndoCommand { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) ret := C.QUndoCommand_new4((*C.struct_miqt_string)(text_ms), parent.cPointer()) return newQUndoCommand(ret) @@ -87,7 +95,7 @@ func (this *QUndoCommand) ActionText() string { } func (this *QUndoCommand) SetText(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QUndoCommand_SetText(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -113,7 +121,7 @@ func (this *QUndoCommand) ChildCount() int { } func (this *QUndoCommand) Child(index int) *QUndoCommand { - return newQUndoCommand_U(unsafe.Pointer(C.QUndoCommand_Child(this.h, (C.int)(index)))) + return UnsafeNewQUndoCommand(unsafe.Pointer(C.QUndoCommand_Child(this.h, (C.int)(index)))) } // Delete this object from C++ memory. @@ -142,14 +150,21 @@ func (this *QUndoStack) cPointer() *C.QUndoStack { return this.h } +func (this *QUndoStack) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQUndoStack(h *C.QUndoStack) *QUndoStack { if h == nil { return nil } - return &QUndoStack{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QUndoStack{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQUndoStack_U(h unsafe.Pointer) *QUndoStack { +func UnsafeNewQUndoStack(h unsafe.Pointer) *QUndoStack { return newQUndoStack((*C.QUndoStack)(h)) } @@ -166,7 +181,7 @@ func NewQUndoStack2(parent *QObject) *QUndoStack { } func (this *QUndoStack) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QUndoStack_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QUndoStack_MetaObject(this.h))) } func (this *QUndoStack) Metacast(param1 string) unsafe.Pointer { @@ -239,11 +254,11 @@ func (this *QUndoStack) Text(idx int) string { } func (this *QUndoStack) CreateUndoAction(parent *QObject) *QAction { - return newQAction_U(unsafe.Pointer(C.QUndoStack_CreateUndoAction(this.h, parent.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoStack_CreateUndoAction(this.h, parent.cPointer()))) } func (this *QUndoStack) CreateRedoAction(parent *QObject) *QAction { - return newQAction_U(unsafe.Pointer(C.QUndoStack_CreateRedoAction(this.h, parent.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoStack_CreateRedoAction(this.h, parent.cPointer()))) } func (this *QUndoStack) IsActive() bool { @@ -259,7 +274,7 @@ func (this *QUndoStack) CleanIndex() int { } func (this *QUndoStack) BeginMacro(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QUndoStack_BeginMacro(this.h, (*C.struct_miqt_string)(text_ms)) } @@ -277,7 +292,7 @@ func (this *QUndoStack) UndoLimit() int { } func (this *QUndoStack) Command(index int) *QUndoCommand { - return newQUndoCommand_U(unsafe.Pointer(C.QUndoStack_Command(this.h, (C.int)(index)))) + return UnsafeNewQUndoCommand(unsafe.Pointer(C.QUndoStack_Command(this.h, (C.int)(index)))) } func (this *QUndoStack) SetClean() { @@ -385,7 +400,7 @@ func miqt_exec_callback_QUndoStack_CanRedoChanged(cb C.intptr_t, canRedo C.bool) } func (this *QUndoStack) UndoTextChanged(undoText string) { - undoText_ms := miqt_strdupg(undoText) + undoText_ms := libmiqt.Strdupg(undoText) defer C.free(undoText_ms) C.QUndoStack_UndoTextChanged(this.h, (*C.struct_miqt_string)(undoText_ms)) } @@ -410,7 +425,7 @@ func miqt_exec_callback_QUndoStack_UndoTextChanged(cb C.intptr_t, undoText *C.st } func (this *QUndoStack) RedoTextChanged(redoText string) { - redoText_ms := miqt_strdupg(redoText) + redoText_ms := libmiqt.Strdupg(redoText) defer C.free(redoText_ms) C.QUndoStack_RedoTextChanged(this.h, (*C.struct_miqt_string)(redoText_ms)) } @@ -479,15 +494,15 @@ func QUndoStack_TrUtf83(s string, c string, n int) string { } func (this *QUndoStack) CreateUndoAction2(parent *QObject, prefix string) *QAction { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - return newQAction_U(unsafe.Pointer(C.QUndoStack_CreateUndoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoStack_CreateUndoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) } func (this *QUndoStack) CreateRedoAction2(parent *QObject, prefix string) *QAction { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - return newQAction_U(unsafe.Pointer(C.QUndoStack_CreateRedoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) + return UnsafeNewQAction(unsafe.Pointer(C.QUndoStack_CreateRedoAction2(this.h, parent.cPointer(), (*C.struct_miqt_string)(prefix_ms)))) } func (this *QUndoStack) SetActive1(active bool) { diff --git a/qt/gen_qundostack.h b/qt/gen_qundostack.h index e7f9109d..1b90eb64 100644 --- a/qt/gen_qundostack.h +++ b/qt/gen_qundostack.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qundoview.cpp b/qt/gen_qundoview.cpp index 5b9e3ac3..20acf145 100644 --- a/qt/gen_qundoview.cpp +++ b/qt/gen_qundoview.cpp @@ -7,7 +7,7 @@ #include #include #include -#include "qundoview.h" +#include #include "gen_qundoview.h" #include "_cgo_export.h" diff --git a/qt/gen_qundoview.go b/qt/gen_qundoview.go index d2f95432..6c666b82 100644 --- a/qt/gen_qundoview.go +++ b/qt/gen_qundoview.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -25,14 +26,21 @@ func (this *QUndoView) cPointer() *C.QUndoView { return this.h } +func (this *QUndoView) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQUndoView(h *C.QUndoView) *QUndoView { if h == nil { return nil } - return &QUndoView{h: h, QListView: newQListView_U(unsafe.Pointer(h))} + return &QUndoView{h: h, QListView: UnsafeNewQListView(unsafe.Pointer(h))} } -func newQUndoView_U(h unsafe.Pointer) *QUndoView { +func UnsafeNewQUndoView(h unsafe.Pointer) *QUndoView { return newQUndoView((*C.QUndoView)(h)) } @@ -73,7 +81,7 @@ func NewQUndoView6(group *QUndoGroup, parent *QWidget) *QUndoView { } func (this *QUndoView) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QUndoView_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QUndoView_MetaObject(this.h))) } func (this *QUndoView) Metacast(param1 string) unsafe.Pointer { @@ -101,15 +109,15 @@ func QUndoView_TrUtf8(s string) string { } func (this *QUndoView) Stack() *QUndoStack { - return newQUndoStack_U(unsafe.Pointer(C.QUndoView_Stack(this.h))) + return UnsafeNewQUndoStack(unsafe.Pointer(C.QUndoView_Stack(this.h))) } func (this *QUndoView) Group() *QUndoGroup { - return newQUndoGroup_U(unsafe.Pointer(C.QUndoView_Group(this.h))) + return UnsafeNewQUndoGroup(unsafe.Pointer(C.QUndoView_Group(this.h))) } func (this *QUndoView) SetEmptyLabel(label string) { - label_ms := miqt_strdupg(label) + label_ms := libmiqt.Strdupg(label) defer C.free(label_ms) C.QUndoView_SetEmptyLabel(this.h, (*C.struct_miqt_string)(label_ms)) } diff --git a/qt/gen_qundoview.h b/qt/gen_qundoview.h index de18f64a..189155b9 100644 --- a/qt/gen_qundoview.h +++ b/qt/gen_qundoview.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qurl.cpp b/qt/gen_qurl.cpp index 92299b0f..032f62f0 100644 --- a/qt/gen_qurl.cpp +++ b/qt/gen_qurl.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qurl.h" +#include #include "gen_qurl.h" #include "_cgo_export.h" @@ -357,7 +357,7 @@ struct miqt_array* QUrl_ToStringList(struct miqt_array* /* of QUrl* */ uris) { } struct miqt_array* QUrl_FromStringList(struct miqt_array* /* of struct miqt_string* */ uris) { - QList uris_QList; + QStringList uris_QList; uris_QList.reserve(uris->len); struct miqt_string** uris_arr = static_cast(uris->data); for(size_t i = 0; i < uris->len; ++i) { @@ -377,7 +377,7 @@ struct miqt_array* QUrl_FromStringList(struct miqt_array* /* of struct miqt_stri } void QUrl_SetIdnWhitelist(struct miqt_array* /* of struct miqt_string* */ idnWhitelist) { - QList idnWhitelist_QList; + QStringList idnWhitelist_QList; idnWhitelist_QList.reserve(idnWhitelist->len); struct miqt_string** idnWhitelist_arr = static_cast(idnWhitelist->data); for(size_t i = 0; i < idnWhitelist->len; ++i) { @@ -527,7 +527,7 @@ QByteArray* QUrl_ToPercentEncoding3(struct miqt_string* param1, QByteArray* excl } struct miqt_array* QUrl_FromStringList2(struct miqt_array* /* of struct miqt_string* */ uris, int mode) { - QList uris_QList; + QStringList uris_QList; uris_QList.reserve(uris->len); struct miqt_string** uris_arr = static_cast(uris->data); for(size_t i = 0; i < uris->len; ++i) { diff --git a/qt/gen_qurl.go b/qt/gen_qurl.go index 7ee26d5d..6bb1c653 100644 --- a/qt/gen_qurl.go +++ b/qt/gen_qurl.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -70,6 +71,13 @@ func (this *QUrl) cPointer() *C.QUrl { return this.h } +func (this *QUrl) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQUrl(h *C.QUrl) *QUrl { if h == nil { return nil @@ -77,7 +85,7 @@ func newQUrl(h *C.QUrl) *QUrl { return &QUrl{h: h} } -func newQUrl_U(h unsafe.Pointer) *QUrl { +func UnsafeNewQUrl(h unsafe.Pointer) *QUrl { return newQUrl((*C.QUrl)(h)) } @@ -95,7 +103,7 @@ func NewQUrl2(copyVal *QUrl) *QUrl { // NewQUrl3 constructs a new QUrl object. func NewQUrl3(url string) *QUrl { - url_ms := miqt_strdupg(url) + url_ms := libmiqt.Strdupg(url) defer C.free(url_ms) ret := C.QUrl_new3((*C.struct_miqt_string)(url_ms)) return newQUrl(ret) @@ -103,7 +111,7 @@ func NewQUrl3(url string) *QUrl { // NewQUrl4 constructs a new QUrl object. func NewQUrl4(url string, mode QUrl__ParsingMode) *QUrl { - url_ms := miqt_strdupg(url) + url_ms := libmiqt.Strdupg(url) defer C.free(url_ms) ret := C.QUrl_new4((*C.struct_miqt_string)(url_ms), (C.int)(mode)) return newQUrl(ret) @@ -114,7 +122,7 @@ func (this *QUrl) OperatorAssign(copyVal *QUrl) { } func (this *QUrl) OperatorAssignWithUrl(url string) { - url_ms := miqt_strdupg(url) + url_ms := libmiqt.Strdupg(url) defer C.free(url_ms) C.QUrl_OperatorAssignWithUrl(this.h, (*C.struct_miqt_string)(url_ms)) } @@ -124,7 +132,7 @@ func (this *QUrl) Swap(other *QUrl) { } func (this *QUrl) SetUrl(url string) { - url_ms := miqt_strdupg(url) + url_ms := libmiqt.Strdupg(url) defer C.free(url_ms) C.QUrl_SetUrl(this.h, (*C.struct_miqt_string)(url_ms)) } @@ -165,7 +173,7 @@ func QUrl_FromEncoded(url *QByteArray) *QUrl { } func QUrl_FromUserInput(userInput string) *QUrl { - userInput_ms := miqt_strdupg(userInput) + userInput_ms := libmiqt.Strdupg(userInput) defer C.free(userInput_ms) _ret := C.QUrl_FromUserInput((*C.struct_miqt_string)(userInput_ms)) _goptr := newQUrl(_ret) @@ -174,9 +182,9 @@ func QUrl_FromUserInput(userInput string) *QUrl { } func QUrl_FromUserInput2(userInput string, workingDirectory string) *QUrl { - userInput_ms := miqt_strdupg(userInput) + userInput_ms := libmiqt.Strdupg(userInput) defer C.free(userInput_ms) - workingDirectory_ms := miqt_strdupg(workingDirectory) + workingDirectory_ms := libmiqt.Strdupg(workingDirectory) defer C.free(workingDirectory_ms) _ret := C.QUrl_FromUserInput2((*C.struct_miqt_string)(userInput_ms), (*C.struct_miqt_string)(workingDirectory_ms)) _goptr := newQUrl(_ret) @@ -204,7 +212,7 @@ func (this *QUrl) Clear() { } func (this *QUrl) SetScheme(scheme string) { - scheme_ms := miqt_strdupg(scheme) + scheme_ms := libmiqt.Strdupg(scheme) defer C.free(scheme_ms) C.QUrl_SetScheme(this.h, (*C.struct_miqt_string)(scheme_ms)) } @@ -217,7 +225,7 @@ func (this *QUrl) Scheme() string { } func (this *QUrl) SetAuthority(authority string) { - authority_ms := miqt_strdupg(authority) + authority_ms := libmiqt.Strdupg(authority) defer C.free(authority_ms) C.QUrl_SetAuthority(this.h, (*C.struct_miqt_string)(authority_ms)) } @@ -230,7 +238,7 @@ func (this *QUrl) Authority() string { } func (this *QUrl) SetUserInfo(userInfo string) { - userInfo_ms := miqt_strdupg(userInfo) + userInfo_ms := libmiqt.Strdupg(userInfo) defer C.free(userInfo_ms) C.QUrl_SetUserInfo(this.h, (*C.struct_miqt_string)(userInfo_ms)) } @@ -243,7 +251,7 @@ func (this *QUrl) UserInfo() string { } func (this *QUrl) SetUserName(userName string) { - userName_ms := miqt_strdupg(userName) + userName_ms := libmiqt.Strdupg(userName) defer C.free(userName_ms) C.QUrl_SetUserName(this.h, (*C.struct_miqt_string)(userName_ms)) } @@ -256,7 +264,7 @@ func (this *QUrl) UserName() string { } func (this *QUrl) SetPassword(password string) { - password_ms := miqt_strdupg(password) + password_ms := libmiqt.Strdupg(password) defer C.free(password_ms) C.QUrl_SetPassword(this.h, (*C.struct_miqt_string)(password_ms)) } @@ -269,7 +277,7 @@ func (this *QUrl) Password() string { } func (this *QUrl) SetHost(host string) { - host_ms := miqt_strdupg(host) + host_ms := libmiqt.Strdupg(host) defer C.free(host_ms) C.QUrl_SetHost(this.h, (*C.struct_miqt_string)(host_ms)) } @@ -297,7 +305,7 @@ func (this *QUrl) Port() int { } func (this *QUrl) SetPath(path string) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QUrl_SetPath(this.h, (*C.struct_miqt_string)(path_ms)) } @@ -321,7 +329,7 @@ func (this *QUrl) HasQuery() bool { } func (this *QUrl) SetQuery(query string) { - query_ms := miqt_strdupg(query) + query_ms := libmiqt.Strdupg(query) defer C.free(query_ms) C.QUrl_SetQuery(this.h, (*C.struct_miqt_string)(query_ms)) } @@ -349,7 +357,7 @@ func (this *QUrl) Fragment() string { } func (this *QUrl) SetFragment(fragment string) { - fragment_ms := miqt_strdupg(fragment) + fragment_ms := libmiqt.Strdupg(fragment) defer C.free(fragment_ms) C.QUrl_SetFragment(this.h, (*C.struct_miqt_string)(fragment_ms)) } @@ -374,7 +382,7 @@ func (this *QUrl) IsLocalFile() bool { } func QUrl_FromLocalFile(localfile string) *QUrl { - localfile_ms := miqt_strdupg(localfile) + localfile_ms := libmiqt.Strdupg(localfile) defer C.free(localfile_ms) _ret := C.QUrl_FromLocalFile((*C.struct_miqt_string)(localfile_ms)) _goptr := newQUrl(_ret) @@ -417,7 +425,7 @@ func QUrl_FromPercentEncoding(param1 *QByteArray) string { } func QUrl_ToPercentEncoding(param1 string) *QByteArray { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) _ret := C.QUrl_ToPercentEncoding((*C.struct_miqt_string)(param1_ms)) _goptr := newQByteArray(_ret) @@ -433,7 +441,7 @@ func QUrl_FromAce(param1 *QByteArray) string { } func QUrl_ToAce(param1 string) *QByteArray { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) _ret := C.QUrl_ToAce((*C.struct_miqt_string)(param1_ms)) _goptr := newQByteArray(_ret) @@ -482,7 +490,7 @@ func QUrl_FromStringList(uris []string) []QUrl { uris_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(uris)))) defer C.free(unsafe.Pointer(uris_CArray)) for i := range uris { - uris_i_ms := miqt_strdupg(uris[i]) + uris_i_ms := libmiqt.Strdupg(uris[i]) defer C.free(uris_i_ms) uris_CArray[i] = (*C.struct_miqt_string)(uris_i_ms) } @@ -506,7 +514,7 @@ func QUrl_SetIdnWhitelist(idnWhitelist []string) { idnWhitelist_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(idnWhitelist)))) defer C.free(unsafe.Pointer(idnWhitelist_CArray)) for i := range idnWhitelist { - idnWhitelist_i_ms := miqt_strdupg(idnWhitelist[i]) + idnWhitelist_i_ms := libmiqt.Strdupg(idnWhitelist[i]) defer C.free(idnWhitelist_i_ms) idnWhitelist_CArray[i] = (*C.struct_miqt_string)(idnWhitelist_i_ms) } @@ -516,7 +524,7 @@ func QUrl_SetIdnWhitelist(idnWhitelist []string) { } func (this *QUrl) SetUrl2(url string, mode QUrl__ParsingMode) { - url_ms := miqt_strdupg(url) + url_ms := libmiqt.Strdupg(url) defer C.free(url_ms) C.QUrl_SetUrl2(this.h, (*C.struct_miqt_string)(url_ms), (C.int)(mode)) } @@ -529,9 +537,9 @@ func QUrl_FromEncoded2(url *QByteArray, mode QUrl__ParsingMode) *QUrl { } func QUrl_FromUserInput3(userInput string, workingDirectory string, options QUrl__UserInputResolutionOption) *QUrl { - userInput_ms := miqt_strdupg(userInput) + userInput_ms := libmiqt.Strdupg(userInput) defer C.free(userInput_ms) - workingDirectory_ms := miqt_strdupg(workingDirectory) + workingDirectory_ms := libmiqt.Strdupg(workingDirectory) defer C.free(workingDirectory_ms) _ret := C.QUrl_FromUserInput3((*C.struct_miqt_string)(userInput_ms), (*C.struct_miqt_string)(workingDirectory_ms), (C.int)(options)) _goptr := newQUrl(_ret) @@ -540,7 +548,7 @@ func QUrl_FromUserInput3(userInput string, workingDirectory string, options QUrl } func (this *QUrl) SetAuthority2(authority string, mode QUrl__ParsingMode) { - authority_ms := miqt_strdupg(authority) + authority_ms := libmiqt.Strdupg(authority) defer C.free(authority_ms) C.QUrl_SetAuthority2(this.h, (*C.struct_miqt_string)(authority_ms), (C.int)(mode)) } @@ -553,7 +561,7 @@ func (this *QUrl) Authority1(options QUrl__ComponentFormattingOption) string { } func (this *QUrl) SetUserInfo2(userInfo string, mode QUrl__ParsingMode) { - userInfo_ms := miqt_strdupg(userInfo) + userInfo_ms := libmiqt.Strdupg(userInfo) defer C.free(userInfo_ms) C.QUrl_SetUserInfo2(this.h, (*C.struct_miqt_string)(userInfo_ms), (C.int)(mode)) } @@ -566,7 +574,7 @@ func (this *QUrl) UserInfo1(options QUrl__ComponentFormattingOption) string { } func (this *QUrl) SetUserName2(userName string, mode QUrl__ParsingMode) { - userName_ms := miqt_strdupg(userName) + userName_ms := libmiqt.Strdupg(userName) defer C.free(userName_ms) C.QUrl_SetUserName2(this.h, (*C.struct_miqt_string)(userName_ms), (C.int)(mode)) } @@ -579,7 +587,7 @@ func (this *QUrl) UserName1(options QUrl__ComponentFormattingOption) string { } func (this *QUrl) SetPassword2(password string, mode QUrl__ParsingMode) { - password_ms := miqt_strdupg(password) + password_ms := libmiqt.Strdupg(password) defer C.free(password_ms) C.QUrl_SetPassword2(this.h, (*C.struct_miqt_string)(password_ms), (C.int)(mode)) } @@ -592,7 +600,7 @@ func (this *QUrl) Password1(param1 QUrl__ComponentFormattingOption) string { } func (this *QUrl) SetHost2(host string, mode QUrl__ParsingMode) { - host_ms := miqt_strdupg(host) + host_ms := libmiqt.Strdupg(host) defer C.free(host_ms) C.QUrl_SetHost2(this.h, (*C.struct_miqt_string)(host_ms), (C.int)(mode)) } @@ -616,7 +624,7 @@ func (this *QUrl) Port1(defaultPort int) int { } func (this *QUrl) SetPath2(path string, mode QUrl__ParsingMode) { - path_ms := miqt_strdupg(path) + path_ms := libmiqt.Strdupg(path) defer C.free(path_ms) C.QUrl_SetPath2(this.h, (*C.struct_miqt_string)(path_ms), (C.int)(mode)) } @@ -636,7 +644,7 @@ func (this *QUrl) FileName1(options QUrl__ComponentFormattingOption) string { } func (this *QUrl) SetQuery2(query string, mode QUrl__ParsingMode) { - query_ms := miqt_strdupg(query) + query_ms := libmiqt.Strdupg(query) defer C.free(query_ms) C.QUrl_SetQuery2(this.h, (*C.struct_miqt_string)(query_ms), (C.int)(mode)) } @@ -656,13 +664,13 @@ func (this *QUrl) Fragment1(options QUrl__ComponentFormattingOption) string { } func (this *QUrl) SetFragment2(fragment string, mode QUrl__ParsingMode) { - fragment_ms := miqt_strdupg(fragment) + fragment_ms := libmiqt.Strdupg(fragment) defer C.free(fragment_ms) C.QUrl_SetFragment2(this.h, (*C.struct_miqt_string)(fragment_ms), (C.int)(mode)) } func QUrl_ToPercentEncoding2(param1 string, exclude *QByteArray) *QByteArray { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) _ret := C.QUrl_ToPercentEncoding2((*C.struct_miqt_string)(param1_ms), exclude.cPointer()) _goptr := newQByteArray(_ret) @@ -671,7 +679,7 @@ func QUrl_ToPercentEncoding2(param1 string, exclude *QByteArray) *QByteArray { } func QUrl_ToPercentEncoding3(param1 string, exclude *QByteArray, include *QByteArray) *QByteArray { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) _ret := C.QUrl_ToPercentEncoding3((*C.struct_miqt_string)(param1_ms), exclude.cPointer(), include.cPointer()) _goptr := newQByteArray(_ret) @@ -684,7 +692,7 @@ func QUrl_FromStringList2(uris []string, mode QUrl__ParsingMode) []QUrl { uris_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(uris)))) defer C.free(unsafe.Pointer(uris_CArray)) for i := range uris { - uris_i_ms := miqt_strdupg(uris[i]) + uris_i_ms := libmiqt.Strdupg(uris[i]) defer C.free(uris_i_ms) uris_CArray[i] = (*C.struct_miqt_string)(uris_i_ms) } diff --git a/qt/gen_qurl.h b/qt/gen_qurl.h index d691e2bc..ff05e9e3 100644 --- a/qt/gen_qurl.h +++ b/qt/gen_qurl.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qurlquery.cpp b/qt/gen_qurlquery.cpp index 312f78e0..d75281c5 100644 --- a/qt/gen_qurlquery.cpp +++ b/qt/gen_qurlquery.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qurlquery.h" +#include #include "gen_qurlquery.h" #include "_cgo_export.h" diff --git a/qt/gen_qurlquery.go b/qt/gen_qurlquery.go index 508d15fa..287febbd 100644 --- a/qt/gen_qurlquery.go +++ b/qt/gen_qurlquery.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QUrlQuery) cPointer() *C.QUrlQuery { return this.h } +func (this *QUrlQuery) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQUrlQuery(h *C.QUrlQuery) *QUrlQuery { if h == nil { return nil @@ -31,7 +39,7 @@ func newQUrlQuery(h *C.QUrlQuery) *QUrlQuery { return &QUrlQuery{h: h} } -func newQUrlQuery_U(h unsafe.Pointer) *QUrlQuery { +func UnsafeNewQUrlQuery(h unsafe.Pointer) *QUrlQuery { return newQUrlQuery((*C.QUrlQuery)(h)) } @@ -49,7 +57,7 @@ func NewQUrlQuery2(url *QUrl) *QUrlQuery { // NewQUrlQuery3 constructs a new QUrlQuery object. func NewQUrlQuery3(queryString string) *QUrlQuery { - queryString_ms := miqt_strdupg(queryString) + queryString_ms := libmiqt.Strdupg(queryString) defer C.free(queryString_ms) ret := C.QUrlQuery_new3((*C.struct_miqt_string)(queryString_ms)) return newQUrlQuery(ret) @@ -97,7 +105,7 @@ func (this *QUrlQuery) Query() string { } func (this *QUrlQuery) SetQuery(queryString string) { - queryString_ms := miqt_strdupg(queryString) + queryString_ms := libmiqt.Strdupg(queryString) defer C.free(queryString_ms) C.QUrlQuery_SetQuery(this.h, (*C.struct_miqt_string)(queryString_ms)) } @@ -128,27 +136,27 @@ func (this *QUrlQuery) QueryPairDelimiter() *QChar { } func (this *QUrlQuery) HasQueryItem(key string) bool { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) return (bool)(C.QUrlQuery_HasQueryItem(this.h, (*C.struct_miqt_string)(key_ms))) } func (this *QUrlQuery) AddQueryItem(key string, value string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) C.QUrlQuery_AddQueryItem(this.h, (*C.struct_miqt_string)(key_ms), (*C.struct_miqt_string)(value_ms)) } func (this *QUrlQuery) RemoveQueryItem(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QUrlQuery_RemoveQueryItem(this.h, (*C.struct_miqt_string)(key_ms)) } func (this *QUrlQuery) QueryItemValue(key string) string { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) var _ms *C.struct_miqt_string = C.QUrlQuery_QueryItemValue(this.h, (*C.struct_miqt_string)(key_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -157,7 +165,7 @@ func (this *QUrlQuery) QueryItemValue(key string) string { } func (this *QUrlQuery) AllQueryItemValues(key string) []string { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) var _ma *C.struct_miqt_array = C.QUrlQuery_AllQueryItemValues(this.h, (*C.struct_miqt_string)(key_ms)) _ret := make([]string, int(_ma.len)) @@ -173,7 +181,7 @@ func (this *QUrlQuery) AllQueryItemValues(key string) []string { } func (this *QUrlQuery) RemoveAllQueryItems(key string) { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) C.QUrlQuery_RemoveAllQueryItems(this.h, (*C.struct_miqt_string)(key_ms)) } @@ -207,7 +215,7 @@ func (this *QUrlQuery) ToString1(encoding QUrl__ComponentFormattingOption) strin } func (this *QUrlQuery) QueryItemValue2(key string, encoding QUrl__ComponentFormattingOption) string { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) var _ms *C.struct_miqt_string = C.QUrlQuery_QueryItemValue2(this.h, (*C.struct_miqt_string)(key_ms), (C.int)(encoding)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -216,7 +224,7 @@ func (this *QUrlQuery) QueryItemValue2(key string, encoding QUrl__ComponentForma } func (this *QUrlQuery) AllQueryItemValues2(key string, encoding QUrl__ComponentFormattingOption) []string { - key_ms := miqt_strdupg(key) + key_ms := libmiqt.Strdupg(key) defer C.free(key_ms) var _ma *C.struct_miqt_array = C.QUrlQuery_AllQueryItemValues2(this.h, (*C.struct_miqt_string)(key_ms), (C.int)(encoding)) _ret := make([]string, int(_ma.len)) diff --git a/qt/gen_qurlquery.h b/qt/gen_qurlquery.h index 03a30bbe..73637edb 100644 --- a/qt/gen_qurlquery.h +++ b/qt/gen_qurlquery.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_quuid.cpp b/qt/gen_quuid.cpp index dbd950d6..9514af35 100644 --- a/qt/gen_quuid.cpp +++ b/qt/gen_quuid.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "quuid.h" +#include #include "gen_quuid.h" #include "_cgo_export.h" diff --git a/qt/gen_quuid.go b/qt/gen_quuid.go index 511bf913..8cba0567 100644 --- a/qt/gen_quuid.go +++ b/qt/gen_quuid.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -54,6 +55,13 @@ func (this *QUuid) cPointer() *C.QUuid { return this.h } +func (this *QUuid) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQUuid(h *C.QUuid) *QUuid { if h == nil { return nil @@ -61,7 +69,7 @@ func newQUuid(h *C.QUuid) *QUuid { return &QUuid{h: h} } -func newQUuid_U(h unsafe.Pointer) *QUuid { +func UnsafeNewQUuid(h unsafe.Pointer) *QUuid { return newQUuid((*C.QUuid)(h)) } @@ -79,7 +87,7 @@ func NewQUuid2(l uint, w1 uint16, w2 uint16, b1 byte, b2 byte, b3 byte, b4 byte, // NewQUuid3 constructs a new QUuid object. func NewQUuid3(param1 string) *QUuid { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) ret := C.QUuid_new3((*C.struct_miqt_string)(param1_ms)) return newQUuid(ret) @@ -189,7 +197,7 @@ func QUuid_CreateUuidV5(ns *QUuid, baseData *QByteArray) *QUuid { } func QUuid_CreateUuidV32(ns *QUuid, baseData string) *QUuid { - baseData_ms := miqt_strdupg(baseData) + baseData_ms := libmiqt.Strdupg(baseData) defer C.free(baseData_ms) _ret := C.QUuid_CreateUuidV32(ns.cPointer(), (*C.struct_miqt_string)(baseData_ms)) _goptr := newQUuid(_ret) @@ -198,7 +206,7 @@ func QUuid_CreateUuidV32(ns *QUuid, baseData string) *QUuid { } func QUuid_CreateUuidV52(ns *QUuid, baseData string) *QUuid { - baseData_ms := miqt_strdupg(baseData) + baseData_ms := libmiqt.Strdupg(baseData) defer C.free(baseData_ms) _ret := C.QUuid_CreateUuidV52(ns.cPointer(), (*C.struct_miqt_string)(baseData_ms)) _goptr := newQUuid(_ret) diff --git a/qt/gen_quuid.h b/qt/gen_quuid.h index 9a4fac62..2ef9d5d1 100644 --- a/qt/gen_quuid.h +++ b/qt/gen_quuid.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qvalidator.cpp b/qt/gen_qvalidator.cpp index 46104e1e..390233d6 100644 --- a/qt/gen_qvalidator.cpp +++ b/qt/gen_qvalidator.cpp @@ -11,7 +11,7 @@ #include #include #include -#include "qvalidator.h" +#include #include "gen_qvalidator.h" #include "_cgo_export.h" diff --git a/qt/gen_qvalidator.go b/qt/gen_qvalidator.go index 620a501a..b6728216 100644 --- a/qt/gen_qvalidator.go +++ b/qt/gen_qvalidator.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -41,19 +42,26 @@ func (this *QValidator) cPointer() *C.QValidator { return this.h } +func (this *QValidator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQValidator(h *C.QValidator) *QValidator { if h == nil { return nil } - return &QValidator{h: h, QObject: newQObject_U(unsafe.Pointer(h))} + return &QValidator{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))} } -func newQValidator_U(h unsafe.Pointer) *QValidator { +func UnsafeNewQValidator(h unsafe.Pointer) *QValidator { return newQValidator((*C.QValidator)(h)) } func (this *QValidator) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QValidator_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QValidator_MetaObject(this.h))) } func (this *QValidator) Metacast(param1 string) unsafe.Pointer { @@ -92,13 +100,13 @@ func (this *QValidator) Locale() *QLocale { } func (this *QValidator) Validate(param1 string, param2 *int) QValidator__State { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (QValidator__State)(C.QValidator_Validate(this.h, (*C.struct_miqt_string)(param1_ms), (*C.int)(unsafe.Pointer(param2)))) } func (this *QValidator) Fixup(param1 string) { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) C.QValidator_Fixup(this.h, (*C.struct_miqt_string)(param1_ms)) } @@ -190,14 +198,21 @@ func (this *QIntValidator) cPointer() *C.QIntValidator { return this.h } +func (this *QIntValidator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQIntValidator(h *C.QIntValidator) *QIntValidator { if h == nil { return nil } - return &QIntValidator{h: h, QValidator: newQValidator_U(unsafe.Pointer(h))} + return &QIntValidator{h: h, QValidator: UnsafeNewQValidator(unsafe.Pointer(h))} } -func newQIntValidator_U(h unsafe.Pointer) *QIntValidator { +func UnsafeNewQIntValidator(h unsafe.Pointer) *QIntValidator { return newQIntValidator((*C.QIntValidator)(h)) } @@ -226,7 +241,7 @@ func NewQIntValidator4(bottom int, top int, parent *QObject) *QIntValidator { } func (this *QIntValidator) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QIntValidator_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QIntValidator_MetaObject(this.h))) } func (this *QIntValidator) Metacast(param1 string) unsafe.Pointer { @@ -254,13 +269,13 @@ func QIntValidator_TrUtf8(s string) string { } func (this *QIntValidator) Validate(param1 string, param2 *int) QValidator__State { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (QValidator__State)(C.QIntValidator_Validate(this.h, (*C.struct_miqt_string)(param1_ms), (*C.int)(unsafe.Pointer(param2)))) } func (this *QIntValidator) Fixup(input string) { - input_ms := miqt_strdupg(input) + input_ms := libmiqt.Strdupg(input) defer C.free(input_ms) C.QIntValidator_Fixup(this.h, (*C.struct_miqt_string)(input_ms)) } @@ -395,14 +410,21 @@ func (this *QDoubleValidator) cPointer() *C.QDoubleValidator { return this.h } +func (this *QDoubleValidator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQDoubleValidator(h *C.QDoubleValidator) *QDoubleValidator { if h == nil { return nil } - return &QDoubleValidator{h: h, QValidator: newQValidator_U(unsafe.Pointer(h))} + return &QDoubleValidator{h: h, QValidator: UnsafeNewQValidator(unsafe.Pointer(h))} } -func newQDoubleValidator_U(h unsafe.Pointer) *QDoubleValidator { +func UnsafeNewQDoubleValidator(h unsafe.Pointer) *QDoubleValidator { return newQDoubleValidator((*C.QDoubleValidator)(h)) } @@ -431,7 +453,7 @@ func NewQDoubleValidator4(bottom float64, top float64, decimals int, parent *QOb } func (this *QDoubleValidator) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QDoubleValidator_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QDoubleValidator_MetaObject(this.h))) } func (this *QDoubleValidator) Metacast(param1 string) unsafe.Pointer { @@ -459,7 +481,7 @@ func QDoubleValidator_TrUtf8(s string) string { } func (this *QDoubleValidator) Validate(param1 string, param2 *int) QValidator__State { - param1_ms := miqt_strdupg(param1) + param1_ms := libmiqt.Strdupg(param1) defer C.free(param1_ms) return (QValidator__State)(C.QDoubleValidator_Validate(this.h, (*C.struct_miqt_string)(param1_ms), (*C.int)(unsafe.Pointer(param2)))) } @@ -654,14 +676,21 @@ func (this *QRegExpValidator) cPointer() *C.QRegExpValidator { return this.h } +func (this *QRegExpValidator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRegExpValidator(h *C.QRegExpValidator) *QRegExpValidator { if h == nil { return nil } - return &QRegExpValidator{h: h, QValidator: newQValidator_U(unsafe.Pointer(h))} + return &QRegExpValidator{h: h, QValidator: UnsafeNewQValidator(unsafe.Pointer(h))} } -func newQRegExpValidator_U(h unsafe.Pointer) *QRegExpValidator { +func UnsafeNewQRegExpValidator(h unsafe.Pointer) *QRegExpValidator { return newQRegExpValidator((*C.QRegExpValidator)(h)) } @@ -690,7 +719,7 @@ func NewQRegExpValidator4(rx *QRegExp, parent *QObject) *QRegExpValidator { } func (this *QRegExpValidator) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QRegExpValidator_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QRegExpValidator_MetaObject(this.h))) } func (this *QRegExpValidator) Metacast(param1 string) unsafe.Pointer { @@ -718,7 +747,7 @@ func QRegExpValidator_TrUtf8(s string) string { } func (this *QRegExpValidator) Validate(input string, pos *int) QValidator__State { - input_ms := miqt_strdupg(input) + input_ms := libmiqt.Strdupg(input) defer C.free(input_ms) return (QValidator__State)(C.QRegExpValidator_Validate(this.h, (*C.struct_miqt_string)(input_ms), (*C.int)(unsafe.Pointer(pos)))) } @@ -728,7 +757,7 @@ func (this *QRegExpValidator) SetRegExp(rx *QRegExp) { } func (this *QRegExpValidator) RegExp() *QRegExp { - return newQRegExp_U(unsafe.Pointer(C.QRegExpValidator_RegExp(this.h))) + return UnsafeNewQRegExp(unsafe.Pointer(C.QRegExpValidator_RegExp(this.h))) } func (this *QRegExpValidator) RegExpChanged(regExp *QRegExp) { @@ -746,7 +775,7 @@ func miqt_exec_callback_QRegExpValidator_RegExpChanged(cb C.intptr_t, regExp *C. } // Convert all CABI parameters to Go parameters - slotval1 := newQRegExp_U(unsafe.Pointer(regExp)) + slotval1 := UnsafeNewQRegExp(unsafe.Pointer(regExp)) gofunc(slotval1) } @@ -821,14 +850,21 @@ func (this *QRegularExpressionValidator) cPointer() *C.QRegularExpressionValidat return this.h } +func (this *QRegularExpressionValidator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQRegularExpressionValidator(h *C.QRegularExpressionValidator) *QRegularExpressionValidator { if h == nil { return nil } - return &QRegularExpressionValidator{h: h, QValidator: newQValidator_U(unsafe.Pointer(h))} + return &QRegularExpressionValidator{h: h, QValidator: UnsafeNewQValidator(unsafe.Pointer(h))} } -func newQRegularExpressionValidator_U(h unsafe.Pointer) *QRegularExpressionValidator { +func UnsafeNewQRegularExpressionValidator(h unsafe.Pointer) *QRegularExpressionValidator { return newQRegularExpressionValidator((*C.QRegularExpressionValidator)(h)) } @@ -857,7 +893,7 @@ func NewQRegularExpressionValidator4(re *QRegularExpression, parent *QObject) *Q } func (this *QRegularExpressionValidator) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QRegularExpressionValidator_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QRegularExpressionValidator_MetaObject(this.h))) } func (this *QRegularExpressionValidator) Metacast(param1 string) unsafe.Pointer { @@ -885,7 +921,7 @@ func QRegularExpressionValidator_TrUtf8(s string) string { } func (this *QRegularExpressionValidator) Validate(input string, pos *int) QValidator__State { - input_ms := miqt_strdupg(input) + input_ms := libmiqt.Strdupg(input) defer C.free(input_ms) return (QValidator__State)(C.QRegularExpressionValidator_Validate(this.h, (*C.struct_miqt_string)(input_ms), (*C.int)(unsafe.Pointer(pos)))) } @@ -916,7 +952,7 @@ func miqt_exec_callback_QRegularExpressionValidator_RegularExpressionChanged(cb } // Convert all CABI parameters to Go parameters - slotval1 := newQRegularExpression_U(unsafe.Pointer(re)) + slotval1 := UnsafeNewQRegularExpression(unsafe.Pointer(re)) gofunc(slotval1) } diff --git a/qt/gen_qvalidator.h b/qt/gen_qvalidator.h index 250c1ac7..34764cf3 100644 --- a/qt/gen_qvalidator.h +++ b/qt/gen_qvalidator.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qvariant.cpp b/qt/gen_qvariant.cpp index e987d788..fe977631 100644 --- a/qt/gen_qvariant.cpp +++ b/qt/gen_qvariant.cpp @@ -39,7 +39,7 @@ #include #define WORKAROUND_INNER_CLASS_DEFINITION_QtMetaTypePrivate__QAssociativeIterableImpl #define WORKAROUND_INNER_CLASS_DEFINITION_QtMetaTypePrivate__QSequentialIterableImpl -#include "qvariant.h" +#include #include "gen_qvariant.h" #include "_cgo_export.h" @@ -113,7 +113,7 @@ QVariant* QVariant_new17(struct miqt_string* stringVal) { } QVariant* QVariant_new18(struct miqt_array* /* of struct miqt_string* */ stringlist) { - QList stringlist_QList; + QStringList stringlist_QList; stringlist_QList.reserve(stringlist->len); struct miqt_string** stringlist_arr = static_cast(stringlist->data); for(size_t i = 0; i < stringlist->len; ++i) { diff --git a/qt/gen_qvariant.go b/qt/gen_qvariant.go index d8cd584c..f6982851 100644 --- a/qt/gen_qvariant.go +++ b/qt/gen_qvariant.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -91,6 +92,13 @@ func (this *QVariant) cPointer() *C.QVariant { return this.h } +func (this *QVariant) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVariant(h *C.QVariant) *QVariant { if h == nil { return nil @@ -98,7 +106,7 @@ func newQVariant(h *C.QVariant) *QVariant { return &QVariant{h: h} } -func newQVariant_U(h unsafe.Pointer) *QVariant { +func UnsafeNewQVariant(h unsafe.Pointer) *QVariant { return newQVariant((*C.QVariant)(h)) } @@ -202,7 +210,7 @@ func NewQVariant16(bitarray *QBitArray) *QVariant { // NewQVariant17 constructs a new QVariant object. func NewQVariant17(stringVal string) *QVariant { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) ret := C.QVariant_new17((*C.struct_miqt_string)(stringVal_ms)) return newQVariant(ret) @@ -214,7 +222,7 @@ func NewQVariant18(stringlist []string) *QVariant { stringlist_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(stringlist)))) defer C.free(unsafe.Pointer(stringlist_CArray)) for i := range stringlist { - stringlist_i_ms := miqt_strdupg(stringlist[i]) + stringlist_i_ms := libmiqt.Strdupg(stringlist[i]) defer C.free(stringlist_i_ms) stringlist_CArray[i] = (*C.struct_miqt_string)(stringlist_i_ms) } @@ -760,6 +768,13 @@ func (this *QVariantComparisonHelper) cPointer() *C.QVariantComparisonHelper { return this.h } +func (this *QVariantComparisonHelper) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVariantComparisonHelper(h *C.QVariantComparisonHelper) *QVariantComparisonHelper { if h == nil { return nil @@ -767,7 +782,7 @@ func newQVariantComparisonHelper(h *C.QVariantComparisonHelper) *QVariantCompari return &QVariantComparisonHelper{h: h} } -func newQVariantComparisonHelper_U(h unsafe.Pointer) *QVariantComparisonHelper { +func UnsafeNewQVariantComparisonHelper(h unsafe.Pointer) *QVariantComparisonHelper { return newQVariantComparisonHelper((*C.QVariantComparisonHelper)(h)) } @@ -808,6 +823,13 @@ func (this *QSequentialIterable) cPointer() *C.QSequentialIterable { return this.h } +func (this *QSequentialIterable) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSequentialIterable(h *C.QSequentialIterable) *QSequentialIterable { if h == nil { return nil @@ -815,7 +837,7 @@ func newQSequentialIterable(h *C.QSequentialIterable) *QSequentialIterable { return &QSequentialIterable{h: h} } -func newQSequentialIterable_U(h unsafe.Pointer) *QSequentialIterable { +func UnsafeNewQSequentialIterable(h unsafe.Pointer) *QSequentialIterable { return newQSequentialIterable((*C.QSequentialIterable)(h)) } @@ -885,6 +907,13 @@ func (this *QAssociativeIterable) cPointer() *C.QAssociativeIterable { return this.h } +func (this *QAssociativeIterable) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAssociativeIterable(h *C.QAssociativeIterable) *QAssociativeIterable { if h == nil { return nil @@ -892,7 +921,7 @@ func newQAssociativeIterable(h *C.QAssociativeIterable) *QAssociativeIterable { return &QAssociativeIterable{h: h} } -func newQAssociativeIterable_U(h unsafe.Pointer) *QAssociativeIterable { +func UnsafeNewQAssociativeIterable(h unsafe.Pointer) *QAssociativeIterable { return newQAssociativeIterable((*C.QAssociativeIterable)(h)) } @@ -965,6 +994,13 @@ func (this *QVariant__PrivateShared) cPointer() *C.QVariant__PrivateShared { return this.h } +func (this *QVariant__PrivateShared) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVariant__PrivateShared(h *C.QVariant__PrivateShared) *QVariant__PrivateShared { if h == nil { return nil @@ -972,7 +1008,7 @@ func newQVariant__PrivateShared(h *C.QVariant__PrivateShared) *QVariant__Private return &QVariant__PrivateShared{h: h} } -func newQVariant__PrivateShared_U(h unsafe.Pointer) *QVariant__PrivateShared { +func UnsafeNewQVariant__PrivateShared(h unsafe.Pointer) *QVariant__PrivateShared { return newQVariant__PrivateShared((*C.QVariant__PrivateShared)(h)) } @@ -1007,6 +1043,13 @@ func (this *QVariant__Handler) cPointer() *C.QVariant__Handler { return this.h } +func (this *QVariant__Handler) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVariant__Handler(h *C.QVariant__Handler) *QVariant__Handler { if h == nil { return nil @@ -1014,7 +1057,7 @@ func newQVariant__Handler(h *C.QVariant__Handler) *QVariant__Handler { return &QVariant__Handler{h: h} } -func newQVariant__Handler_U(h unsafe.Pointer) *QVariant__Handler { +func UnsafeNewQVariant__Handler(h unsafe.Pointer) *QVariant__Handler { return newQVariant__Handler((*C.QVariant__Handler)(h)) } @@ -1043,6 +1086,13 @@ func (this *QSequentialIterable__const_iterator) cPointer() *C.QSequentialIterab return this.h } +func (this *QSequentialIterable__const_iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQSequentialIterable__const_iterator(h *C.QSequentialIterable__const_iterator) *QSequentialIterable__const_iterator { if h == nil { return nil @@ -1050,7 +1100,7 @@ func newQSequentialIterable__const_iterator(h *C.QSequentialIterable__const_iter return &QSequentialIterable__const_iterator{h: h} } -func newQSequentialIterable__const_iterator_U(h unsafe.Pointer) *QSequentialIterable__const_iterator { +func UnsafeNewQSequentialIterable__const_iterator(h unsafe.Pointer) *QSequentialIterable__const_iterator { return newQSequentialIterable__const_iterator((*C.QSequentialIterable__const_iterator)(h)) } @@ -1080,7 +1130,7 @@ func (this *QSequentialIterable__const_iterator) OperatorNotEqual(o *QSequential } func (this *QSequentialIterable__const_iterator) OperatorPlusPlus() *QSequentialIterable__const_iterator { - return newQSequentialIterable__const_iterator_U(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQSequentialIterable__const_iterator(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorPlusPlus(this.h))) } func (this *QSequentialIterable__const_iterator) OperatorPlusPlusWithInt(param1 int) *QSequentialIterable__const_iterator { @@ -1091,7 +1141,7 @@ func (this *QSequentialIterable__const_iterator) OperatorPlusPlusWithInt(param1 } func (this *QSequentialIterable__const_iterator) OperatorMinusMinus() *QSequentialIterable__const_iterator { - return newQSequentialIterable__const_iterator_U(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQSequentialIterable__const_iterator(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorMinusMinus(this.h))) } func (this *QSequentialIterable__const_iterator) OperatorMinusMinusWithInt(param1 int) *QSequentialIterable__const_iterator { @@ -1102,11 +1152,11 @@ func (this *QSequentialIterable__const_iterator) OperatorMinusMinusWithInt(param } func (this *QSequentialIterable__const_iterator) OperatorPlusAssign(j int) *QSequentialIterable__const_iterator { - return newQSequentialIterable__const_iterator_U(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) + return UnsafeNewQSequentialIterable__const_iterator(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) } func (this *QSequentialIterable__const_iterator) OperatorMinusAssign(j int) *QSequentialIterable__const_iterator { - return newQSequentialIterable__const_iterator_U(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) + return UnsafeNewQSequentialIterable__const_iterator(unsafe.Pointer(C.QSequentialIterable__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) } func (this *QSequentialIterable__const_iterator) OperatorPlus(j int) *QSequentialIterable__const_iterator { @@ -1148,6 +1198,13 @@ func (this *QAssociativeIterable__const_iterator) cPointer() *C.QAssociativeIter return this.h } +func (this *QAssociativeIterable__const_iterator) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQAssociativeIterable__const_iterator(h *C.QAssociativeIterable__const_iterator) *QAssociativeIterable__const_iterator { if h == nil { return nil @@ -1155,7 +1212,7 @@ func newQAssociativeIterable__const_iterator(h *C.QAssociativeIterable__const_it return &QAssociativeIterable__const_iterator{h: h} } -func newQAssociativeIterable__const_iterator_U(h unsafe.Pointer) *QAssociativeIterable__const_iterator { +func UnsafeNewQAssociativeIterable__const_iterator(h unsafe.Pointer) *QAssociativeIterable__const_iterator { return newQAssociativeIterable__const_iterator((*C.QAssociativeIterable__const_iterator)(h)) } @@ -1199,7 +1256,7 @@ func (this *QAssociativeIterable__const_iterator) OperatorNotEqual(o *QAssociati } func (this *QAssociativeIterable__const_iterator) OperatorPlusPlus() *QAssociativeIterable__const_iterator { - return newQAssociativeIterable__const_iterator_U(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorPlusPlus(this.h))) + return UnsafeNewQAssociativeIterable__const_iterator(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorPlusPlus(this.h))) } func (this *QAssociativeIterable__const_iterator) OperatorPlusPlusWithInt(param1 int) *QAssociativeIterable__const_iterator { @@ -1210,7 +1267,7 @@ func (this *QAssociativeIterable__const_iterator) OperatorPlusPlusWithInt(param1 } func (this *QAssociativeIterable__const_iterator) OperatorMinusMinus() *QAssociativeIterable__const_iterator { - return newQAssociativeIterable__const_iterator_U(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorMinusMinus(this.h))) + return UnsafeNewQAssociativeIterable__const_iterator(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorMinusMinus(this.h))) } func (this *QAssociativeIterable__const_iterator) OperatorMinusMinusWithInt(param1 int) *QAssociativeIterable__const_iterator { @@ -1221,11 +1278,11 @@ func (this *QAssociativeIterable__const_iterator) OperatorMinusMinusWithInt(para } func (this *QAssociativeIterable__const_iterator) OperatorPlusAssign(j int) *QAssociativeIterable__const_iterator { - return newQAssociativeIterable__const_iterator_U(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) + return UnsafeNewQAssociativeIterable__const_iterator(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorPlusAssign(this.h, (C.int)(j)))) } func (this *QAssociativeIterable__const_iterator) OperatorMinusAssign(j int) *QAssociativeIterable__const_iterator { - return newQAssociativeIterable__const_iterator_U(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) + return UnsafeNewQAssociativeIterable__const_iterator(unsafe.Pointer(C.QAssociativeIterable__const_iterator_OperatorMinusAssign(this.h, (C.int)(j)))) } func (this *QAssociativeIterable__const_iterator) OperatorPlus(j int) *QAssociativeIterable__const_iterator { diff --git a/qt/gen_qvariant.h b/qt/gen_qvariant.h index d18787b4..1a98ec82 100644 --- a/qt/gen_qvariant.h +++ b/qt/gen_qvariant.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qvariantanimation.cpp b/qt/gen_qvariantanimation.cpp index 96a703a7..793d961f 100644 --- a/qt/gen_qvariantanimation.cpp +++ b/qt/gen_qvariantanimation.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qvariantanimation.h" +#include #include "gen_qvariantanimation.h" #include "_cgo_export.h" diff --git a/qt/gen_qvariantanimation.go b/qt/gen_qvariantanimation.go index ca4fc84a..7a95b5bc 100644 --- a/qt/gen_qvariantanimation.go +++ b/qt/gen_qvariantanimation.go @@ -26,14 +26,21 @@ func (this *QVariantAnimation) cPointer() *C.QVariantAnimation { return this.h } +func (this *QVariantAnimation) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVariantAnimation(h *C.QVariantAnimation) *QVariantAnimation { if h == nil { return nil } - return &QVariantAnimation{h: h, QAbstractAnimation: newQAbstractAnimation_U(unsafe.Pointer(h))} + return &QVariantAnimation{h: h, QAbstractAnimation: UnsafeNewQAbstractAnimation(unsafe.Pointer(h))} } -func newQVariantAnimation_U(h unsafe.Pointer) *QVariantAnimation { +func UnsafeNewQVariantAnimation(h unsafe.Pointer) *QVariantAnimation { return newQVariantAnimation((*C.QVariantAnimation)(h)) } @@ -50,7 +57,7 @@ func NewQVariantAnimation2(parent *QObject) *QVariantAnimation { } func (this *QVariantAnimation) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QVariantAnimation_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QVariantAnimation_MetaObject(this.h))) } func (this *QVariantAnimation) Metacast(param1 string) unsafe.Pointer { @@ -151,7 +158,7 @@ func miqt_exec_callback_QVariantAnimation_ValueChanged(cb C.intptr_t, value *C.Q } // Convert all CABI parameters to Go parameters - slotval1 := newQVariant_U(unsafe.Pointer(value)) + slotval1 := UnsafeNewQVariant(unsafe.Pointer(value)) gofunc(slotval1) } diff --git a/qt/gen_qvariantanimation.h b/qt/gen_qvariantanimation.h index e58e94dd..cd38b25d 100644 --- a/qt/gen_qvariantanimation.h +++ b/qt/gen_qvariantanimation.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qvector2d.cpp b/qt/gen_qvector2d.cpp index 4b776512..e8a92a38 100644 --- a/qt/gen_qvector2d.cpp +++ b/qt/gen_qvector2d.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qvector2d.h" +#include #include "gen_qvector2d.h" #include "_cgo_export.h" diff --git a/qt/gen_qvector2d.go b/qt/gen_qvector2d.go index c1f7d7e3..b6a8e26a 100644 --- a/qt/gen_qvector2d.go +++ b/qt/gen_qvector2d.go @@ -24,6 +24,13 @@ func (this *QVector2D) cPointer() *C.QVector2D { return this.h } +func (this *QVector2D) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVector2D(h *C.QVector2D) *QVector2D { if h == nil { return nil @@ -31,7 +38,7 @@ func newQVector2D(h *C.QVector2D) *QVector2D { return &QVector2D{h: h} } -func newQVector2D_U(h unsafe.Pointer) *QVector2D { +func UnsafeNewQVector2D(h unsafe.Pointer) *QVector2D { return newQVector2D((*C.QVector2D)(h)) } @@ -135,27 +142,27 @@ func (this *QVector2D) DistanceToLine(point *QVector2D, direction *QVector2D) fl } func (this *QVector2D) OperatorPlusAssign(vector *QVector2D) *QVector2D { - return newQVector2D_U(unsafe.Pointer(C.QVector2D_OperatorPlusAssign(this.h, vector.cPointer()))) + return UnsafeNewQVector2D(unsafe.Pointer(C.QVector2D_OperatorPlusAssign(this.h, vector.cPointer()))) } func (this *QVector2D) OperatorMinusAssign(vector *QVector2D) *QVector2D { - return newQVector2D_U(unsafe.Pointer(C.QVector2D_OperatorMinusAssign(this.h, vector.cPointer()))) + return UnsafeNewQVector2D(unsafe.Pointer(C.QVector2D_OperatorMinusAssign(this.h, vector.cPointer()))) } func (this *QVector2D) OperatorMultiplyAssign(factor float32) *QVector2D { - return newQVector2D_U(unsafe.Pointer(C.QVector2D_OperatorMultiplyAssign(this.h, (C.float)(factor)))) + return UnsafeNewQVector2D(unsafe.Pointer(C.QVector2D_OperatorMultiplyAssign(this.h, (C.float)(factor)))) } func (this *QVector2D) OperatorMultiplyAssignWithVector(vector *QVector2D) *QVector2D { - return newQVector2D_U(unsafe.Pointer(C.QVector2D_OperatorMultiplyAssignWithVector(this.h, vector.cPointer()))) + return UnsafeNewQVector2D(unsafe.Pointer(C.QVector2D_OperatorMultiplyAssignWithVector(this.h, vector.cPointer()))) } func (this *QVector2D) OperatorDivideAssign(divisor float32) *QVector2D { - return newQVector2D_U(unsafe.Pointer(C.QVector2D_OperatorDivideAssign(this.h, (C.float)(divisor)))) + return UnsafeNewQVector2D(unsafe.Pointer(C.QVector2D_OperatorDivideAssign(this.h, (C.float)(divisor)))) } func (this *QVector2D) OperatorDivideAssignWithVector(vector *QVector2D) *QVector2D { - return newQVector2D_U(unsafe.Pointer(C.QVector2D_OperatorDivideAssignWithVector(this.h, vector.cPointer()))) + return UnsafeNewQVector2D(unsafe.Pointer(C.QVector2D_OperatorDivideAssignWithVector(this.h, vector.cPointer()))) } func QVector2D_DotProduct(v1 *QVector2D, v2 *QVector2D) float32 { diff --git a/qt/gen_qvector2d.h b/qt/gen_qvector2d.h index 3824253e..2495697c 100644 --- a/qt/gen_qvector2d.h +++ b/qt/gen_qvector2d.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qvector3d.cpp b/qt/gen_qvector3d.cpp index 9081d6f1..8d351454 100644 --- a/qt/gen_qvector3d.cpp +++ b/qt/gen_qvector3d.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qvector3d.h" +#include #include "gen_qvector3d.h" #include "_cgo_export.h" diff --git a/qt/gen_qvector3d.go b/qt/gen_qvector3d.go index 0e7c0604..8df03dd7 100644 --- a/qt/gen_qvector3d.go +++ b/qt/gen_qvector3d.go @@ -24,6 +24,13 @@ func (this *QVector3D) cPointer() *C.QVector3D { return this.h } +func (this *QVector3D) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVector3D(h *C.QVector3D) *QVector3D { if h == nil { return nil @@ -31,7 +38,7 @@ func newQVector3D(h *C.QVector3D) *QVector3D { return &QVector3D{h: h} } -func newQVector3D_U(h unsafe.Pointer) *QVector3D { +func UnsafeNewQVector3D(h unsafe.Pointer) *QVector3D { return newQVector3D((*C.QVector3D)(h)) } @@ -141,27 +148,27 @@ func (this *QVector3D) Normalize() { } func (this *QVector3D) OperatorPlusAssign(vector *QVector3D) *QVector3D { - return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorPlusAssign(this.h, vector.cPointer()))) + return UnsafeNewQVector3D(unsafe.Pointer(C.QVector3D_OperatorPlusAssign(this.h, vector.cPointer()))) } func (this *QVector3D) OperatorMinusAssign(vector *QVector3D) *QVector3D { - return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorMinusAssign(this.h, vector.cPointer()))) + return UnsafeNewQVector3D(unsafe.Pointer(C.QVector3D_OperatorMinusAssign(this.h, vector.cPointer()))) } func (this *QVector3D) OperatorMultiplyAssign(factor float32) *QVector3D { - return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorMultiplyAssign(this.h, (C.float)(factor)))) + return UnsafeNewQVector3D(unsafe.Pointer(C.QVector3D_OperatorMultiplyAssign(this.h, (C.float)(factor)))) } func (this *QVector3D) OperatorMultiplyAssignWithVector(vector *QVector3D) *QVector3D { - return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorMultiplyAssignWithVector(this.h, vector.cPointer()))) + return UnsafeNewQVector3D(unsafe.Pointer(C.QVector3D_OperatorMultiplyAssignWithVector(this.h, vector.cPointer()))) } func (this *QVector3D) OperatorDivideAssign(divisor float32) *QVector3D { - return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorDivideAssign(this.h, (C.float)(divisor)))) + return UnsafeNewQVector3D(unsafe.Pointer(C.QVector3D_OperatorDivideAssign(this.h, (C.float)(divisor)))) } func (this *QVector3D) OperatorDivideAssignWithVector(vector *QVector3D) *QVector3D { - return newQVector3D_U(unsafe.Pointer(C.QVector3D_OperatorDivideAssignWithVector(this.h, vector.cPointer()))) + return UnsafeNewQVector3D(unsafe.Pointer(C.QVector3D_OperatorDivideAssignWithVector(this.h, vector.cPointer()))) } func QVector3D_DotProduct(v1 *QVector3D, v2 *QVector3D) float32 { diff --git a/qt/gen_qvector3d.h b/qt/gen_qvector3d.h index 0e0c70fa..fa5b72a0 100644 --- a/qt/gen_qvector3d.h +++ b/qt/gen_qvector3d.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qvector4d.cpp b/qt/gen_qvector4d.cpp index 47e95a97..edca8c12 100644 --- a/qt/gen_qvector4d.cpp +++ b/qt/gen_qvector4d.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qvector4d.h" +#include #include "gen_qvector4d.h" #include "_cgo_export.h" diff --git a/qt/gen_qvector4d.go b/qt/gen_qvector4d.go index b503046b..1d7566ef 100644 --- a/qt/gen_qvector4d.go +++ b/qt/gen_qvector4d.go @@ -24,6 +24,13 @@ func (this *QVector4D) cPointer() *C.QVector4D { return this.h } +func (this *QVector4D) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVector4D(h *C.QVector4D) *QVector4D { if h == nil { return nil @@ -31,7 +38,7 @@ func newQVector4D(h *C.QVector4D) *QVector4D { return &QVector4D{h: h} } -func newQVector4D_U(h unsafe.Pointer) *QVector4D { +func UnsafeNewQVector4D(h unsafe.Pointer) *QVector4D { return newQVector4D((*C.QVector4D)(h)) } @@ -155,27 +162,27 @@ func (this *QVector4D) Normalize() { } func (this *QVector4D) OperatorPlusAssign(vector *QVector4D) *QVector4D { - return newQVector4D_U(unsafe.Pointer(C.QVector4D_OperatorPlusAssign(this.h, vector.cPointer()))) + return UnsafeNewQVector4D(unsafe.Pointer(C.QVector4D_OperatorPlusAssign(this.h, vector.cPointer()))) } func (this *QVector4D) OperatorMinusAssign(vector *QVector4D) *QVector4D { - return newQVector4D_U(unsafe.Pointer(C.QVector4D_OperatorMinusAssign(this.h, vector.cPointer()))) + return UnsafeNewQVector4D(unsafe.Pointer(C.QVector4D_OperatorMinusAssign(this.h, vector.cPointer()))) } func (this *QVector4D) OperatorMultiplyAssign(factor float32) *QVector4D { - return newQVector4D_U(unsafe.Pointer(C.QVector4D_OperatorMultiplyAssign(this.h, (C.float)(factor)))) + return UnsafeNewQVector4D(unsafe.Pointer(C.QVector4D_OperatorMultiplyAssign(this.h, (C.float)(factor)))) } func (this *QVector4D) OperatorMultiplyAssignWithVector(vector *QVector4D) *QVector4D { - return newQVector4D_U(unsafe.Pointer(C.QVector4D_OperatorMultiplyAssignWithVector(this.h, vector.cPointer()))) + return UnsafeNewQVector4D(unsafe.Pointer(C.QVector4D_OperatorMultiplyAssignWithVector(this.h, vector.cPointer()))) } func (this *QVector4D) OperatorDivideAssign(divisor float32) *QVector4D { - return newQVector4D_U(unsafe.Pointer(C.QVector4D_OperatorDivideAssign(this.h, (C.float)(divisor)))) + return UnsafeNewQVector4D(unsafe.Pointer(C.QVector4D_OperatorDivideAssign(this.h, (C.float)(divisor)))) } func (this *QVector4D) OperatorDivideAssignWithVector(vector *QVector4D) *QVector4D { - return newQVector4D_U(unsafe.Pointer(C.QVector4D_OperatorDivideAssignWithVector(this.h, vector.cPointer()))) + return UnsafeNewQVector4D(unsafe.Pointer(C.QVector4D_OperatorDivideAssignWithVector(this.h, vector.cPointer()))) } func QVector4D_DotProduct(v1 *QVector4D, v2 *QVector4D) float32 { diff --git a/qt/gen_qvector4d.h b/qt/gen_qvector4d.h index a0b862b3..a64644b7 100644 --- a/qt/gen_qvector4d.h +++ b/qt/gen_qvector4d.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qversionnumber.cpp b/qt/gen_qversionnumber.cpp index 2f9218a2..973f78e9 100644 --- a/qt/gen_qversionnumber.cpp +++ b/qt/gen_qversionnumber.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "qversionnumber.h" +#include #include "gen_qversionnumber.h" #include "_cgo_export.h" diff --git a/qt/gen_qversionnumber.go b/qt/gen_qversionnumber.go index 2c0924da..9298ea9a 100644 --- a/qt/gen_qversionnumber.go +++ b/qt/gen_qversionnumber.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QVersionNumber) cPointer() *C.QVersionNumber { return this.h } +func (this *QVersionNumber) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQVersionNumber(h *C.QVersionNumber) *QVersionNumber { if h == nil { return nil @@ -31,7 +39,7 @@ func newQVersionNumber(h *C.QVersionNumber) *QVersionNumber { return &QVersionNumber{h: h} } -func newQVersionNumber_U(h unsafe.Pointer) *QVersionNumber { +func UnsafeNewQVersionNumber(h unsafe.Pointer) *QVersionNumber { return newQVersionNumber((*C.QVersionNumber)(h)) } @@ -142,7 +150,7 @@ func (this *QVersionNumber) ToString() string { } func QVersionNumber_FromString(stringVal string) *QVersionNumber { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QVersionNumber_FromString((*C.struct_miqt_string)(stringVal_ms)) _goptr := newQVersionNumber(_ret) @@ -151,7 +159,7 @@ func QVersionNumber_FromString(stringVal string) *QVersionNumber { } func QVersionNumber_FromString22(stringVal string, suffixIndex *int) *QVersionNumber { - stringVal_ms := miqt_strdupg(stringVal) + stringVal_ms := libmiqt.Strdupg(stringVal) defer C.free(stringVal_ms) _ret := C.QVersionNumber_FromString22((*C.struct_miqt_string)(stringVal_ms), (*C.int)(unsafe.Pointer(suffixIndex))) _goptr := newQVersionNumber(_ret) diff --git a/qt/gen_qversionnumber.h b/qt/gen_qversionnumber.h index 4f19b36f..93393a27 100644 --- a/qt/gen_qversionnumber.h +++ b/qt/gen_qversionnumber.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwaitcondition.cpp b/qt/gen_qwaitcondition.cpp index 45b82a8c..ad79b27d 100644 --- a/qt/gen_qwaitcondition.cpp +++ b/qt/gen_qwaitcondition.cpp @@ -2,7 +2,7 @@ #include #include #include -#include "qwaitcondition.h" +#include #include "gen_qwaitcondition.h" #include "_cgo_export.h" diff --git a/qt/gen_qwaitcondition.go b/qt/gen_qwaitcondition.go index 40ac98f2..cb77317a 100644 --- a/qt/gen_qwaitcondition.go +++ b/qt/gen_qwaitcondition.go @@ -24,6 +24,13 @@ func (this *QWaitCondition) cPointer() *C.QWaitCondition { return this.h } +func (this *QWaitCondition) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWaitCondition(h *C.QWaitCondition) *QWaitCondition { if h == nil { return nil @@ -31,7 +38,7 @@ func newQWaitCondition(h *C.QWaitCondition) *QWaitCondition { return &QWaitCondition{h: h} } -func newQWaitCondition_U(h unsafe.Pointer) *QWaitCondition { +func UnsafeNewQWaitCondition(h unsafe.Pointer) *QWaitCondition { return newQWaitCondition((*C.QWaitCondition)(h)) } diff --git a/qt/gen_qwaitcondition.h b/qt/gen_qwaitcondition.h index 70405396..a1fdefef 100644 --- a/qt/gen_qwaitcondition.h +++ b/qt/gen_qwaitcondition.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwhatsthis.cpp b/qt/gen_qwhatsthis.cpp index 3d74faaa..ffc89689 100644 --- a/qt/gen_qwhatsthis.cpp +++ b/qt/gen_qwhatsthis.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "qwhatsthis.h" +#include #include "gen_qwhatsthis.h" #include "_cgo_export.h" diff --git a/qt/gen_qwhatsthis.go b/qt/gen_qwhatsthis.go index d02165e4..5e1ab774 100644 --- a/qt/gen_qwhatsthis.go +++ b/qt/gen_qwhatsthis.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -24,6 +25,13 @@ func (this *QWhatsThis) cPointer() *C.QWhatsThis { return this.h } +func (this *QWhatsThis) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWhatsThis(h *C.QWhatsThis) *QWhatsThis { if h == nil { return nil @@ -31,7 +39,7 @@ func newQWhatsThis(h *C.QWhatsThis) *QWhatsThis { return &QWhatsThis{h: h} } -func newQWhatsThis_U(h unsafe.Pointer) *QWhatsThis { +func UnsafeNewQWhatsThis(h unsafe.Pointer) *QWhatsThis { return newQWhatsThis((*C.QWhatsThis)(h)) } @@ -48,7 +56,7 @@ func QWhatsThis_LeaveWhatsThisMode() { } func QWhatsThis_ShowText(pos *QPoint, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QWhatsThis_ShowText(pos.cPointer(), (*C.struct_miqt_string)(text_ms)) } @@ -58,17 +66,17 @@ func QWhatsThis_HideText() { } func QWhatsThis_CreateAction() *QAction { - return newQAction_U(unsafe.Pointer(C.QWhatsThis_CreateAction())) + return UnsafeNewQAction(unsafe.Pointer(C.QWhatsThis_CreateAction())) } func QWhatsThis_ShowText3(pos *QPoint, text string, w *QWidget) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QWhatsThis_ShowText3(pos.cPointer(), (*C.struct_miqt_string)(text_ms), w.cPointer()) } func QWhatsThis_CreateAction1(parent *QObject) *QAction { - return newQAction_U(unsafe.Pointer(C.QWhatsThis_CreateAction1(parent.cPointer()))) + return UnsafeNewQAction(unsafe.Pointer(C.QWhatsThis_CreateAction1(parent.cPointer()))) } // Delete this object from C++ memory. diff --git a/qt/gen_qwhatsthis.h b/qt/gen_qwhatsthis.h index 09346f14..a01d2722 100644 --- a/qt/gen_qwhatsthis.h +++ b/qt/gen_qwhatsthis.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwidget.cpp b/qt/gen_qwidget.cpp index 036db5ed..7895ad50 100644 --- a/qt/gen_qwidget.cpp +++ b/qt/gen_qwidget.cpp @@ -34,7 +34,7 @@ #include #include #include -#include "qwidget.h" +#include #include "gen_qwidget.h" #include "_cgo_export.h" @@ -1018,7 +1018,7 @@ void QWidget_AddAction(QWidget* self, QAction* action) { } void QWidget_AddActions(QWidget* self, struct miqt_array* /* of QAction* */ actions) { - QList actions_QList; + QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { @@ -1028,7 +1028,7 @@ void QWidget_AddActions(QWidget* self, struct miqt_array* /* of QAction* */ acti } void QWidget_InsertActions(QWidget* self, QAction* before, struct miqt_array* /* of QAction* */ actions) { - QList actions_QList; + QList actions_QList; actions_QList.reserve(actions->len); QAction** actions_arr = static_cast(actions->data); for(size_t i = 0; i < actions->len; ++i) { diff --git a/qt/gen_qwidget.go b/qt/gen_qwidget.go index e2b0fd11..1443bcf7 100644 --- a/qt/gen_qwidget.go +++ b/qt/gen_qwidget.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -33,6 +34,13 @@ func (this *QWidgetData) cPointer() *C.QWidgetData { return this.h } +func (this *QWidgetData) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWidgetData(h *C.QWidgetData) *QWidgetData { if h == nil { return nil @@ -40,7 +48,7 @@ func newQWidgetData(h *C.QWidgetData) *QWidgetData { return &QWidgetData{h: h} } -func newQWidgetData_U(h unsafe.Pointer) *QWidgetData { +func UnsafeNewQWidgetData(h unsafe.Pointer) *QWidgetData { return newQWidgetData((*C.QWidgetData)(h)) } @@ -81,14 +89,21 @@ func (this *QWidget) cPointer() *C.QWidget { return this.h } +func (this *QWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWidget(h *C.QWidget) *QWidget { if h == nil { return nil } - return &QWidget{h: h, QObject: newQObject_U(unsafe.Pointer(h)), QPaintDevice: newQPaintDevice_U(unsafe.Pointer(h))} + return &QWidget{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h)), QPaintDevice: UnsafeNewQPaintDevice(unsafe.Pointer(h))} } -func newQWidget_U(h unsafe.Pointer) *QWidget { +func UnsafeNewQWidget(h unsafe.Pointer) *QWidget { return newQWidget((*C.QWidget)(h)) } @@ -111,7 +126,7 @@ func NewQWidget3(parent *QWidget, f WindowType) *QWidget { } func (this *QWidget) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QWidget_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QWidget_MetaObject(this.h))) } func (this *QWidget) Metacast(param1 string) unsafe.Pointer { @@ -159,7 +174,7 @@ func (this *QWidget) EffectiveWinId() uintptr { } func (this *QWidget) Style() *QStyle { - return newQStyle_U(unsafe.Pointer(C.QWidget_Style(this.h))) + return UnsafeNewQStyle(unsafe.Pointer(C.QWidget_Style(this.h))) } func (this *QWidget) SetStyle(style *QStyle) { @@ -218,7 +233,7 @@ func (this *QWidget) FrameGeometry() *QRect { } func (this *QWidget) Geometry() *QRect { - return newQRect_U(unsafe.Pointer(C.QWidget_Geometry(this.h))) + return UnsafeNewQRect(unsafe.Pointer(C.QWidget_Geometry(this.h))) } func (this *QWidget) NormalGeometry() *QRect { @@ -437,19 +452,19 @@ func (this *QWidget) MapFrom(param1 *QWidget, param2 *QPoint) *QPoint { } func (this *QWidget) Window() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_Window(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_Window(this.h))) } func (this *QWidget) NativeParentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_NativeParentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_NativeParentWidget(this.h))) } func (this *QWidget) TopLevelWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_TopLevelWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_TopLevelWidget(this.h))) } func (this *QWidget) Palette() *QPalette { - return newQPalette_U(unsafe.Pointer(C.QWidget_Palette(this.h))) + return UnsafeNewQPalette(unsafe.Pointer(C.QWidget_Palette(this.h))) } func (this *QWidget) SetPalette(palette *QPalette) { @@ -473,7 +488,7 @@ func (this *QWidget) ForegroundRole() QPalette__ColorRole { } func (this *QWidget) Font() *QFont { - return newQFont_U(unsafe.Pointer(C.QWidget_Font(this.h))) + return UnsafeNewQFont(unsafe.Pointer(C.QWidget_Font(this.h))) } func (this *QWidget) SetFont(font *QFont) { @@ -564,7 +579,7 @@ func (this *QWidget) Grab() *QPixmap { } func (this *QWidget) GraphicsEffect() *QGraphicsEffect { - return newQGraphicsEffect_U(unsafe.Pointer(C.QWidget_GraphicsEffect(this.h))) + return UnsafeNewQGraphicsEffect(unsafe.Pointer(C.QWidget_GraphicsEffect(this.h))) } func (this *QWidget) SetGraphicsEffect(effect *QGraphicsEffect) { @@ -580,13 +595,13 @@ func (this *QWidget) UngrabGesture(typeVal GestureType) { } func (this *QWidget) SetWindowTitle(windowTitle string) { - windowTitle_ms := miqt_strdupg(windowTitle) + windowTitle_ms := libmiqt.Strdupg(windowTitle) defer C.free(windowTitle_ms) C.QWidget_SetWindowTitle(this.h, (*C.struct_miqt_string)(windowTitle_ms)) } func (this *QWidget) SetStyleSheet(styleSheet string) { - styleSheet_ms := miqt_strdupg(styleSheet) + styleSheet_ms := libmiqt.Strdupg(styleSheet) defer C.free(styleSheet_ms) C.QWidget_SetStyleSheet(this.h, (*C.struct_miqt_string)(styleSheet_ms)) } @@ -617,7 +632,7 @@ func (this *QWidget) WindowIcon() *QIcon { } func (this *QWidget) SetWindowIconText(windowIconText string) { - windowIconText_ms := miqt_strdupg(windowIconText) + windowIconText_ms := libmiqt.Strdupg(windowIconText) defer C.free(windowIconText_ms) C.QWidget_SetWindowIconText(this.h, (*C.struct_miqt_string)(windowIconText_ms)) } @@ -630,7 +645,7 @@ func (this *QWidget) WindowIconText() string { } func (this *QWidget) SetWindowRole(windowRole string) { - windowRole_ms := miqt_strdupg(windowRole) + windowRole_ms := libmiqt.Strdupg(windowRole) defer C.free(windowRole_ms) C.QWidget_SetWindowRole(this.h, (*C.struct_miqt_string)(windowRole_ms)) } @@ -643,7 +658,7 @@ func (this *QWidget) WindowRole() string { } func (this *QWidget) SetWindowFilePath(filePath string) { - filePath_ms := miqt_strdupg(filePath) + filePath_ms := libmiqt.Strdupg(filePath) defer C.free(filePath_ms) C.QWidget_SetWindowFilePath(this.h, (*C.struct_miqt_string)(filePath_ms)) } @@ -668,7 +683,7 @@ func (this *QWidget) IsWindowModified() bool { } func (this *QWidget) SetToolTip(toolTip string) { - toolTip_ms := miqt_strdupg(toolTip) + toolTip_ms := libmiqt.Strdupg(toolTip) defer C.free(toolTip_ms) C.QWidget_SetToolTip(this.h, (*C.struct_miqt_string)(toolTip_ms)) } @@ -689,7 +704,7 @@ func (this *QWidget) ToolTipDuration() int { } func (this *QWidget) SetStatusTip(statusTip string) { - statusTip_ms := miqt_strdupg(statusTip) + statusTip_ms := libmiqt.Strdupg(statusTip) defer C.free(statusTip_ms) C.QWidget_SetStatusTip(this.h, (*C.struct_miqt_string)(statusTip_ms)) } @@ -702,7 +717,7 @@ func (this *QWidget) StatusTip() string { } func (this *QWidget) SetWhatsThis(whatsThis string) { - whatsThis_ms := miqt_strdupg(whatsThis) + whatsThis_ms := libmiqt.Strdupg(whatsThis) defer C.free(whatsThis_ms) C.QWidget_SetWhatsThis(this.h, (*C.struct_miqt_string)(whatsThis_ms)) } @@ -722,7 +737,7 @@ func (this *QWidget) AccessibleName() string { } func (this *QWidget) SetAccessibleName(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QWidget_SetAccessibleName(this.h, (*C.struct_miqt_string)(name_ms)) } @@ -735,7 +750,7 @@ func (this *QWidget) AccessibleDescription() string { } func (this *QWidget) SetAccessibleDescription(description string) { - description_ms := miqt_strdupg(description) + description_ms := libmiqt.Strdupg(description) defer C.free(description_ms) C.QWidget_SetAccessibleDescription(this.h, (*C.struct_miqt_string)(description_ms)) } @@ -816,7 +831,7 @@ func (this *QWidget) SetFocusProxy(focusProxy *QWidget) { } func (this *QWidget) FocusProxy() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_FocusProxy(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_FocusProxy(this.h))) } func (this *QWidget) ContextMenuPolicy() ContextMenuPolicy { @@ -864,11 +879,11 @@ func (this *QWidget) SetShortcutAutoRepeat(id int) { } func QWidget_MouseGrabber() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_MouseGrabber())) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_MouseGrabber())) } func QWidget_KeyboardGrabber() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_KeyboardGrabber())) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_KeyboardGrabber())) } func (this *QWidget) UpdatesEnabled() bool { @@ -880,7 +895,7 @@ func (this *QWidget) SetUpdatesEnabled(enable bool) { } func (this *QWidget) GraphicsProxyWidget() *QGraphicsProxyWidget { - return newQGraphicsProxyWidget_U(unsafe.Pointer(C.QWidget_GraphicsProxyWidget(this.h))) + return UnsafeNewQGraphicsProxyWidget(unsafe.Pointer(C.QWidget_GraphicsProxyWidget(this.h))) } func (this *QWidget) Update() { @@ -1109,7 +1124,7 @@ func (this *QWidget) ContentsRect() *QRect { } func (this *QWidget) Layout() *QLayout { - return newQLayout_U(unsafe.Pointer(C.QWidget_Layout(this.h))) + return UnsafeNewQLayout(unsafe.Pointer(C.QWidget_Layout(this.h))) } func (this *QWidget) SetLayout(layout *QLayout) { @@ -1137,15 +1152,15 @@ func (this *QWidget) Scroll2(dx int, dy int, param3 *QRect) { } func (this *QWidget) FocusWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_FocusWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_FocusWidget(this.h))) } func (this *QWidget) NextInFocusChain() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_NextInFocusChain(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_NextInFocusChain(this.h))) } func (this *QWidget) PreviousInFocusChain() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_PreviousInFocusChain(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_PreviousInFocusChain(this.h))) } func (this *QWidget) AcceptDrops() bool { @@ -1197,14 +1212,14 @@ func (this *QWidget) Actions() []*QAction { _ret := make([]*QAction, int(_ma.len)) _outCast := (*[0xffff]*C.QAction)(unsafe.Pointer(_ma.data)) // hey ya for i := 0; i < int(_ma.len); i++ { - _ret[i] = newQAction_U(unsafe.Pointer(_outCast[i])) + _ret[i] = UnsafeNewQAction(unsafe.Pointer(_outCast[i])) } C.free(unsafe.Pointer(_ma)) return _ret } func (this *QWidget) ParentWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_ParentWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_ParentWidget(this.h))) } func (this *QWidget) SetWindowFlags(typeVal WindowType) { @@ -1228,15 +1243,15 @@ func (this *QWidget) WindowType() WindowType { } func QWidget_Find(param1 uintptr) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_Find((C.uintptr_t)(param1)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_Find((C.uintptr_t)(param1)))) } func (this *QWidget) ChildAt(x int, y int) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_ChildAt(this.h, (C.int)(x), (C.int)(y)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_ChildAt(this.h, (C.int)(x), (C.int)(y)))) } func (this *QWidget) ChildAtWithQPoint(p *QPoint) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_ChildAtWithQPoint(this.h, p.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_ChildAtWithQPoint(this.h, p.cPointer()))) } func (this *QWidget) SetAttribute(param1 WidgetAttribute) { @@ -1248,7 +1263,7 @@ func (this *QWidget) TestAttribute(param1 WidgetAttribute) bool { } func (this *QWidget) PaintEngine() *QPaintEngine { - return newQPaintEngine_U(unsafe.Pointer(C.QWidget_PaintEngine(this.h))) + return UnsafeNewQPaintEngine(unsafe.Pointer(C.QWidget_PaintEngine(this.h))) } func (this *QWidget) EnsurePolished() { @@ -1268,23 +1283,23 @@ func (this *QWidget) SetAutoFillBackground(enabled bool) { } func (this *QWidget) BackingStore() *QBackingStore { - return newQBackingStore_U(unsafe.Pointer(C.QWidget_BackingStore(this.h))) + return UnsafeNewQBackingStore(unsafe.Pointer(C.QWidget_BackingStore(this.h))) } func (this *QWidget) WindowHandle() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QWidget_WindowHandle(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QWidget_WindowHandle(this.h))) } func (this *QWidget) Screen() *QScreen { - return newQScreen_U(unsafe.Pointer(C.QWidget_Screen(this.h))) + return UnsafeNewQScreen(unsafe.Pointer(C.QWidget_Screen(this.h))) } func QWidget_CreateWindowContainer(window *QWindow) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_CreateWindowContainer(window.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_CreateWindowContainer(window.cPointer()))) } func (this *QWidget) WindowTitleChanged(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QWidget_WindowTitleChanged(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -1323,13 +1338,13 @@ func miqt_exec_callback_QWidget_WindowIconChanged(cb C.intptr_t, icon *C.QIcon) } // Convert all CABI parameters to Go parameters - slotval1 := newQIcon_U(unsafe.Pointer(icon)) + slotval1 := UnsafeNewQIcon(unsafe.Pointer(icon)) gofunc(slotval1) } func (this *QWidget) WindowIconTextChanged(iconText string) { - iconText_ms := miqt_strdupg(iconText) + iconText_ms := libmiqt.Strdupg(iconText) defer C.free(iconText_ms) C.QWidget_WindowIconTextChanged(this.h, (*C.struct_miqt_string)(iconText_ms)) } @@ -1368,7 +1383,7 @@ func miqt_exec_callback_QWidget_CustomContextMenuRequested(cb C.intptr_t, pos *C } // Convert all CABI parameters to Go parameters - slotval1 := newQPoint_U(unsafe.Pointer(pos)) + slotval1 := UnsafeNewQPoint(unsafe.Pointer(pos)) gofunc(slotval1) } @@ -1488,11 +1503,11 @@ func (this *QWidget) SetAttribute2(param1 WidgetAttribute, on bool) { } func QWidget_CreateWindowContainer2(window *QWindow, parent *QWidget) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_CreateWindowContainer2(window.cPointer(), parent.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_CreateWindowContainer2(window.cPointer(), parent.cPointer()))) } func QWidget_CreateWindowContainer3(window *QWindow, parent *QWidget, flags WindowType) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidget_CreateWindowContainer3(window.cPointer(), parent.cPointer(), (C.int)(flags)))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidget_CreateWindowContainer3(window.cPointer(), parent.cPointer(), (C.int)(flags)))) } // Delete this object from C++ memory. diff --git a/qt/gen_qwidget.h b/qt/gen_qwidget.h index 91549e07..acc86c0f 100644 --- a/qt/gen_qwidget.h +++ b/qt/gen_qwidget.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwidgetaction.cpp b/qt/gen_qwidgetaction.cpp index ca33b5df..fe373d2f 100644 --- a/qt/gen_qwidgetaction.cpp +++ b/qt/gen_qwidgetaction.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "qwidgetaction.h" +#include #include "gen_qwidgetaction.h" #include "_cgo_export.h" diff --git a/qt/gen_qwidgetaction.go b/qt/gen_qwidgetaction.go index 645a7dda..7be4471d 100644 --- a/qt/gen_qwidgetaction.go +++ b/qt/gen_qwidgetaction.go @@ -25,14 +25,21 @@ func (this *QWidgetAction) cPointer() *C.QWidgetAction { return this.h } +func (this *QWidgetAction) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWidgetAction(h *C.QWidgetAction) *QWidgetAction { if h == nil { return nil } - return &QWidgetAction{h: h, QAction: newQAction_U(unsafe.Pointer(h))} + return &QWidgetAction{h: h, QAction: UnsafeNewQAction(unsafe.Pointer(h))} } -func newQWidgetAction_U(h unsafe.Pointer) *QWidgetAction { +func UnsafeNewQWidgetAction(h unsafe.Pointer) *QWidgetAction { return newQWidgetAction((*C.QWidgetAction)(h)) } @@ -43,7 +50,7 @@ func NewQWidgetAction(parent *QObject) *QWidgetAction { } func (this *QWidgetAction) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QWidgetAction_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QWidgetAction_MetaObject(this.h))) } func (this *QWidgetAction) Metacast(param1 string) unsafe.Pointer { @@ -75,11 +82,11 @@ func (this *QWidgetAction) SetDefaultWidget(w *QWidget) { } func (this *QWidgetAction) DefaultWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidgetAction_DefaultWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidgetAction_DefaultWidget(this.h))) } func (this *QWidgetAction) RequestWidget(parent *QWidget) *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWidgetAction_RequestWidget(this.h, parent.cPointer()))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWidgetAction_RequestWidget(this.h, parent.cPointer()))) } func (this *QWidgetAction) ReleaseWidget(widget *QWidget) { diff --git a/qt/gen_qwidgetaction.h b/qt/gen_qwidgetaction.h index b755b83f..0e5b9101 100644 --- a/qt/gen_qwidgetaction.h +++ b/qt/gen_qwidgetaction.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwindow.cpp b/qt/gen_qwindow.cpp index 29bba87e..d7b822a9 100644 --- a/qt/gen_qwindow.cpp +++ b/qt/gen_qwindow.cpp @@ -14,7 +14,7 @@ #include #include #include -#include "qwindow.h" +#include #include "gen_qwindow.h" #include "_cgo_export.h" diff --git a/qt/gen_qwindow.go b/qt/gen_qwindow.go index 508bf238..2993c85b 100644 --- a/qt/gen_qwindow.go +++ b/qt/gen_qwindow.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -45,14 +46,21 @@ func (this *QWindow) cPointer() *C.QWindow { return this.h } +func (this *QWindow) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWindow(h *C.QWindow) *QWindow { if h == nil { return nil } - return &QWindow{h: h, QObject: newQObject_U(unsafe.Pointer(h)), QSurface: newQSurface_U(unsafe.Pointer(h))} + return &QWindow{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h)), QSurface: UnsafeNewQSurface(unsafe.Pointer(h))} } -func newQWindow_U(h unsafe.Pointer) *QWindow { +func UnsafeNewQWindow(h unsafe.Pointer) *QWindow { return newQWindow((*C.QWindow)(h)) } @@ -75,7 +83,7 @@ func NewQWindow3(screen *QScreen) *QWindow { } func (this *QWindow) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QWindow_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QWindow_MetaObject(this.h))) } func (this *QWindow) Metacast(param1 string) unsafe.Pointer { @@ -131,11 +139,11 @@ func (this *QWindow) WinId() uintptr { } func (this *QWindow) Parent(mode QWindow__AncestorMode) *QWindow { - return newQWindow_U(unsafe.Pointer(C.QWindow_Parent(this.h, (C.int)(mode)))) + return UnsafeNewQWindow(unsafe.Pointer(C.QWindow_Parent(this.h, (C.int)(mode)))) } func (this *QWindow) Parent2() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QWindow_Parent2(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QWindow_Parent2(this.h))) } func (this *QWindow) SetParent(parent *QWindow) { @@ -255,7 +263,7 @@ func (this *QWindow) SetTransientParent(parent *QWindow) { } func (this *QWindow) TransientParent() *QWindow { - return newQWindow_U(unsafe.Pointer(C.QWindow_TransientParent(this.h))) + return UnsafeNewQWindow(unsafe.Pointer(C.QWindow_TransientParent(this.h))) } func (this *QWindow) IsAncestorOf(child *QWindow) bool { @@ -405,7 +413,7 @@ func (this *QWindow) Resize2(w int, h int) { } func (this *QWindow) SetFilePath(filePath string) { - filePath_ms := miqt_strdupg(filePath) + filePath_ms := libmiqt.Strdupg(filePath) defer C.free(filePath_ms) C.QWindow_SetFilePath(this.h, (*C.struct_miqt_string)(filePath_ms)) } @@ -441,7 +449,7 @@ func (this *QWindow) SetMouseGrabEnabled(grab bool) bool { } func (this *QWindow) Screen() *QScreen { - return newQScreen_U(unsafe.Pointer(C.QWindow_Screen(this.h))) + return UnsafeNewQScreen(unsafe.Pointer(C.QWindow_Screen(this.h))) } func (this *QWindow) SetScreen(screen *QScreen) { @@ -449,11 +457,11 @@ func (this *QWindow) SetScreen(screen *QScreen) { } func (this *QWindow) AccessibleRoot() *QAccessibleInterface { - return newQAccessibleInterface_U(unsafe.Pointer(C.QWindow_AccessibleRoot(this.h))) + return UnsafeNewQAccessibleInterface(unsafe.Pointer(C.QWindow_AccessibleRoot(this.h))) } func (this *QWindow) FocusObject() *QObject { - return newQObject_U(unsafe.Pointer(C.QWindow_FocusObject(this.h))) + return UnsafeNewQObject(unsafe.Pointer(C.QWindow_FocusObject(this.h))) } func (this *QWindow) MapToGlobal(pos *QPoint) *QPoint { @@ -486,7 +494,7 @@ func (this *QWindow) UnsetCursor() { } func QWindow_FromWinId(id uintptr) *QWindow { - return newQWindow_U(unsafe.Pointer(C.QWindow_FromWinId((C.uintptr_t)(id)))) + return UnsafeNewQWindow(unsafe.Pointer(C.QWindow_FromWinId((C.uintptr_t)(id)))) } func (this *QWindow) RequestActivate() { @@ -542,7 +550,7 @@ func (this *QWindow) StartSystemMove() bool { } func (this *QWindow) SetTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QWindow_SetTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -610,7 +618,7 @@ func miqt_exec_callback_QWindow_ScreenChanged(cb C.intptr_t, screen *C.QScreen) } // Convert all CABI parameters to Go parameters - slotval1 := newQScreen_U(unsafe.Pointer(screen)) + slotval1 := UnsafeNewQScreen(unsafe.Pointer(screen)) gofunc(slotval1) } @@ -656,7 +664,7 @@ func miqt_exec_callback_QWindow_WindowStateChanged(cb C.intptr_t, windowState C. } func (this *QWindow) WindowTitleChanged(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QWindow_WindowTitleChanged(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -932,7 +940,7 @@ func miqt_exec_callback_QWindow_FocusObjectChanged(cb C.intptr_t, object *C.QObj } // Convert all CABI parameters to Go parameters - slotval1 := newQObject_U(unsafe.Pointer(object)) + slotval1 := UnsafeNewQObject(unsafe.Pointer(object)) gofunc(slotval1) } @@ -972,7 +980,7 @@ func miqt_exec_callback_QWindow_TransientParentChanged(cb C.intptr_t, transientP } // Convert all CABI parameters to Go parameters - slotval1 := newQWindow_U(unsafe.Pointer(transientParent)) + slotval1 := UnsafeNewQWindow(unsafe.Pointer(transientParent)) gofunc(slotval1) } diff --git a/qt/gen_qwindow.h b/qt/gen_qwindow.h index 2ba6a520..b598c897 100644 --- a/qt/gen_qwindow.h +++ b/qt/gen_qwindow.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwindowdefs.cpp b/qt/gen_qwindowdefs.cpp index 54589b1e..bb00f89c 100644 --- a/qt/gen_qwindowdefs.cpp +++ b/qt/gen_qwindowdefs.cpp @@ -1,4 +1,4 @@ -#include "qwindowdefs.h" +#include #include "gen_qwindowdefs.h" #include "_cgo_export.h" diff --git a/qt/gen_qwindowdefs.h b/qt/gen_qwindowdefs.h index 61d44ad4..505c1f10 100644 --- a/qt/gen_qwindowdefs.h +++ b/qt/gen_qwindowdefs.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwindowdefs_win.cpp b/qt/gen_qwindowdefs_win.cpp index 70651d51..68d96f84 100644 --- a/qt/gen_qwindowdefs_win.cpp +++ b/qt/gen_qwindowdefs_win.cpp @@ -1,4 +1,4 @@ -#include "qwindowdefs_win.h" +#include #include "gen_qwindowdefs_win.h" #include "_cgo_export.h" diff --git a/qt/gen_qwindowdefs_win.h b/qt/gen_qwindowdefs_win.h index 5f043cb6..17852937 100644 --- a/qt/gen_qwindowdefs_win.h +++ b/qt/gen_qwindowdefs_win.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qwizard.cpp b/qt/gen_qwizard.cpp index 43df15d0..bd00aee4 100644 --- a/qt/gen_qwizard.cpp +++ b/qt/gen_qwizard.cpp @@ -10,7 +10,7 @@ #include #include #include -#include "qwizard.h" +#include #include "gen_qwizard.h" #include "_cgo_export.h" diff --git a/qt/gen_qwizard.go b/qt/gen_qwizard.go index 7720801f..9f568180 100644 --- a/qt/gen_qwizard.go +++ b/qt/gen_qwizard.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "runtime/cgo" "unsafe" @@ -86,14 +87,21 @@ func (this *QWizard) cPointer() *C.QWizard { return this.h } +func (this *QWizard) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWizard(h *C.QWizard) *QWizard { if h == nil { return nil } - return &QWizard{h: h, QDialog: newQDialog_U(unsafe.Pointer(h))} + return &QWizard{h: h, QDialog: UnsafeNewQDialog(unsafe.Pointer(h))} } -func newQWizard_U(h unsafe.Pointer) *QWizard { +func UnsafeNewQWizard(h unsafe.Pointer) *QWizard { return newQWizard((*C.QWizard)(h)) } @@ -116,7 +124,7 @@ func NewQWizard3(parent *QWidget, flags WindowType) *QWizard { } func (this *QWizard) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QWizard_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QWizard_MetaObject(this.h))) } func (this *QWizard) Metacast(param1 string) unsafe.Pointer { @@ -156,7 +164,7 @@ func (this *QWizard) RemovePage(id int) { } func (this *QWizard) Page(id int) *QWizardPage { - return newQWizardPage_U(unsafe.Pointer(C.QWizard_Page(this.h, (C.int)(id)))) + return UnsafeNewQWizardPage(unsafe.Pointer(C.QWizard_Page(this.h, (C.int)(id)))) } func (this *QWizard) HasVisitedPage(id int) bool { @@ -205,7 +213,7 @@ func (this *QWizard) StartId() int { } func (this *QWizard) CurrentPage() *QWizardPage { - return newQWizardPage_U(unsafe.Pointer(C.QWizard_CurrentPage(this.h))) + return UnsafeNewQWizardPage(unsafe.Pointer(C.QWizard_CurrentPage(this.h))) } func (this *QWizard) CurrentId() int { @@ -221,13 +229,13 @@ func (this *QWizard) NextId() int { } func (this *QWizard) SetField(name string, value *QVariant) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QWizard_SetField(this.h, (*C.struct_miqt_string)(name_ms), value.cPointer()) } func (this *QWizard) Field(name string) *QVariant { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) _ret := C.QWizard_Field(this.h, (*C.struct_miqt_string)(name_ms)) _goptr := newQVariant(_ret) @@ -260,7 +268,7 @@ func (this *QWizard) Options() QWizard__WizardOption { } func (this *QWizard) SetButtonText(which QWizard__WizardButton, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QWizard_SetButtonText(this.h, (C.int)(which), (*C.struct_miqt_string)(text_ms)) } @@ -289,7 +297,7 @@ func (this *QWizard) SetButton(which QWizard__WizardButton, button *QAbstractBut } func (this *QWizard) Button(which QWizard__WizardButton) *QAbstractButton { - return newQAbstractButton_U(unsafe.Pointer(C.QWizard_Button(this.h, (C.int)(which)))) + return UnsafeNewQAbstractButton(unsafe.Pointer(C.QWizard_Button(this.h, (C.int)(which)))) } func (this *QWizard) SetTitleFormat(format TextFormat) { @@ -324,7 +332,7 @@ func (this *QWizard) SetSideWidget(widget *QWidget) { } func (this *QWizard) SideWidget() *QWidget { - return newQWidget_U(unsafe.Pointer(C.QWizard_SideWidget(this.h))) + return UnsafeNewQWidget(unsafe.Pointer(C.QWizard_SideWidget(this.h))) } func (this *QWizard) SetDefaultProperty(className string, property string, changedSignal string) { @@ -531,14 +539,21 @@ func (this *QWizardPage) cPointer() *C.QWizardPage { return this.h } +func (this *QWizardPage) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQWizardPage(h *C.QWizardPage) *QWizardPage { if h == nil { return nil } - return &QWizardPage{h: h, QWidget: newQWidget_U(unsafe.Pointer(h))} + return &QWizardPage{h: h, QWidget: UnsafeNewQWidget(unsafe.Pointer(h))} } -func newQWizardPage_U(h unsafe.Pointer) *QWizardPage { +func UnsafeNewQWizardPage(h unsafe.Pointer) *QWizardPage { return newQWizardPage((*C.QWizardPage)(h)) } @@ -555,7 +570,7 @@ func NewQWizardPage2(parent *QWidget) *QWizardPage { } func (this *QWizardPage) MetaObject() *QMetaObject { - return newQMetaObject_U(unsafe.Pointer(C.QWizardPage_MetaObject(this.h))) + return UnsafeNewQMetaObject(unsafe.Pointer(C.QWizardPage_MetaObject(this.h))) } func (this *QWizardPage) Metacast(param1 string) unsafe.Pointer { @@ -583,7 +598,7 @@ func QWizardPage_TrUtf8(s string) string { } func (this *QWizardPage) SetTitle(title string) { - title_ms := miqt_strdupg(title) + title_ms := libmiqt.Strdupg(title) defer C.free(title_ms) C.QWizardPage_SetTitle(this.h, (*C.struct_miqt_string)(title_ms)) } @@ -596,7 +611,7 @@ func (this *QWizardPage) Title() string { } func (this *QWizardPage) SetSubTitle(subTitle string) { - subTitle_ms := miqt_strdupg(subTitle) + subTitle_ms := libmiqt.Strdupg(subTitle) defer C.free(subTitle_ms) C.QWizardPage_SetSubTitle(this.h, (*C.struct_miqt_string)(subTitle_ms)) } @@ -636,7 +651,7 @@ func (this *QWizardPage) IsCommitPage() bool { } func (this *QWizardPage) SetButtonText(which QWizard__WizardButton, text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QWizardPage_SetButtonText(this.h, (C.int)(which), (*C.struct_miqt_string)(text_ms)) } diff --git a/qt/gen_qwizard.h b/qt/gen_qwizard.h index fc357421..a18b686e 100644 --- a/qt/gen_qwizard.h +++ b/qt/gen_qwizard.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/gen_qxmlstream.cpp b/qt/gen_qxmlstream.cpp index 2cf12f97..13f0e083 100644 --- a/qt/gen_qxmlstream.cpp +++ b/qt/gen_qxmlstream.cpp @@ -13,7 +13,7 @@ #include #include #include -#include "qxmlstream.h" +#include #include "gen_qxmlstream.h" #include "_cgo_export.h" @@ -376,7 +376,7 @@ void QXmlStreamReader_AddExtraNamespaceDeclaration(QXmlStreamReader* self, QXmlS } void QXmlStreamReader_AddExtraNamespaceDeclarations(QXmlStreamReader* self, struct miqt_array* /* of QXmlStreamNamespaceDeclaration* */ extraNamespaceDeclaractions) { - QVector extraNamespaceDeclaractions_QList; + QXmlStreamNamespaceDeclarations extraNamespaceDeclaractions_QList; extraNamespaceDeclaractions_QList.reserve(extraNamespaceDeclaractions->len); QXmlStreamNamespaceDeclaration** extraNamespaceDeclaractions_arr = static_cast(extraNamespaceDeclaractions->data); for(size_t i = 0; i < extraNamespaceDeclaractions->len; ++i) { diff --git a/qt/gen_qxmlstream.go b/qt/gen_qxmlstream.go index aa2d64ab..f0efba57 100644 --- a/qt/gen_qxmlstream.go +++ b/qt/gen_qxmlstream.go @@ -9,6 +9,7 @@ package qt import "C" import ( + "github.com/mappu/miqt/libmiqt" "runtime" "unsafe" ) @@ -58,6 +59,13 @@ func (this *QXmlStreamStringRef) cPointer() *C.QXmlStreamStringRef { return this.h } +func (this *QXmlStreamStringRef) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamStringRef(h *C.QXmlStreamStringRef) *QXmlStreamStringRef { if h == nil { return nil @@ -65,7 +73,7 @@ func newQXmlStreamStringRef(h *C.QXmlStreamStringRef) *QXmlStreamStringRef { return &QXmlStreamStringRef{h: h} } -func newQXmlStreamStringRef_U(h unsafe.Pointer) *QXmlStreamStringRef { +func UnsafeNewQXmlStreamStringRef(h unsafe.Pointer) *QXmlStreamStringRef { return newQXmlStreamStringRef((*C.QXmlStreamStringRef)(h)) } @@ -77,7 +85,7 @@ func NewQXmlStreamStringRef() *QXmlStreamStringRef { // NewQXmlStreamStringRef2 constructs a new QXmlStreamStringRef object. func NewQXmlStreamStringRef2(aString string) *QXmlStreamStringRef { - aString_ms := miqt_strdupg(aString) + aString_ms := libmiqt.Strdupg(aString) defer C.free(aString_ms) ret := C.QXmlStreamStringRef_new2((*C.struct_miqt_string)(aString_ms)) return newQXmlStreamStringRef(ret) @@ -141,6 +149,13 @@ func (this *QXmlStreamAttribute) cPointer() *C.QXmlStreamAttribute { return this.h } +func (this *QXmlStreamAttribute) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamAttribute(h *C.QXmlStreamAttribute) *QXmlStreamAttribute { if h == nil { return nil @@ -148,7 +163,7 @@ func newQXmlStreamAttribute(h *C.QXmlStreamAttribute) *QXmlStreamAttribute { return &QXmlStreamAttribute{h: h} } -func newQXmlStreamAttribute_U(h unsafe.Pointer) *QXmlStreamAttribute { +func UnsafeNewQXmlStreamAttribute(h unsafe.Pointer) *QXmlStreamAttribute { return newQXmlStreamAttribute((*C.QXmlStreamAttribute)(h)) } @@ -160,9 +175,9 @@ func NewQXmlStreamAttribute() *QXmlStreamAttribute { // NewQXmlStreamAttribute2 constructs a new QXmlStreamAttribute object. func NewQXmlStreamAttribute2(qualifiedName string, value string) *QXmlStreamAttribute { - qualifiedName_ms := miqt_strdupg(qualifiedName) + qualifiedName_ms := libmiqt.Strdupg(qualifiedName) defer C.free(qualifiedName_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) ret := C.QXmlStreamAttribute_new2((*C.struct_miqt_string)(qualifiedName_ms), (*C.struct_miqt_string)(value_ms)) return newQXmlStreamAttribute(ret) @@ -170,11 +185,11 @@ func NewQXmlStreamAttribute2(qualifiedName string, value string) *QXmlStreamAttr // NewQXmlStreamAttribute3 constructs a new QXmlStreamAttribute object. func NewQXmlStreamAttribute3(namespaceUri string, name string, value string) *QXmlStreamAttribute { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) ret := C.QXmlStreamAttribute_new3((*C.struct_miqt_string)(namespaceUri_ms), (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(value_ms)) return newQXmlStreamAttribute(ret) @@ -227,6 +242,13 @@ func (this *QXmlStreamNamespaceDeclaration) cPointer() *C.QXmlStreamNamespaceDec return this.h } +func (this *QXmlStreamNamespaceDeclaration) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamNamespaceDeclaration(h *C.QXmlStreamNamespaceDeclaration) *QXmlStreamNamespaceDeclaration { if h == nil { return nil @@ -234,7 +256,7 @@ func newQXmlStreamNamespaceDeclaration(h *C.QXmlStreamNamespaceDeclaration) *QXm return &QXmlStreamNamespaceDeclaration{h: h} } -func newQXmlStreamNamespaceDeclaration_U(h unsafe.Pointer) *QXmlStreamNamespaceDeclaration { +func UnsafeNewQXmlStreamNamespaceDeclaration(h unsafe.Pointer) *QXmlStreamNamespaceDeclaration { return newQXmlStreamNamespaceDeclaration((*C.QXmlStreamNamespaceDeclaration)(h)) } @@ -246,9 +268,9 @@ func NewQXmlStreamNamespaceDeclaration() *QXmlStreamNamespaceDeclaration { // NewQXmlStreamNamespaceDeclaration2 constructs a new QXmlStreamNamespaceDeclaration object. func NewQXmlStreamNamespaceDeclaration2(prefix string, namespaceUri string) *QXmlStreamNamespaceDeclaration { - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) ret := C.QXmlStreamNamespaceDeclaration_new2((*C.struct_miqt_string)(prefix_ms), (*C.struct_miqt_string)(namespaceUri_ms)) return newQXmlStreamNamespaceDeclaration(ret) @@ -297,6 +319,13 @@ func (this *QXmlStreamNotationDeclaration) cPointer() *C.QXmlStreamNotationDecla return this.h } +func (this *QXmlStreamNotationDeclaration) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamNotationDeclaration(h *C.QXmlStreamNotationDeclaration) *QXmlStreamNotationDeclaration { if h == nil { return nil @@ -304,7 +333,7 @@ func newQXmlStreamNotationDeclaration(h *C.QXmlStreamNotationDeclaration) *QXmlS return &QXmlStreamNotationDeclaration{h: h} } -func newQXmlStreamNotationDeclaration_U(h unsafe.Pointer) *QXmlStreamNotationDeclaration { +func UnsafeNewQXmlStreamNotationDeclaration(h unsafe.Pointer) *QXmlStreamNotationDeclaration { return newQXmlStreamNotationDeclaration((*C.QXmlStreamNotationDeclaration)(h)) } @@ -357,6 +386,13 @@ func (this *QXmlStreamEntityDeclaration) cPointer() *C.QXmlStreamEntityDeclarati return this.h } +func (this *QXmlStreamEntityDeclaration) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamEntityDeclaration(h *C.QXmlStreamEntityDeclaration) *QXmlStreamEntityDeclaration { if h == nil { return nil @@ -364,7 +400,7 @@ func newQXmlStreamEntityDeclaration(h *C.QXmlStreamEntityDeclaration) *QXmlStrea return &QXmlStreamEntityDeclaration{h: h} } -func newQXmlStreamEntityDeclaration_U(h unsafe.Pointer) *QXmlStreamEntityDeclaration { +func UnsafeNewQXmlStreamEntityDeclaration(h unsafe.Pointer) *QXmlStreamEntityDeclaration { return newQXmlStreamEntityDeclaration((*C.QXmlStreamEntityDeclaration)(h)) } @@ -417,6 +453,13 @@ func (this *QXmlStreamEntityResolver) cPointer() *C.QXmlStreamEntityResolver { return this.h } +func (this *QXmlStreamEntityResolver) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamEntityResolver(h *C.QXmlStreamEntityResolver) *QXmlStreamEntityResolver { if h == nil { return nil @@ -424,14 +467,14 @@ func newQXmlStreamEntityResolver(h *C.QXmlStreamEntityResolver) *QXmlStreamEntit return &QXmlStreamEntityResolver{h: h} } -func newQXmlStreamEntityResolver_U(h unsafe.Pointer) *QXmlStreamEntityResolver { +func UnsafeNewQXmlStreamEntityResolver(h unsafe.Pointer) *QXmlStreamEntityResolver { return newQXmlStreamEntityResolver((*C.QXmlStreamEntityResolver)(h)) } func (this *QXmlStreamEntityResolver) ResolveEntity(publicId string, systemId string) string { - publicId_ms := miqt_strdupg(publicId) + publicId_ms := libmiqt.Strdupg(publicId) defer C.free(publicId_ms) - systemId_ms := miqt_strdupg(systemId) + systemId_ms := libmiqt.Strdupg(systemId) defer C.free(systemId_ms) var _ms *C.struct_miqt_string = C.QXmlStreamEntityResolver_ResolveEntity(this.h, (*C.struct_miqt_string)(publicId_ms), (*C.struct_miqt_string)(systemId_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -440,7 +483,7 @@ func (this *QXmlStreamEntityResolver) ResolveEntity(publicId string, systemId st } func (this *QXmlStreamEntityResolver) ResolveUndeclaredEntity(name string) string { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) var _ms *C.struct_miqt_string = C.QXmlStreamEntityResolver_ResolveUndeclaredEntity(this.h, (*C.struct_miqt_string)(name_ms)) _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) @@ -477,6 +520,13 @@ func (this *QXmlStreamReader) cPointer() *C.QXmlStreamReader { return this.h } +func (this *QXmlStreamReader) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamReader(h *C.QXmlStreamReader) *QXmlStreamReader { if h == nil { return nil @@ -484,7 +534,7 @@ func newQXmlStreamReader(h *C.QXmlStreamReader) *QXmlStreamReader { return &QXmlStreamReader{h: h} } -func newQXmlStreamReader_U(h unsafe.Pointer) *QXmlStreamReader { +func UnsafeNewQXmlStreamReader(h unsafe.Pointer) *QXmlStreamReader { return newQXmlStreamReader((*C.QXmlStreamReader)(h)) } @@ -508,7 +558,7 @@ func NewQXmlStreamReader3(data *QByteArray) *QXmlStreamReader { // NewQXmlStreamReader4 constructs a new QXmlStreamReader object. func NewQXmlStreamReader4(data string) *QXmlStreamReader { - data_ms := miqt_strdupg(data) + data_ms := libmiqt.Strdupg(data) defer C.free(data_ms) ret := C.QXmlStreamReader_new4((*C.struct_miqt_string)(data_ms)) return newQXmlStreamReader(ret) @@ -527,7 +577,7 @@ func (this *QXmlStreamReader) SetDevice(device *QIODevice) { } func (this *QXmlStreamReader) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QXmlStreamReader_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QXmlStreamReader_Device(this.h))) } func (this *QXmlStreamReader) AddData(data *QByteArray) { @@ -535,7 +585,7 @@ func (this *QXmlStreamReader) AddData(data *QByteArray) { } func (this *QXmlStreamReader) AddDataWithData(data string) { - data_ms := miqt_strdupg(data) + data_ms := libmiqt.Strdupg(data) defer C.free(data_ms) C.QXmlStreamReader_AddDataWithData(this.h, (*C.struct_miqt_string)(data_ms)) } @@ -742,7 +792,7 @@ func (this *QXmlStreamReader) SetEntityResolver(resolver *QXmlStreamEntityResolv } func (this *QXmlStreamReader) EntityResolver() *QXmlStreamEntityResolver { - return newQXmlStreamEntityResolver_U(unsafe.Pointer(C.QXmlStreamReader_EntityResolver(this.h))) + return UnsafeNewQXmlStreamEntityResolver(unsafe.Pointer(C.QXmlStreamReader_EntityResolver(this.h))) } func (this *QXmlStreamReader) ReadElementText1(behaviour QXmlStreamReader__ReadElementTextBehaviour) string { @@ -753,7 +803,7 @@ func (this *QXmlStreamReader) ReadElementText1(behaviour QXmlStreamReader__ReadE } func (this *QXmlStreamReader) RaiseError1(message string) { - message_ms := miqt_strdupg(message) + message_ms := libmiqt.Strdupg(message) defer C.free(message_ms) C.QXmlStreamReader_RaiseError1(this.h, (*C.struct_miqt_string)(message_ms)) } @@ -783,6 +833,13 @@ func (this *QXmlStreamWriter) cPointer() *C.QXmlStreamWriter { return this.h } +func (this *QXmlStreamWriter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + func newQXmlStreamWriter(h *C.QXmlStreamWriter) *QXmlStreamWriter { if h == nil { return nil @@ -790,7 +847,7 @@ func newQXmlStreamWriter(h *C.QXmlStreamWriter) *QXmlStreamWriter { return &QXmlStreamWriter{h: h} } -func newQXmlStreamWriter_U(h unsafe.Pointer) *QXmlStreamWriter { +func UnsafeNewQXmlStreamWriter(h unsafe.Pointer) *QXmlStreamWriter { return newQXmlStreamWriter((*C.QXmlStreamWriter)(h)) } @@ -817,7 +874,7 @@ func (this *QXmlStreamWriter) SetDevice(device *QIODevice) { } func (this *QXmlStreamWriter) Device() *QIODevice { - return newQIODevice_U(unsafe.Pointer(C.QXmlStreamWriter_Device(this.h))) + return UnsafeNewQIODevice(unsafe.Pointer(C.QXmlStreamWriter_Device(this.h))) } func (this *QXmlStreamWriter) SetCodec(codec *QTextCodec) { @@ -831,7 +888,7 @@ func (this *QXmlStreamWriter) SetCodecWithCodecName(codecName string) { } func (this *QXmlStreamWriter) Codec() *QTextCodec { - return newQTextCodec_U(unsafe.Pointer(C.QXmlStreamWriter_Codec(this.h))) + return UnsafeNewQTextCodec(unsafe.Pointer(C.QXmlStreamWriter_Codec(this.h))) } func (this *QXmlStreamWriter) SetAutoFormatting(autoFormatting bool) { @@ -851,19 +908,19 @@ func (this *QXmlStreamWriter) AutoFormattingIndent() int { } func (this *QXmlStreamWriter) WriteAttribute(qualifiedName string, value string) { - qualifiedName_ms := miqt_strdupg(qualifiedName) + qualifiedName_ms := libmiqt.Strdupg(qualifiedName) defer C.free(qualifiedName_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) C.QXmlStreamWriter_WriteAttribute(this.h, (*C.struct_miqt_string)(qualifiedName_ms), (*C.struct_miqt_string)(value_ms)) } func (this *QXmlStreamWriter) WriteAttribute2(namespaceUri string, name string, value string) { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - value_ms := miqt_strdupg(value) + value_ms := libmiqt.Strdupg(value) defer C.free(value_ms) C.QXmlStreamWriter_WriteAttribute2(this.h, (*C.struct_miqt_string)(namespaceUri_ms), (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(value_ms)) } @@ -873,57 +930,57 @@ func (this *QXmlStreamWriter) WriteAttributeWithAttribute(attribute *QXmlStreamA } func (this *QXmlStreamWriter) WriteCDATA(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QXmlStreamWriter_WriteCDATA(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QXmlStreamWriter) WriteCharacters(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QXmlStreamWriter_WriteCharacters(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QXmlStreamWriter) WriteComment(text string) { - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QXmlStreamWriter_WriteComment(this.h, (*C.struct_miqt_string)(text_ms)) } func (this *QXmlStreamWriter) WriteDTD(dtd string) { - dtd_ms := miqt_strdupg(dtd) + dtd_ms := libmiqt.Strdupg(dtd) defer C.free(dtd_ms) C.QXmlStreamWriter_WriteDTD(this.h, (*C.struct_miqt_string)(dtd_ms)) } func (this *QXmlStreamWriter) WriteEmptyElement(qualifiedName string) { - qualifiedName_ms := miqt_strdupg(qualifiedName) + qualifiedName_ms := libmiqt.Strdupg(qualifiedName) defer C.free(qualifiedName_ms) C.QXmlStreamWriter_WriteEmptyElement(this.h, (*C.struct_miqt_string)(qualifiedName_ms)) } func (this *QXmlStreamWriter) WriteEmptyElement2(namespaceUri string, name string) { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QXmlStreamWriter_WriteEmptyElement2(this.h, (*C.struct_miqt_string)(namespaceUri_ms), (*C.struct_miqt_string)(name_ms)) } func (this *QXmlStreamWriter) WriteTextElement(qualifiedName string, text string) { - qualifiedName_ms := miqt_strdupg(qualifiedName) + qualifiedName_ms := libmiqt.Strdupg(qualifiedName) defer C.free(qualifiedName_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QXmlStreamWriter_WriteTextElement(this.h, (*C.struct_miqt_string)(qualifiedName_ms), (*C.struct_miqt_string)(text_ms)) } func (this *QXmlStreamWriter) WriteTextElement2(namespaceUri string, name string, text string) { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) - text_ms := miqt_strdupg(text) + text_ms := libmiqt.Strdupg(text) defer C.free(text_ms) C.QXmlStreamWriter_WriteTextElement2(this.h, (*C.struct_miqt_string)(namespaceUri_ms), (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(text_ms)) } @@ -937,25 +994,25 @@ func (this *QXmlStreamWriter) WriteEndElement() { } func (this *QXmlStreamWriter) WriteEntityReference(name string) { - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QXmlStreamWriter_WriteEntityReference(this.h, (*C.struct_miqt_string)(name_ms)) } func (this *QXmlStreamWriter) WriteNamespace(namespaceUri string) { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) C.QXmlStreamWriter_WriteNamespace(this.h, (*C.struct_miqt_string)(namespaceUri_ms)) } func (this *QXmlStreamWriter) WriteDefaultNamespace(namespaceUri string) { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) C.QXmlStreamWriter_WriteDefaultNamespace(this.h, (*C.struct_miqt_string)(namespaceUri_ms)) } func (this *QXmlStreamWriter) WriteProcessingInstruction(target string) { - target_ms := miqt_strdupg(target) + target_ms := libmiqt.Strdupg(target) defer C.free(target_ms) C.QXmlStreamWriter_WriteProcessingInstruction(this.h, (*C.struct_miqt_string)(target_ms)) } @@ -965,27 +1022,27 @@ func (this *QXmlStreamWriter) WriteStartDocument() { } func (this *QXmlStreamWriter) WriteStartDocumentWithVersion(version string) { - version_ms := miqt_strdupg(version) + version_ms := libmiqt.Strdupg(version) defer C.free(version_ms) C.QXmlStreamWriter_WriteStartDocumentWithVersion(this.h, (*C.struct_miqt_string)(version_ms)) } func (this *QXmlStreamWriter) WriteStartDocument2(version string, standalone bool) { - version_ms := miqt_strdupg(version) + version_ms := libmiqt.Strdupg(version) defer C.free(version_ms) C.QXmlStreamWriter_WriteStartDocument2(this.h, (*C.struct_miqt_string)(version_ms), (C.bool)(standalone)) } func (this *QXmlStreamWriter) WriteStartElement(qualifiedName string) { - qualifiedName_ms := miqt_strdupg(qualifiedName) + qualifiedName_ms := libmiqt.Strdupg(qualifiedName) defer C.free(qualifiedName_ms) C.QXmlStreamWriter_WriteStartElement(this.h, (*C.struct_miqt_string)(qualifiedName_ms)) } func (this *QXmlStreamWriter) WriteStartElement2(namespaceUri string, name string) { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) - name_ms := miqt_strdupg(name) + name_ms := libmiqt.Strdupg(name) defer C.free(name_ms) C.QXmlStreamWriter_WriteStartElement2(this.h, (*C.struct_miqt_string)(namespaceUri_ms), (*C.struct_miqt_string)(name_ms)) } @@ -999,17 +1056,17 @@ func (this *QXmlStreamWriter) HasError() bool { } func (this *QXmlStreamWriter) WriteNamespace2(namespaceUri string, prefix string) { - namespaceUri_ms := miqt_strdupg(namespaceUri) + namespaceUri_ms := libmiqt.Strdupg(namespaceUri) defer C.free(namespaceUri_ms) - prefix_ms := miqt_strdupg(prefix) + prefix_ms := libmiqt.Strdupg(prefix) defer C.free(prefix_ms) C.QXmlStreamWriter_WriteNamespace2(this.h, (*C.struct_miqt_string)(namespaceUri_ms), (*C.struct_miqt_string)(prefix_ms)) } func (this *QXmlStreamWriter) WriteProcessingInstruction2(target string, data string) { - target_ms := miqt_strdupg(target) + target_ms := libmiqt.Strdupg(target) defer C.free(target_ms) - data_ms := miqt_strdupg(data) + data_ms := libmiqt.Strdupg(data) defer C.free(data_ms) C.QXmlStreamWriter_WriteProcessingInstruction2(this.h, (*C.struct_miqt_string)(target_ms), (*C.struct_miqt_string)(data_ms)) } diff --git a/qt/gen_qxmlstream.h b/qt/gen_qxmlstream.h index 34c02855..c40c8150 100644 --- a/qt/gen_qxmlstream.h +++ b/qt/gen_qxmlstream.h @@ -7,7 +7,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#include "binding.h" +#include "../libmiqt/libmiqt.h" #ifdef __cplusplus extern "C" { diff --git a/qt/qprintsupport/cflags_linux.go b/qt/qprintsupport/cflags_linux.go new file mode 100644 index 00000000..ebb10b1d --- /dev/null +++ b/qt/qprintsupport/cflags_linux.go @@ -0,0 +1,9 @@ +// +build linux,!android + +package qprintsupport + +/* +#cgo CFLAGS: -fPIC +#cgo pkg-config: Qt5PrintSupport +*/ +import "C" diff --git a/qt/qprintsupport/gen_qabstractprintdialog.cpp b/qt/qprintsupport/gen_qabstractprintdialog.cpp new file mode 100644 index 00000000..d789d12e --- /dev/null +++ b/qt/qprintsupport/gen_qabstractprintdialog.cpp @@ -0,0 +1,138 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "gen_qabstractprintdialog.h" +#include "_cgo_export.h" + +QAbstractPrintDialog* QAbstractPrintDialog_new(QPrinter* printer) { + return new QAbstractPrintDialog(printer); +} + +QAbstractPrintDialog* QAbstractPrintDialog_new2(QPrinter* printer, QWidget* parent) { + return new QAbstractPrintDialog(printer, parent); +} + +QMetaObject* QAbstractPrintDialog_MetaObject(const QAbstractPrintDialog* self) { + return (QMetaObject*) self->metaObject(); +} + +void* QAbstractPrintDialog_Metacast(QAbstractPrintDialog* self, const char* param1) { + return self->qt_metacast(param1); +} + +struct miqt_string* QAbstractPrintDialog_Tr(const char* s) { + QString _ret = QAbstractPrintDialog::tr(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QAbstractPrintDialog_TrUtf8(const char* s) { + QString _ret = QAbstractPrintDialog::trUtf8(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QAbstractPrintDialog_AddEnabledOption(QAbstractPrintDialog* self, int option) { + self->addEnabledOption(static_cast(option)); +} + +void QAbstractPrintDialog_SetEnabledOptions(QAbstractPrintDialog* self, int options) { + self->setEnabledOptions(static_cast(options)); +} + +int QAbstractPrintDialog_EnabledOptions(const QAbstractPrintDialog* self) { + QAbstractPrintDialog::PrintDialogOptions _ret = self->enabledOptions(); + return static_cast(_ret); +} + +bool QAbstractPrintDialog_IsOptionEnabled(const QAbstractPrintDialog* self, int option) { + return self->isOptionEnabled(static_cast(option)); +} + +void QAbstractPrintDialog_SetOptionTabs(QAbstractPrintDialog* self, struct miqt_array* /* of QWidget* */ tabs) { + QList tabs_QList; + tabs_QList.reserve(tabs->len); + QWidget** tabs_arr = static_cast(tabs->data); + for(size_t i = 0; i < tabs->len; ++i) { + tabs_QList.push_back(tabs_arr[i]); + } + self->setOptionTabs(tabs_QList); +} + +void QAbstractPrintDialog_SetPrintRange(QAbstractPrintDialog* self, int rangeVal) { + self->setPrintRange(static_cast(rangeVal)); +} + +int QAbstractPrintDialog_PrintRange(const QAbstractPrintDialog* self) { + QAbstractPrintDialog::PrintRange _ret = self->printRange(); + return static_cast(_ret); +} + +void QAbstractPrintDialog_SetMinMax(QAbstractPrintDialog* self, int min, int max) { + self->setMinMax(static_cast(min), static_cast(max)); +} + +int QAbstractPrintDialog_MinPage(const QAbstractPrintDialog* self) { + return self->minPage(); +} + +int QAbstractPrintDialog_MaxPage(const QAbstractPrintDialog* self) { + return self->maxPage(); +} + +void QAbstractPrintDialog_SetFromTo(QAbstractPrintDialog* self, int fromPage, int toPage) { + self->setFromTo(static_cast(fromPage), static_cast(toPage)); +} + +int QAbstractPrintDialog_FromPage(const QAbstractPrintDialog* self) { + return self->fromPage(); +} + +int QAbstractPrintDialog_ToPage(const QAbstractPrintDialog* self) { + return self->toPage(); +} + +QPrinter* QAbstractPrintDialog_Printer(const QAbstractPrintDialog* self) { + return self->printer(); +} + +struct miqt_string* QAbstractPrintDialog_Tr2(const char* s, const char* c) { + QString _ret = QAbstractPrintDialog::tr(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QAbstractPrintDialog_Tr3(const char* s, const char* c, int n) { + QString _ret = QAbstractPrintDialog::tr(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QAbstractPrintDialog_TrUtf82(const char* s, const char* c) { + QString _ret = QAbstractPrintDialog::trUtf8(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QAbstractPrintDialog_TrUtf83(const char* s, const char* c, int n) { + QString _ret = QAbstractPrintDialog::trUtf8(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QAbstractPrintDialog_Delete(QAbstractPrintDialog* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qabstractprintdialog.go b/qt/qprintsupport/gen_qabstractprintdialog.go new file mode 100644 index 00000000..b0e3ba45 --- /dev/null +++ b/qt/qprintsupport/gen_qabstractprintdialog.go @@ -0,0 +1,229 @@ +package qprintsupport + +/* + +#include "gen_qabstractprintdialog.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/qt" + "runtime" + "unsafe" +) + +type QAbstractPrintDialog__PrintRange int + +const ( + QAbstractPrintDialog__AllPages QAbstractPrintDialog__PrintRange = 0 + QAbstractPrintDialog__Selection QAbstractPrintDialog__PrintRange = 1 + QAbstractPrintDialog__PageRange QAbstractPrintDialog__PrintRange = 2 + QAbstractPrintDialog__CurrentPage QAbstractPrintDialog__PrintRange = 3 +) + +type QAbstractPrintDialog__PrintDialogOption int + +const ( + QAbstractPrintDialog__None QAbstractPrintDialog__PrintDialogOption = 0 + QAbstractPrintDialog__PrintToFile QAbstractPrintDialog__PrintDialogOption = 1 + QAbstractPrintDialog__PrintSelection QAbstractPrintDialog__PrintDialogOption = 2 + QAbstractPrintDialog__PrintPageRange QAbstractPrintDialog__PrintDialogOption = 4 + QAbstractPrintDialog__PrintShowPageSize QAbstractPrintDialog__PrintDialogOption = 8 + QAbstractPrintDialog__PrintCollateCopies QAbstractPrintDialog__PrintDialogOption = 16 + QAbstractPrintDialog__DontUseSheet QAbstractPrintDialog__PrintDialogOption = 32 + QAbstractPrintDialog__PrintCurrentPage QAbstractPrintDialog__PrintDialogOption = 64 +) + +type QAbstractPrintDialog struct { + h *C.QAbstractPrintDialog + *qt.QDialog +} + +func (this *QAbstractPrintDialog) cPointer() *C.QAbstractPrintDialog { + if this == nil { + return nil + } + return this.h +} + +func (this *QAbstractPrintDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQAbstractPrintDialog(h *C.QAbstractPrintDialog) *QAbstractPrintDialog { + if h == nil { + return nil + } + return &QAbstractPrintDialog{h: h, QDialog: qt.UnsafeNewQDialog(unsafe.Pointer(h))} +} + +func UnsafeNewQAbstractPrintDialog(h unsafe.Pointer) *QAbstractPrintDialog { + return newQAbstractPrintDialog((*C.QAbstractPrintDialog)(h)) +} + +// NewQAbstractPrintDialog constructs a new QAbstractPrintDialog object. +func NewQAbstractPrintDialog(printer *QPrinter) *QAbstractPrintDialog { + ret := C.QAbstractPrintDialog_new(printer.cPointer()) + return newQAbstractPrintDialog(ret) +} + +// NewQAbstractPrintDialog2 constructs a new QAbstractPrintDialog object. +func NewQAbstractPrintDialog2(printer *QPrinter, parent *qt.QWidget) *QAbstractPrintDialog { + ret := C.QAbstractPrintDialog_new2(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer())) + return newQAbstractPrintDialog(ret) +} + +func (this *QAbstractPrintDialog) MetaObject() *qt.QMetaObject { + return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractPrintDialog_MetaObject(this.h))) +} + +func (this *QAbstractPrintDialog) Metacast(param1 string) unsafe.Pointer { + param1_Cstring := C.CString(param1) + defer C.free(unsafe.Pointer(param1_Cstring)) + return C.QAbstractPrintDialog_Metacast(this.h, param1_Cstring) +} + +func QAbstractPrintDialog_Tr(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QAbstractPrintDialog_Tr(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QAbstractPrintDialog_TrUtf8(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QAbstractPrintDialog_TrUtf8(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QAbstractPrintDialog) AddEnabledOption(option QAbstractPrintDialog__PrintDialogOption) { + C.QAbstractPrintDialog_AddEnabledOption(this.h, (C.int)(option)) +} + +func (this *QAbstractPrintDialog) SetEnabledOptions(options QAbstractPrintDialog__PrintDialogOption) { + C.QAbstractPrintDialog_SetEnabledOptions(this.h, (C.int)(options)) +} + +func (this *QAbstractPrintDialog) EnabledOptions() QAbstractPrintDialog__PrintDialogOption { + return (QAbstractPrintDialog__PrintDialogOption)(C.QAbstractPrintDialog_EnabledOptions(this.h)) +} + +func (this *QAbstractPrintDialog) IsOptionEnabled(option QAbstractPrintDialog__PrintDialogOption) bool { + return (bool)(C.QAbstractPrintDialog_IsOptionEnabled(this.h, (C.int)(option))) +} + +func (this *QAbstractPrintDialog) SetOptionTabs(tabs []*qt.QWidget) { + // For the C ABI, malloc a C array of raw pointers + tabs_CArray := (*[0xffff]*C.QWidget)(C.malloc(C.size_t(8 * len(tabs)))) + defer C.free(unsafe.Pointer(tabs_CArray)) + for i := range tabs { + tabs_CArray[i] = (*C.QWidget)(tabs[i].UnsafePointer()) + } + tabs_ma := &C.struct_miqt_array{len: C.size_t(len(tabs)), data: unsafe.Pointer(tabs_CArray)} + defer runtime.KeepAlive(unsafe.Pointer(tabs_ma)) + C.QAbstractPrintDialog_SetOptionTabs(this.h, tabs_ma) +} + +func (this *QAbstractPrintDialog) SetPrintRange(rangeVal QAbstractPrintDialog__PrintRange) { + C.QAbstractPrintDialog_SetPrintRange(this.h, (C.int)(rangeVal)) +} + +func (this *QAbstractPrintDialog) PrintRange() QAbstractPrintDialog__PrintRange { + return (QAbstractPrintDialog__PrintRange)(C.QAbstractPrintDialog_PrintRange(this.h)) +} + +func (this *QAbstractPrintDialog) SetMinMax(min int, max int) { + C.QAbstractPrintDialog_SetMinMax(this.h, (C.int)(min), (C.int)(max)) +} + +func (this *QAbstractPrintDialog) MinPage() int { + return (int)(C.QAbstractPrintDialog_MinPage(this.h)) +} + +func (this *QAbstractPrintDialog) MaxPage() int { + return (int)(C.QAbstractPrintDialog_MaxPage(this.h)) +} + +func (this *QAbstractPrintDialog) SetFromTo(fromPage int, toPage int) { + C.QAbstractPrintDialog_SetFromTo(this.h, (C.int)(fromPage), (C.int)(toPage)) +} + +func (this *QAbstractPrintDialog) FromPage() int { + return (int)(C.QAbstractPrintDialog_FromPage(this.h)) +} + +func (this *QAbstractPrintDialog) ToPage() int { + return (int)(C.QAbstractPrintDialog_ToPage(this.h)) +} + +func (this *QAbstractPrintDialog) Printer() *QPrinter { + return UnsafeNewQPrinter(unsafe.Pointer(C.QAbstractPrintDialog_Printer(this.h))) +} + +func QAbstractPrintDialog_Tr2(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QAbstractPrintDialog_Tr2(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QAbstractPrintDialog_Tr3(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QAbstractPrintDialog_Tr3(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QAbstractPrintDialog_TrUtf82(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QAbstractPrintDialog_TrUtf82(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QAbstractPrintDialog_TrUtf83(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QAbstractPrintDialog_TrUtf83(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +// Delete this object from C++ memory. +func (this *QAbstractPrintDialog) Delete() { + C.QAbstractPrintDialog_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QAbstractPrintDialog) GoGC() { + runtime.SetFinalizer(this, func(this *QAbstractPrintDialog) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qabstractprintdialog.h b/qt/qprintsupport/gen_qabstractprintdialog.h new file mode 100644 index 00000000..d8af6b71 --- /dev/null +++ b/qt/qprintsupport/gen_qabstractprintdialog.h @@ -0,0 +1,58 @@ +#ifndef GEN_QABSTRACTPRINTDIALOG_H +#define GEN_QABSTRACTPRINTDIALOG_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class QAbstractPrintDialog; +class QMetaObject; +class QPrinter; +class QWidget; +#else +typedef struct QAbstractPrintDialog QAbstractPrintDialog; +typedef struct QMetaObject QMetaObject; +typedef struct QPrinter QPrinter; +typedef struct QWidget QWidget; +#endif + +QAbstractPrintDialog* QAbstractPrintDialog_new(QPrinter* printer); +QAbstractPrintDialog* QAbstractPrintDialog_new2(QPrinter* printer, QWidget* parent); +QMetaObject* QAbstractPrintDialog_MetaObject(const QAbstractPrintDialog* self); +void* QAbstractPrintDialog_Metacast(QAbstractPrintDialog* self, const char* param1); +struct miqt_string* QAbstractPrintDialog_Tr(const char* s); +struct miqt_string* QAbstractPrintDialog_TrUtf8(const char* s); +void QAbstractPrintDialog_AddEnabledOption(QAbstractPrintDialog* self, int option); +void QAbstractPrintDialog_SetEnabledOptions(QAbstractPrintDialog* self, int options); +int QAbstractPrintDialog_EnabledOptions(const QAbstractPrintDialog* self); +bool QAbstractPrintDialog_IsOptionEnabled(const QAbstractPrintDialog* self, int option); +void QAbstractPrintDialog_SetOptionTabs(QAbstractPrintDialog* self, struct miqt_array* /* of QWidget* */ tabs); +void QAbstractPrintDialog_SetPrintRange(QAbstractPrintDialog* self, int rangeVal); +int QAbstractPrintDialog_PrintRange(const QAbstractPrintDialog* self); +void QAbstractPrintDialog_SetMinMax(QAbstractPrintDialog* self, int min, int max); +int QAbstractPrintDialog_MinPage(const QAbstractPrintDialog* self); +int QAbstractPrintDialog_MaxPage(const QAbstractPrintDialog* self); +void QAbstractPrintDialog_SetFromTo(QAbstractPrintDialog* self, int fromPage, int toPage); +int QAbstractPrintDialog_FromPage(const QAbstractPrintDialog* self); +int QAbstractPrintDialog_ToPage(const QAbstractPrintDialog* self); +QPrinter* QAbstractPrintDialog_Printer(const QAbstractPrintDialog* self); +struct miqt_string* QAbstractPrintDialog_Tr2(const char* s, const char* c); +struct miqt_string* QAbstractPrintDialog_Tr3(const char* s, const char* c, int n); +struct miqt_string* QAbstractPrintDialog_TrUtf82(const char* s, const char* c); +struct miqt_string* QAbstractPrintDialog_TrUtf83(const char* s, const char* c, int n); +void QAbstractPrintDialog_Delete(QAbstractPrintDialog* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif diff --git a/qt/qprintsupport/gen_qpagesetupdialog.cpp b/qt/qprintsupport/gen_qpagesetupdialog.cpp new file mode 100644 index 00000000..ffe635cc --- /dev/null +++ b/qt/qprintsupport/gen_qpagesetupdialog.cpp @@ -0,0 +1,93 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "gen_qpagesetupdialog.h" +#include "_cgo_export.h" + +QPageSetupDialog* QPageSetupDialog_new(QPrinter* printer) { + return new QPageSetupDialog(printer); +} + +QPageSetupDialog* QPageSetupDialog_new2() { + return new QPageSetupDialog(); +} + +QPageSetupDialog* QPageSetupDialog_new3(QPrinter* printer, QWidget* parent) { + return new QPageSetupDialog(printer, parent); +} + +QPageSetupDialog* QPageSetupDialog_new4(QWidget* parent) { + return new QPageSetupDialog(parent); +} + +QMetaObject* QPageSetupDialog_MetaObject(const QPageSetupDialog* self) { + return (QMetaObject*) self->metaObject(); +} + +void* QPageSetupDialog_Metacast(QPageSetupDialog* self, const char* param1) { + return self->qt_metacast(param1); +} + +struct miqt_string* QPageSetupDialog_Tr(const char* s) { + QString _ret = QPageSetupDialog::tr(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPageSetupDialog_TrUtf8(const char* s) { + QString _ret = QPageSetupDialog::trUtf8(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +int QPageSetupDialog_Exec(QPageSetupDialog* self) { + return self->exec(); +} + +void QPageSetupDialog_Done(QPageSetupDialog* self, int result) { + self->done(static_cast(result)); +} + +QPrinter* QPageSetupDialog_Printer(QPageSetupDialog* self) { + return self->printer(); +} + +struct miqt_string* QPageSetupDialog_Tr2(const char* s, const char* c) { + QString _ret = QPageSetupDialog::tr(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPageSetupDialog_Tr3(const char* s, const char* c, int n) { + QString _ret = QPageSetupDialog::tr(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPageSetupDialog_TrUtf82(const char* s, const char* c) { + QString _ret = QPageSetupDialog::trUtf8(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPageSetupDialog_TrUtf83(const char* s, const char* c, int n) { + QString _ret = QPageSetupDialog::trUtf8(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPageSetupDialog_Delete(QPageSetupDialog* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qpagesetupdialog.go b/qt/qprintsupport/gen_qpagesetupdialog.go new file mode 100644 index 00000000..2b5f50c7 --- /dev/null +++ b/qt/qprintsupport/gen_qpagesetupdialog.go @@ -0,0 +1,167 @@ +package qprintsupport + +/* + +#include "gen_qpagesetupdialog.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/qt" + "runtime" + "unsafe" +) + +type QPageSetupDialog struct { + h *C.QPageSetupDialog + *qt.QDialog +} + +func (this *QPageSetupDialog) cPointer() *C.QPageSetupDialog { + if this == nil { + return nil + } + return this.h +} + +func (this *QPageSetupDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQPageSetupDialog(h *C.QPageSetupDialog) *QPageSetupDialog { + if h == nil { + return nil + } + return &QPageSetupDialog{h: h, QDialog: qt.UnsafeNewQDialog(unsafe.Pointer(h))} +} + +func UnsafeNewQPageSetupDialog(h unsafe.Pointer) *QPageSetupDialog { + return newQPageSetupDialog((*C.QPageSetupDialog)(h)) +} + +// NewQPageSetupDialog constructs a new QPageSetupDialog object. +func NewQPageSetupDialog(printer *QPrinter) *QPageSetupDialog { + ret := C.QPageSetupDialog_new(printer.cPointer()) + return newQPageSetupDialog(ret) +} + +// NewQPageSetupDialog2 constructs a new QPageSetupDialog object. +func NewQPageSetupDialog2() *QPageSetupDialog { + ret := C.QPageSetupDialog_new2() + return newQPageSetupDialog(ret) +} + +// NewQPageSetupDialog3 constructs a new QPageSetupDialog object. +func NewQPageSetupDialog3(printer *QPrinter, parent *qt.QWidget) *QPageSetupDialog { + ret := C.QPageSetupDialog_new3(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer())) + return newQPageSetupDialog(ret) +} + +// NewQPageSetupDialog4 constructs a new QPageSetupDialog object. +func NewQPageSetupDialog4(parent *qt.QWidget) *QPageSetupDialog { + ret := C.QPageSetupDialog_new4((*C.QWidget)(parent.UnsafePointer())) + return newQPageSetupDialog(ret) +} + +func (this *QPageSetupDialog) MetaObject() *qt.QMetaObject { + return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPageSetupDialog_MetaObject(this.h))) +} + +func (this *QPageSetupDialog) Metacast(param1 string) unsafe.Pointer { + param1_Cstring := C.CString(param1) + defer C.free(unsafe.Pointer(param1_Cstring)) + return C.QPageSetupDialog_Metacast(this.h, param1_Cstring) +} + +func QPageSetupDialog_Tr(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPageSetupDialog_Tr(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPageSetupDialog_TrUtf8(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPageSetupDialog_TrUtf8(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPageSetupDialog) Exec() int { + return (int)(C.QPageSetupDialog_Exec(this.h)) +} + +func (this *QPageSetupDialog) Done(result int) { + C.QPageSetupDialog_Done(this.h, (C.int)(result)) +} + +func (this *QPageSetupDialog) Printer() *QPrinter { + return UnsafeNewQPrinter(unsafe.Pointer(C.QPageSetupDialog_Printer(this.h))) +} + +func QPageSetupDialog_Tr2(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPageSetupDialog_Tr2(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPageSetupDialog_Tr3(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPageSetupDialog_Tr3(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPageSetupDialog_TrUtf82(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPageSetupDialog_TrUtf82(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPageSetupDialog_TrUtf83(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPageSetupDialog_TrUtf83(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +// Delete this object from C++ memory. +func (this *QPageSetupDialog) Delete() { + C.QPageSetupDialog_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QPageSetupDialog) GoGC() { + runtime.SetFinalizer(this, func(this *QPageSetupDialog) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qpagesetupdialog.h b/qt/qprintsupport/gen_qpagesetupdialog.h new file mode 100644 index 00000000..e48ce138 --- /dev/null +++ b/qt/qprintsupport/gen_qpagesetupdialog.h @@ -0,0 +1,49 @@ +#ifndef GEN_QPAGESETUPDIALOG_H +#define GEN_QPAGESETUPDIALOG_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class QMetaObject; +class QPageSetupDialog; +class QPrinter; +class QWidget; +#else +typedef struct QMetaObject QMetaObject; +typedef struct QPageSetupDialog QPageSetupDialog; +typedef struct QPrinter QPrinter; +typedef struct QWidget QWidget; +#endif + +QPageSetupDialog* QPageSetupDialog_new(QPrinter* printer); +QPageSetupDialog* QPageSetupDialog_new2(); +QPageSetupDialog* QPageSetupDialog_new3(QPrinter* printer, QWidget* parent); +QPageSetupDialog* QPageSetupDialog_new4(QWidget* parent); +QMetaObject* QPageSetupDialog_MetaObject(const QPageSetupDialog* self); +void* QPageSetupDialog_Metacast(QPageSetupDialog* self, const char* param1); +struct miqt_string* QPageSetupDialog_Tr(const char* s); +struct miqt_string* QPageSetupDialog_TrUtf8(const char* s); +int QPageSetupDialog_Exec(QPageSetupDialog* self); +void QPageSetupDialog_Done(QPageSetupDialog* self, int result); +QPrinter* QPageSetupDialog_Printer(QPageSetupDialog* self); +struct miqt_string* QPageSetupDialog_Tr2(const char* s, const char* c); +struct miqt_string* QPageSetupDialog_Tr3(const char* s, const char* c, int n); +struct miqt_string* QPageSetupDialog_TrUtf82(const char* s, const char* c); +struct miqt_string* QPageSetupDialog_TrUtf83(const char* s, const char* c, int n); +void QPageSetupDialog_Delete(QPageSetupDialog* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif diff --git a/qt/qprintsupport/gen_qprintdialog.cpp b/qt/qprintsupport/gen_qprintdialog.cpp new file mode 100644 index 00000000..71add150 --- /dev/null +++ b/qt/qprintsupport/gen_qprintdialog.cpp @@ -0,0 +1,129 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "gen_qprintdialog.h" +#include "_cgo_export.h" + +QPrintDialog* QPrintDialog_new(QPrinter* printer) { + return new QPrintDialog(printer); +} + +QPrintDialog* QPrintDialog_new2() { + return new QPrintDialog(); +} + +QPrintDialog* QPrintDialog_new3(QPrinter* printer, QWidget* parent) { + return new QPrintDialog(printer, parent); +} + +QPrintDialog* QPrintDialog_new4(QWidget* parent) { + return new QPrintDialog(parent); +} + +QMetaObject* QPrintDialog_MetaObject(const QPrintDialog* self) { + return (QMetaObject*) self->metaObject(); +} + +void* QPrintDialog_Metacast(QPrintDialog* self, const char* param1) { + return self->qt_metacast(param1); +} + +struct miqt_string* QPrintDialog_Tr(const char* s) { + QString _ret = QPrintDialog::tr(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintDialog_TrUtf8(const char* s) { + QString _ret = QPrintDialog::trUtf8(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +int QPrintDialog_Exec(QPrintDialog* self) { + return self->exec(); +} + +void QPrintDialog_Accept(QPrintDialog* self) { + self->accept(); +} + +void QPrintDialog_Done(QPrintDialog* self, int result) { + self->done(static_cast(result)); +} + +void QPrintDialog_SetOption(QPrintDialog* self, int option) { + self->setOption(static_cast(option)); +} + +bool QPrintDialog_TestOption(const QPrintDialog* self, int option) { + return self->testOption(static_cast(option)); +} + +void QPrintDialog_SetOptions(QPrintDialog* self, int options) { + self->setOptions(static_cast(options)); +} + +int QPrintDialog_Options(const QPrintDialog* self) { + QAbstractPrintDialog::PrintDialogOptions _ret = self->options(); + return static_cast(_ret); +} + +void QPrintDialog_SetVisible(QPrintDialog* self, bool visible) { + self->setVisible(visible); +} + +void QPrintDialog_Accepted(QPrintDialog* self, QPrinter* printer) { + self->accepted(printer); +} + +void QPrintDialog_connect_Accepted(QPrintDialog* self, intptr_t slot) { + QPrintDialog::connect(self, static_cast(&QPrintDialog::accepted), self, [=](QPrinter* printer) { + QPrinter* sigval1 = printer; + miqt_exec_callback_QPrintDialog_Accepted(slot, sigval1); + }); +} + +struct miqt_string* QPrintDialog_Tr2(const char* s, const char* c) { + QString _ret = QPrintDialog::tr(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintDialog_Tr3(const char* s, const char* c, int n) { + QString _ret = QPrintDialog::tr(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintDialog_TrUtf82(const char* s, const char* c) { + QString _ret = QPrintDialog::trUtf8(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintDialog_TrUtf83(const char* s, const char* c, int n) { + QString _ret = QPrintDialog::trUtf8(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrintDialog_SetOption2(QPrintDialog* self, int option, bool on) { + self->setOption(static_cast(option), on); +} + +void QPrintDialog_Delete(QPrintDialog* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qprintdialog.go b/qt/qprintsupport/gen_qprintdialog.go new file mode 100644 index 00000000..32840703 --- /dev/null +++ b/qt/qprintsupport/gen_qprintdialog.go @@ -0,0 +1,212 @@ +package qprintsupport + +/* + +#include "gen_qprintdialog.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/qt" + "runtime" + "runtime/cgo" + "unsafe" +) + +type QPrintDialog struct { + h *C.QPrintDialog + *QAbstractPrintDialog +} + +func (this *QPrintDialog) cPointer() *C.QPrintDialog { + if this == nil { + return nil + } + return this.h +} + +func (this *QPrintDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQPrintDialog(h *C.QPrintDialog) *QPrintDialog { + if h == nil { + return nil + } + return &QPrintDialog{h: h, QAbstractPrintDialog: UnsafeNewQAbstractPrintDialog(unsafe.Pointer(h))} +} + +func UnsafeNewQPrintDialog(h unsafe.Pointer) *QPrintDialog { + return newQPrintDialog((*C.QPrintDialog)(h)) +} + +// NewQPrintDialog constructs a new QPrintDialog object. +func NewQPrintDialog(printer *QPrinter) *QPrintDialog { + ret := C.QPrintDialog_new(printer.cPointer()) + return newQPrintDialog(ret) +} + +// NewQPrintDialog2 constructs a new QPrintDialog object. +func NewQPrintDialog2() *QPrintDialog { + ret := C.QPrintDialog_new2() + return newQPrintDialog(ret) +} + +// NewQPrintDialog3 constructs a new QPrintDialog object. +func NewQPrintDialog3(printer *QPrinter, parent *qt.QWidget) *QPrintDialog { + ret := C.QPrintDialog_new3(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer())) + return newQPrintDialog(ret) +} + +// NewQPrintDialog4 constructs a new QPrintDialog object. +func NewQPrintDialog4(parent *qt.QWidget) *QPrintDialog { + ret := C.QPrintDialog_new4((*C.QWidget)(parent.UnsafePointer())) + return newQPrintDialog(ret) +} + +func (this *QPrintDialog) MetaObject() *qt.QMetaObject { + return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPrintDialog_MetaObject(this.h))) +} + +func (this *QPrintDialog) Metacast(param1 string) unsafe.Pointer { + param1_Cstring := C.CString(param1) + defer C.free(unsafe.Pointer(param1_Cstring)) + return C.QPrintDialog_Metacast(this.h, param1_Cstring) +} + +func QPrintDialog_Tr(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintDialog_Tr(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintDialog_TrUtf8(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintDialog_TrUtf8(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrintDialog) Exec() int { + return (int)(C.QPrintDialog_Exec(this.h)) +} + +func (this *QPrintDialog) Accept() { + C.QPrintDialog_Accept(this.h) +} + +func (this *QPrintDialog) Done(result int) { + C.QPrintDialog_Done(this.h, (C.int)(result)) +} + +func (this *QPrintDialog) SetOption(option QAbstractPrintDialog__PrintDialogOption) { + C.QPrintDialog_SetOption(this.h, (C.int)(option)) +} + +func (this *QPrintDialog) TestOption(option QAbstractPrintDialog__PrintDialogOption) bool { + return (bool)(C.QPrintDialog_TestOption(this.h, (C.int)(option))) +} + +func (this *QPrintDialog) SetOptions(options QAbstractPrintDialog__PrintDialogOption) { + C.QPrintDialog_SetOptions(this.h, (C.int)(options)) +} + +func (this *QPrintDialog) Options() QAbstractPrintDialog__PrintDialogOption { + return (QAbstractPrintDialog__PrintDialogOption)(C.QPrintDialog_Options(this.h)) +} + +func (this *QPrintDialog) SetVisible(visible bool) { + C.QPrintDialog_SetVisible(this.h, (C.bool)(visible)) +} + +func (this *QPrintDialog) Accepted(printer *QPrinter) { + C.QPrintDialog_Accepted(this.h, printer.cPointer()) +} +func (this *QPrintDialog) OnAccepted(slot func(printer *QPrinter)) { + C.QPrintDialog_connect_Accepted(this.h, C.intptr_t(cgo.NewHandle(slot))) +} + +//export miqt_exec_callback_QPrintDialog_Accepted +func miqt_exec_callback_QPrintDialog_Accepted(cb C.intptr_t, printer *C.QPrinter) { + gofunc, ok := cgo.Handle(cb).Value().(func(printer *QPrinter)) + if !ok { + panic("miqt: callback of non-callback type (heap corruption?)") + } + + // Convert all CABI parameters to Go parameters + slotval1 := UnsafeNewQPrinter(unsafe.Pointer(printer)) + + gofunc(slotval1) +} + +func QPrintDialog_Tr2(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintDialog_Tr2(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintDialog_Tr3(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintDialog_Tr3(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintDialog_TrUtf82(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintDialog_TrUtf82(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintDialog_TrUtf83(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintDialog_TrUtf83(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrintDialog) SetOption2(option QAbstractPrintDialog__PrintDialogOption, on bool) { + C.QPrintDialog_SetOption2(this.h, (C.int)(option), (C.bool)(on)) +} + +// Delete this object from C++ memory. +func (this *QPrintDialog) Delete() { + C.QPrintDialog_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QPrintDialog) GoGC() { + runtime.SetFinalizer(this, func(this *QPrintDialog) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qprintdialog.h b/qt/qprintsupport/gen_qprintdialog.h new file mode 100644 index 00000000..a29e0833 --- /dev/null +++ b/qt/qprintsupport/gen_qprintdialog.h @@ -0,0 +1,57 @@ +#ifndef GEN_QPRINTDIALOG_H +#define GEN_QPRINTDIALOG_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class QMetaObject; +class QPrintDialog; +class QPrinter; +class QWidget; +#else +typedef struct QMetaObject QMetaObject; +typedef struct QPrintDialog QPrintDialog; +typedef struct QPrinter QPrinter; +typedef struct QWidget QWidget; +#endif + +QPrintDialog* QPrintDialog_new(QPrinter* printer); +QPrintDialog* QPrintDialog_new2(); +QPrintDialog* QPrintDialog_new3(QPrinter* printer, QWidget* parent); +QPrintDialog* QPrintDialog_new4(QWidget* parent); +QMetaObject* QPrintDialog_MetaObject(const QPrintDialog* self); +void* QPrintDialog_Metacast(QPrintDialog* self, const char* param1); +struct miqt_string* QPrintDialog_Tr(const char* s); +struct miqt_string* QPrintDialog_TrUtf8(const char* s); +int QPrintDialog_Exec(QPrintDialog* self); +void QPrintDialog_Accept(QPrintDialog* self); +void QPrintDialog_Done(QPrintDialog* self, int result); +void QPrintDialog_SetOption(QPrintDialog* self, int option); +bool QPrintDialog_TestOption(const QPrintDialog* self, int option); +void QPrintDialog_SetOptions(QPrintDialog* self, int options); +int QPrintDialog_Options(const QPrintDialog* self); +void QPrintDialog_SetVisible(QPrintDialog* self, bool visible); +void QPrintDialog_Accepted(QPrintDialog* self, QPrinter* printer); +void QPrintDialog_connect_Accepted(QPrintDialog* self, intptr_t slot); +struct miqt_string* QPrintDialog_Tr2(const char* s, const char* c); +struct miqt_string* QPrintDialog_Tr3(const char* s, const char* c, int n); +struct miqt_string* QPrintDialog_TrUtf82(const char* s, const char* c); +struct miqt_string* QPrintDialog_TrUtf83(const char* s, const char* c, int n); +void QPrintDialog_SetOption2(QPrintDialog* self, int option, bool on); +void QPrintDialog_Delete(QPrintDialog* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif diff --git a/qt/qprintsupport/gen_qprintengine.cpp b/qt/qprintsupport/gen_qprintengine.cpp new file mode 100644 index 00000000..c4f4ea21 --- /dev/null +++ b/qt/qprintsupport/gen_qprintengine.cpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include "gen_qprintengine.h" +#include "_cgo_export.h" + +void QPrintEngine_SetProperty(QPrintEngine* self, int key, QVariant* value) { + self->setProperty(static_cast(key), *value); +} + +QVariant* QPrintEngine_Property(const QPrintEngine* self, int key) { + return new QVariant(self->property(static_cast(key))); +} + +bool QPrintEngine_NewPage(QPrintEngine* self) { + return self->newPage(); +} + +bool QPrintEngine_Abort(QPrintEngine* self) { + return self->abort(); +} + +int QPrintEngine_Metric(const QPrintEngine* self, int param1) { + return self->metric(static_cast(param1)); +} + +int QPrintEngine_PrinterState(const QPrintEngine* self) { + QPrinter::PrinterState _ret = self->printerState(); + return static_cast(_ret); +} + +void QPrintEngine_OperatorAssign(QPrintEngine* self, QPrintEngine* param1) { + self->operator=(*param1); +} + +void QPrintEngine_Delete(QPrintEngine* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qprintengine.go b/qt/qprintsupport/gen_qprintengine.go new file mode 100644 index 00000000..490aafd7 --- /dev/null +++ b/qt/qprintsupport/gen_qprintengine.go @@ -0,0 +1,126 @@ +package qprintsupport + +/* + +#include "gen_qprintengine.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/qt" + "runtime" + "unsafe" +) + +type QPrintEngine__PrintEnginePropertyKey int + +const ( + QPrintEngine__PPK_CollateCopies QPrintEngine__PrintEnginePropertyKey = 0 + QPrintEngine__PPK_ColorMode QPrintEngine__PrintEnginePropertyKey = 1 + QPrintEngine__PPK_Creator QPrintEngine__PrintEnginePropertyKey = 2 + QPrintEngine__PPK_DocumentName QPrintEngine__PrintEnginePropertyKey = 3 + QPrintEngine__PPK_FullPage QPrintEngine__PrintEnginePropertyKey = 4 + QPrintEngine__PPK_NumberOfCopies QPrintEngine__PrintEnginePropertyKey = 5 + QPrintEngine__PPK_Orientation QPrintEngine__PrintEnginePropertyKey = 6 + QPrintEngine__PPK_OutputFileName QPrintEngine__PrintEnginePropertyKey = 7 + QPrintEngine__PPK_PageOrder QPrintEngine__PrintEnginePropertyKey = 8 + QPrintEngine__PPK_PageRect QPrintEngine__PrintEnginePropertyKey = 9 + QPrintEngine__PPK_PageSize QPrintEngine__PrintEnginePropertyKey = 10 + QPrintEngine__PPK_PaperRect QPrintEngine__PrintEnginePropertyKey = 11 + QPrintEngine__PPK_PaperSource QPrintEngine__PrintEnginePropertyKey = 12 + QPrintEngine__PPK_PrinterName QPrintEngine__PrintEnginePropertyKey = 13 + QPrintEngine__PPK_PrinterProgram QPrintEngine__PrintEnginePropertyKey = 14 + QPrintEngine__PPK_Resolution QPrintEngine__PrintEnginePropertyKey = 15 + QPrintEngine__PPK_SelectionOption QPrintEngine__PrintEnginePropertyKey = 16 + QPrintEngine__PPK_SupportedResolutions QPrintEngine__PrintEnginePropertyKey = 17 + QPrintEngine__PPK_WindowsPageSize QPrintEngine__PrintEnginePropertyKey = 18 + QPrintEngine__PPK_FontEmbedding QPrintEngine__PrintEnginePropertyKey = 19 + QPrintEngine__PPK_Duplex QPrintEngine__PrintEnginePropertyKey = 20 + QPrintEngine__PPK_PaperSources QPrintEngine__PrintEnginePropertyKey = 21 + QPrintEngine__PPK_CustomPaperSize QPrintEngine__PrintEnginePropertyKey = 22 + QPrintEngine__PPK_PageMargins QPrintEngine__PrintEnginePropertyKey = 23 + QPrintEngine__PPK_CopyCount QPrintEngine__PrintEnginePropertyKey = 24 + QPrintEngine__PPK_SupportsMultipleCopies QPrintEngine__PrintEnginePropertyKey = 25 + QPrintEngine__PPK_PaperName QPrintEngine__PrintEnginePropertyKey = 26 + QPrintEngine__PPK_QPageSize QPrintEngine__PrintEnginePropertyKey = 27 + QPrintEngine__PPK_QPageMargins QPrintEngine__PrintEnginePropertyKey = 28 + QPrintEngine__PPK_QPageLayout QPrintEngine__PrintEnginePropertyKey = 29 + QPrintEngine__PPK_PaperSize QPrintEngine__PrintEnginePropertyKey = 10 + QPrintEngine__PPK_CustomBase QPrintEngine__PrintEnginePropertyKey = 65280 +) + +type QPrintEngine struct { + h *C.QPrintEngine +} + +func (this *QPrintEngine) cPointer() *C.QPrintEngine { + if this == nil { + return nil + } + return this.h +} + +func (this *QPrintEngine) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQPrintEngine(h *C.QPrintEngine) *QPrintEngine { + if h == nil { + return nil + } + return &QPrintEngine{h: h} +} + +func UnsafeNewQPrintEngine(h unsafe.Pointer) *QPrintEngine { + return newQPrintEngine((*C.QPrintEngine)(h)) +} + +func (this *QPrintEngine) SetProperty(key QPrintEngine__PrintEnginePropertyKey, value *qt.QVariant) { + C.QPrintEngine_SetProperty(this.h, (C.int)(key), (*C.QVariant)(value.UnsafePointer())) +} + +func (this *QPrintEngine) Property(key QPrintEngine__PrintEnginePropertyKey) *qt.QVariant { + _ret := C.QPrintEngine_Property(this.h, (C.int)(key)) + _goptr := qt.UnsafeNewQVariant(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrintEngine) NewPage() bool { + return (bool)(C.QPrintEngine_NewPage(this.h)) +} + +func (this *QPrintEngine) Abort() bool { + return (bool)(C.QPrintEngine_Abort(this.h)) +} + +func (this *QPrintEngine) Metric(param1 qt.QPaintDevice__PaintDeviceMetric) int { + return (int)(C.QPrintEngine_Metric(this.h, (C.int)(param1))) +} + +func (this *QPrintEngine) PrinterState() QPrinter__PrinterState { + return (QPrinter__PrinterState)(C.QPrintEngine_PrinterState(this.h)) +} + +func (this *QPrintEngine) OperatorAssign(param1 *QPrintEngine) { + C.QPrintEngine_OperatorAssign(this.h, param1.cPointer()) +} + +// Delete this object from C++ memory. +func (this *QPrintEngine) Delete() { + C.QPrintEngine_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QPrintEngine) GoGC() { + runtime.SetFinalizer(this, func(this *QPrintEngine) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qprintengine.h b/qt/qprintsupport/gen_qprintengine.h new file mode 100644 index 00000000..c29d9bd5 --- /dev/null +++ b/qt/qprintsupport/gen_qprintengine.h @@ -0,0 +1,37 @@ +#ifndef GEN_QPRINTENGINE_H +#define GEN_QPRINTENGINE_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class QPrintEngine; +class QVariant; +#else +typedef struct QPrintEngine QPrintEngine; +typedef struct QVariant QVariant; +#endif + +void QPrintEngine_SetProperty(QPrintEngine* self, int key, QVariant* value); +QVariant* QPrintEngine_Property(const QPrintEngine* self, int key); +bool QPrintEngine_NewPage(QPrintEngine* self); +bool QPrintEngine_Abort(QPrintEngine* self); +int QPrintEngine_Metric(const QPrintEngine* self, int param1); +int QPrintEngine_PrinterState(const QPrintEngine* self); +void QPrintEngine_OperatorAssign(QPrintEngine* self, QPrintEngine* param1); +void QPrintEngine_Delete(QPrintEngine* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif diff --git a/qt/qprintsupport/gen_qprinter.cpp b/qt/qprintsupport/gen_qprinter.cpp new file mode 100644 index 00000000..91a90a77 --- /dev/null +++ b/qt/qprintsupport/gen_qprinter.cpp @@ -0,0 +1,376 @@ +#include +#define WORKAROUND_INNER_CLASS_DEFINITION_QPagedPaintDevice__Margins +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "gen_qprinter.h" +#include "_cgo_export.h" + +QPrinter* QPrinter_new() { + return new QPrinter(); +} + +QPrinter* QPrinter_new2(QPrinterInfo* printer) { + return new QPrinter(*printer); +} + +QPrinter* QPrinter_new3(int mode) { + return new QPrinter(static_cast(mode)); +} + +QPrinter* QPrinter_new4(QPrinterInfo* printer, int mode) { + return new QPrinter(*printer, static_cast(mode)); +} + +int QPrinter_DevType(const QPrinter* self) { + return self->devType(); +} + +void QPrinter_SetOutputFormat(QPrinter* self, int format) { + self->setOutputFormat(static_cast(format)); +} + +int QPrinter_OutputFormat(const QPrinter* self) { + QPrinter::OutputFormat _ret = self->outputFormat(); + return static_cast(_ret); +} + +void QPrinter_SetPdfVersion(QPrinter* self, int version) { + self->setPdfVersion(static_cast(version)); +} + +int QPrinter_PdfVersion(const QPrinter* self) { + QPagedPaintDevice::PdfVersion _ret = self->pdfVersion(); + return static_cast(_ret); +} + +void QPrinter_SetPrinterName(QPrinter* self, struct miqt_string* printerName) { + QString printerName_QString = QString::fromUtf8(&printerName->data, printerName->len); + self->setPrinterName(printerName_QString); +} + +struct miqt_string* QPrinter_PrinterName(const QPrinter* self) { + QString _ret = self->printerName(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +bool QPrinter_IsValid(const QPrinter* self) { + return self->isValid(); +} + +void QPrinter_SetOutputFileName(QPrinter* self, struct miqt_string* outputFileName) { + QString outputFileName_QString = QString::fromUtf8(&outputFileName->data, outputFileName->len); + self->setOutputFileName(outputFileName_QString); +} + +struct miqt_string* QPrinter_OutputFileName(const QPrinter* self) { + QString _ret = self->outputFileName(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrinter_SetPrintProgram(QPrinter* self, struct miqt_string* printProgram) { + QString printProgram_QString = QString::fromUtf8(&printProgram->data, printProgram->len); + self->setPrintProgram(printProgram_QString); +} + +struct miqt_string* QPrinter_PrintProgram(const QPrinter* self) { + QString _ret = self->printProgram(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrinter_SetDocName(QPrinter* self, struct miqt_string* docName) { + QString docName_QString = QString::fromUtf8(&docName->data, docName->len); + self->setDocName(docName_QString); +} + +struct miqt_string* QPrinter_DocName(const QPrinter* self) { + QString _ret = self->docName(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrinter_SetCreator(QPrinter* self, struct miqt_string* creator) { + QString creator_QString = QString::fromUtf8(&creator->data, creator->len); + self->setCreator(creator_QString); +} + +struct miqt_string* QPrinter_Creator(const QPrinter* self) { + QString _ret = self->creator(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrinter_SetOrientation(QPrinter* self, int orientation) { + self->setOrientation(static_cast(orientation)); +} + +int QPrinter_Orientation(const QPrinter* self) { + QPrinter::Orientation _ret = self->orientation(); + return static_cast(_ret); +} + +void QPrinter_SetPageSize(QPrinter* self, int pageSize) { + self->setPageSize(static_cast(pageSize)); +} + +int QPrinter_PageSize(const QPrinter* self) { + QPagedPaintDevice::PageSize _ret = self->pageSize(); + return static_cast(_ret); +} + +void QPrinter_SetPageSizeMM(QPrinter* self, QSizeF* size) { + self->setPageSizeMM(*size); +} + +void QPrinter_SetPaperSize(QPrinter* self, int paperSize) { + self->setPaperSize(static_cast(paperSize)); +} + +int QPrinter_PaperSize(const QPrinter* self) { + QPrinter::PaperSize _ret = self->paperSize(); + return static_cast(_ret); +} + +void QPrinter_SetPaperSize2(QPrinter* self, QSizeF* paperSize, int unit) { + self->setPaperSize(*paperSize, static_cast(unit)); +} + +QSizeF* QPrinter_PaperSizeWithUnit(const QPrinter* self, int unit) { + return new QSizeF(self->paperSize(static_cast(unit))); +} + +void QPrinter_SetPaperName(QPrinter* self, struct miqt_string* paperName) { + QString paperName_QString = QString::fromUtf8(&paperName->data, paperName->len); + self->setPaperName(paperName_QString); +} + +struct miqt_string* QPrinter_PaperName(const QPrinter* self) { + QString _ret = self->paperName(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrinter_SetPageOrder(QPrinter* self, int pageOrder) { + self->setPageOrder(static_cast(pageOrder)); +} + +int QPrinter_PageOrder(const QPrinter* self) { + QPrinter::PageOrder _ret = self->pageOrder(); + return static_cast(_ret); +} + +void QPrinter_SetResolution(QPrinter* self, int resolution) { + self->setResolution(static_cast(resolution)); +} + +int QPrinter_Resolution(const QPrinter* self) { + return self->resolution(); +} + +void QPrinter_SetColorMode(QPrinter* self, int colorMode) { + self->setColorMode(static_cast(colorMode)); +} + +int QPrinter_ColorMode(const QPrinter* self) { + QPrinter::ColorMode _ret = self->colorMode(); + return static_cast(_ret); +} + +void QPrinter_SetCollateCopies(QPrinter* self, bool collate) { + self->setCollateCopies(collate); +} + +bool QPrinter_CollateCopies(const QPrinter* self) { + return self->collateCopies(); +} + +void QPrinter_SetFullPage(QPrinter* self, bool fullPage) { + self->setFullPage(fullPage); +} + +bool QPrinter_FullPage(const QPrinter* self) { + return self->fullPage(); +} + +void QPrinter_SetNumCopies(QPrinter* self, int numCopies) { + self->setNumCopies(static_cast(numCopies)); +} + +int QPrinter_NumCopies(const QPrinter* self) { + return self->numCopies(); +} + +int QPrinter_ActualNumCopies(const QPrinter* self) { + return self->actualNumCopies(); +} + +void QPrinter_SetCopyCount(QPrinter* self, int copyCount) { + self->setCopyCount(static_cast(copyCount)); +} + +int QPrinter_CopyCount(const QPrinter* self) { + return self->copyCount(); +} + +bool QPrinter_SupportsMultipleCopies(const QPrinter* self) { + return self->supportsMultipleCopies(); +} + +void QPrinter_SetPaperSource(QPrinter* self, int paperSource) { + self->setPaperSource(static_cast(paperSource)); +} + +int QPrinter_PaperSource(const QPrinter* self) { + QPrinter::PaperSource _ret = self->paperSource(); + return static_cast(_ret); +} + +void QPrinter_SetDuplex(QPrinter* self, int duplex) { + self->setDuplex(static_cast(duplex)); +} + +int QPrinter_Duplex(const QPrinter* self) { + QPrinter::DuplexMode _ret = self->duplex(); + return static_cast(_ret); +} + +struct miqt_array* QPrinter_SupportedResolutions(const QPrinter* self) { + QList _ret = self->supportedResolutions(); + // Convert QList<> from C++ memory to manually-managed C memory + int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + _arr[i] = _ret[i]; + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +void QPrinter_SetFontEmbeddingEnabled(QPrinter* self, bool enable) { + self->setFontEmbeddingEnabled(enable); +} + +bool QPrinter_FontEmbeddingEnabled(const QPrinter* self) { + return self->fontEmbeddingEnabled(); +} + +void QPrinter_SetDoubleSidedPrinting(QPrinter* self, bool enable) { + self->setDoubleSidedPrinting(enable); +} + +bool QPrinter_DoubleSidedPrinting(const QPrinter* self) { + return self->doubleSidedPrinting(); +} + +void QPrinter_SetWinPageSize(QPrinter* self, int winPageSize) { + self->setWinPageSize(static_cast(winPageSize)); +} + +int QPrinter_WinPageSize(const QPrinter* self) { + return self->winPageSize(); +} + +QRect* QPrinter_PaperRect(const QPrinter* self) { + return new QRect(self->paperRect()); +} + +QRect* QPrinter_PageRect(const QPrinter* self) { + return new QRect(self->pageRect()); +} + +QRectF* QPrinter_PaperRectWithQPrinterUnit(const QPrinter* self, int param1) { + return new QRectF(self->paperRect(static_cast(param1))); +} + +QRectF* QPrinter_PageRectWithQPrinterUnit(const QPrinter* self, int param1) { + return new QRectF(self->pageRect(static_cast(param1))); +} + +struct miqt_string* QPrinter_PrinterSelectionOption(const QPrinter* self) { + QString _ret = self->printerSelectionOption(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrinter_SetPrinterSelectionOption(QPrinter* self, struct miqt_string* printerSelectionOption) { + QString printerSelectionOption_QString = QString::fromUtf8(&printerSelectionOption->data, printerSelectionOption->len); + self->setPrinterSelectionOption(printerSelectionOption_QString); +} + +bool QPrinter_NewPage(QPrinter* self) { + return self->newPage(); +} + +bool QPrinter_Abort(QPrinter* self) { + return self->abort(); +} + +int QPrinter_PrinterState(const QPrinter* self) { + QPrinter::PrinterState _ret = self->printerState(); + return static_cast(_ret); +} + +QPaintEngine* QPrinter_PaintEngine(const QPrinter* self) { + return self->paintEngine(); +} + +QPrintEngine* QPrinter_PrintEngine(const QPrinter* self) { + return self->printEngine(); +} + +void QPrinter_SetFromTo(QPrinter* self, int fromPage, int toPage) { + self->setFromTo(static_cast(fromPage), static_cast(toPage)); +} + +int QPrinter_FromPage(const QPrinter* self) { + return self->fromPage(); +} + +int QPrinter_ToPage(const QPrinter* self) { + return self->toPage(); +} + +void QPrinter_SetPrintRange(QPrinter* self, int rangeVal) { + self->setPrintRange(static_cast(rangeVal)); +} + +int QPrinter_PrintRange(const QPrinter* self) { + QPrinter::PrintRange _ret = self->printRange(); + return static_cast(_ret); +} + +void QPrinter_SetMargins(QPrinter* self, QPagedPaintDevice__Margins* m) { + self->setMargins(*m); +} + +void QPrinter_SetPageMargins(QPrinter* self, double left, double top, double right, double bottom, int unit) { + self->setPageMargins(static_cast(left), static_cast(top), static_cast(right), static_cast(bottom), static_cast(unit)); +} + +void QPrinter_GetPageMargins(const QPrinter* self, double* left, double* top, double* right, double* bottom, int unit) { + self->getPageMargins(static_cast(left), static_cast(top), static_cast(right), static_cast(bottom), static_cast(unit)); +} + +void QPrinter_Delete(QPrinter* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qprinter.go b/qt/qprintsupport/gen_qprinter.go new file mode 100644 index 00000000..47605023 --- /dev/null +++ b/qt/qprintsupport/gen_qprinter.go @@ -0,0 +1,530 @@ +package qprintsupport + +/* + +#include "gen_qprinter.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/libmiqt" + "github.com/mappu/miqt/qt" + "runtime" + "unsafe" +) + +type QPrinter__PrinterMode int + +const ( + QPrinter__ScreenResolution QPrinter__PrinterMode = 0 + QPrinter__PrinterResolution QPrinter__PrinterMode = 1 + QPrinter__HighResolution QPrinter__PrinterMode = 2 +) + +type QPrinter__Orientation int + +const ( + QPrinter__Portrait QPrinter__Orientation = 0 + QPrinter__Landscape QPrinter__Orientation = 1 +) + +type QPrinter__PageOrder int + +const ( + QPrinter__FirstPageFirst QPrinter__PageOrder = 0 + QPrinter__LastPageFirst QPrinter__PageOrder = 1 +) + +type QPrinter__ColorMode int + +const ( + QPrinter__GrayScale QPrinter__ColorMode = 0 + QPrinter__Color QPrinter__ColorMode = 1 +) + +type QPrinter__PaperSource int + +const ( + QPrinter__OnlyOne QPrinter__PaperSource = 0 + QPrinter__Lower QPrinter__PaperSource = 1 + QPrinter__Middle QPrinter__PaperSource = 2 + QPrinter__Manual QPrinter__PaperSource = 3 + QPrinter__Envelope QPrinter__PaperSource = 4 + QPrinter__EnvelopeManual QPrinter__PaperSource = 5 + QPrinter__Auto QPrinter__PaperSource = 6 + QPrinter__Tractor QPrinter__PaperSource = 7 + QPrinter__SmallFormat QPrinter__PaperSource = 8 + QPrinter__LargeFormat QPrinter__PaperSource = 9 + QPrinter__LargeCapacity QPrinter__PaperSource = 10 + QPrinter__Cassette QPrinter__PaperSource = 11 + QPrinter__FormSource QPrinter__PaperSource = 12 + QPrinter__MaxPageSource QPrinter__PaperSource = 13 + QPrinter__CustomSource QPrinter__PaperSource = 14 + QPrinter__LastPaperSource QPrinter__PaperSource = 14 + QPrinter__Upper QPrinter__PaperSource = 0 +) + +type QPrinter__PrinterState int + +const ( + QPrinter__Idle QPrinter__PrinterState = 0 + QPrinter__Active QPrinter__PrinterState = 1 + QPrinter__Aborted QPrinter__PrinterState = 2 + QPrinter__Error QPrinter__PrinterState = 3 +) + +type QPrinter__OutputFormat int + +const ( + QPrinter__NativeFormat QPrinter__OutputFormat = 0 + QPrinter__PdfFormat QPrinter__OutputFormat = 1 +) + +type QPrinter__PrintRange int + +const ( + QPrinter__AllPages QPrinter__PrintRange = 0 + QPrinter__Selection QPrinter__PrintRange = 1 + QPrinter__PageRange QPrinter__PrintRange = 2 + QPrinter__CurrentPage QPrinter__PrintRange = 3 +) + +type QPrinter__Unit int + +const ( + QPrinter__Millimeter QPrinter__Unit = 0 + QPrinter__Point QPrinter__Unit = 1 + QPrinter__Inch QPrinter__Unit = 2 + QPrinter__Pica QPrinter__Unit = 3 + QPrinter__Didot QPrinter__Unit = 4 + QPrinter__Cicero QPrinter__Unit = 5 + QPrinter__DevicePixel QPrinter__Unit = 6 +) + +type QPrinter__DuplexMode int + +const ( + QPrinter__DuplexNone QPrinter__DuplexMode = 0 + QPrinter__DuplexAuto QPrinter__DuplexMode = 1 + QPrinter__DuplexLongSide QPrinter__DuplexMode = 2 + QPrinter__DuplexShortSide QPrinter__DuplexMode = 3 +) + +type QPrinter struct { + h *C.QPrinter + *qt.QPagedPaintDevice +} + +func (this *QPrinter) cPointer() *C.QPrinter { + if this == nil { + return nil + } + return this.h +} + +func (this *QPrinter) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQPrinter(h *C.QPrinter) *QPrinter { + if h == nil { + return nil + } + return &QPrinter{h: h, QPagedPaintDevice: qt.UnsafeNewQPagedPaintDevice(unsafe.Pointer(h))} +} + +func UnsafeNewQPrinter(h unsafe.Pointer) *QPrinter { + return newQPrinter((*C.QPrinter)(h)) +} + +// NewQPrinter constructs a new QPrinter object. +func NewQPrinter() *QPrinter { + ret := C.QPrinter_new() + return newQPrinter(ret) +} + +// NewQPrinter2 constructs a new QPrinter object. +func NewQPrinter2(printer *QPrinterInfo) *QPrinter { + ret := C.QPrinter_new2(printer.cPointer()) + return newQPrinter(ret) +} + +// NewQPrinter3 constructs a new QPrinter object. +func NewQPrinter3(mode QPrinter__PrinterMode) *QPrinter { + ret := C.QPrinter_new3((C.int)(mode)) + return newQPrinter(ret) +} + +// NewQPrinter4 constructs a new QPrinter object. +func NewQPrinter4(printer *QPrinterInfo, mode QPrinter__PrinterMode) *QPrinter { + ret := C.QPrinter_new4(printer.cPointer(), (C.int)(mode)) + return newQPrinter(ret) +} + +func (this *QPrinter) DevType() int { + return (int)(C.QPrinter_DevType(this.h)) +} + +func (this *QPrinter) SetOutputFormat(format QPrinter__OutputFormat) { + C.QPrinter_SetOutputFormat(this.h, (C.int)(format)) +} + +func (this *QPrinter) OutputFormat() QPrinter__OutputFormat { + return (QPrinter__OutputFormat)(C.QPrinter_OutputFormat(this.h)) +} + +func (this *QPrinter) SetPdfVersion(version qt.QPagedPaintDevice__PdfVersion) { + C.QPrinter_SetPdfVersion(this.h, (C.int)(version)) +} + +func (this *QPrinter) PdfVersion() qt.QPagedPaintDevice__PdfVersion { + return (qt.QPagedPaintDevice__PdfVersion)(C.QPrinter_PdfVersion(this.h)) +} + +func (this *QPrinter) SetPrinterName(printerName string) { + printerName_ms := libmiqt.Strdupg(printerName) + defer C.free(printerName_ms) + C.QPrinter_SetPrinterName(this.h, (*C.struct_miqt_string)(printerName_ms)) +} + +func (this *QPrinter) PrinterName() string { + var _ms *C.struct_miqt_string = C.QPrinter_PrinterName(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinter) IsValid() bool { + return (bool)(C.QPrinter_IsValid(this.h)) +} + +func (this *QPrinter) SetOutputFileName(outputFileName string) { + outputFileName_ms := libmiqt.Strdupg(outputFileName) + defer C.free(outputFileName_ms) + C.QPrinter_SetOutputFileName(this.h, (*C.struct_miqt_string)(outputFileName_ms)) +} + +func (this *QPrinter) OutputFileName() string { + var _ms *C.struct_miqt_string = C.QPrinter_OutputFileName(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinter) SetPrintProgram(printProgram string) { + printProgram_ms := libmiqt.Strdupg(printProgram) + defer C.free(printProgram_ms) + C.QPrinter_SetPrintProgram(this.h, (*C.struct_miqt_string)(printProgram_ms)) +} + +func (this *QPrinter) PrintProgram() string { + var _ms *C.struct_miqt_string = C.QPrinter_PrintProgram(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinter) SetDocName(docName string) { + docName_ms := libmiqt.Strdupg(docName) + defer C.free(docName_ms) + C.QPrinter_SetDocName(this.h, (*C.struct_miqt_string)(docName_ms)) +} + +func (this *QPrinter) DocName() string { + var _ms *C.struct_miqt_string = C.QPrinter_DocName(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinter) SetCreator(creator string) { + creator_ms := libmiqt.Strdupg(creator) + defer C.free(creator_ms) + C.QPrinter_SetCreator(this.h, (*C.struct_miqt_string)(creator_ms)) +} + +func (this *QPrinter) Creator() string { + var _ms *C.struct_miqt_string = C.QPrinter_Creator(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinter) SetOrientation(orientation QPrinter__Orientation) { + C.QPrinter_SetOrientation(this.h, (C.int)(orientation)) +} + +func (this *QPrinter) Orientation() QPrinter__Orientation { + return (QPrinter__Orientation)(C.QPrinter_Orientation(this.h)) +} + +func (this *QPrinter) SetPageSize(pageSize qt.QPagedPaintDevice__PageSize) { + C.QPrinter_SetPageSize(this.h, (C.int)(pageSize)) +} + +func (this *QPrinter) PageSize() qt.QPagedPaintDevice__PageSize { + return (qt.QPagedPaintDevice__PageSize)(C.QPrinter_PageSize(this.h)) +} + +func (this *QPrinter) SetPageSizeMM(size *qt.QSizeF) { + C.QPrinter_SetPageSizeMM(this.h, (*C.QSizeF)(size.UnsafePointer())) +} + +func (this *QPrinter) SetPaperSize(paperSize qt.QPagedPaintDevice__PageSize) { + C.QPrinter_SetPaperSize(this.h, (C.int)(paperSize)) +} + +func (this *QPrinter) PaperSize() qt.QPagedPaintDevice__PageSize { + return (qt.QPagedPaintDevice__PageSize)(C.QPrinter_PaperSize(this.h)) +} + +func (this *QPrinter) SetPaperSize2(paperSize *qt.QSizeF, unit QPrinter__Unit) { + C.QPrinter_SetPaperSize2(this.h, (*C.QSizeF)(paperSize.UnsafePointer()), (C.int)(unit)) +} + +func (this *QPrinter) PaperSizeWithUnit(unit QPrinter__Unit) *qt.QSizeF { + _ret := C.QPrinter_PaperSizeWithUnit(this.h, (C.int)(unit)) + _goptr := qt.UnsafeNewQSizeF(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinter) SetPaperName(paperName string) { + paperName_ms := libmiqt.Strdupg(paperName) + defer C.free(paperName_ms) + C.QPrinter_SetPaperName(this.h, (*C.struct_miqt_string)(paperName_ms)) +} + +func (this *QPrinter) PaperName() string { + var _ms *C.struct_miqt_string = C.QPrinter_PaperName(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinter) SetPageOrder(pageOrder QPrinter__PageOrder) { + C.QPrinter_SetPageOrder(this.h, (C.int)(pageOrder)) +} + +func (this *QPrinter) PageOrder() QPrinter__PageOrder { + return (QPrinter__PageOrder)(C.QPrinter_PageOrder(this.h)) +} + +func (this *QPrinter) SetResolution(resolution int) { + C.QPrinter_SetResolution(this.h, (C.int)(resolution)) +} + +func (this *QPrinter) Resolution() int { + return (int)(C.QPrinter_Resolution(this.h)) +} + +func (this *QPrinter) SetColorMode(colorMode QPrinter__ColorMode) { + C.QPrinter_SetColorMode(this.h, (C.int)(colorMode)) +} + +func (this *QPrinter) ColorMode() QPrinter__ColorMode { + return (QPrinter__ColorMode)(C.QPrinter_ColorMode(this.h)) +} + +func (this *QPrinter) SetCollateCopies(collate bool) { + C.QPrinter_SetCollateCopies(this.h, (C.bool)(collate)) +} + +func (this *QPrinter) CollateCopies() bool { + return (bool)(C.QPrinter_CollateCopies(this.h)) +} + +func (this *QPrinter) SetFullPage(fullPage bool) { + C.QPrinter_SetFullPage(this.h, (C.bool)(fullPage)) +} + +func (this *QPrinter) FullPage() bool { + return (bool)(C.QPrinter_FullPage(this.h)) +} + +func (this *QPrinter) SetNumCopies(numCopies int) { + C.QPrinter_SetNumCopies(this.h, (C.int)(numCopies)) +} + +func (this *QPrinter) NumCopies() int { + return (int)(C.QPrinter_NumCopies(this.h)) +} + +func (this *QPrinter) ActualNumCopies() int { + return (int)(C.QPrinter_ActualNumCopies(this.h)) +} + +func (this *QPrinter) SetCopyCount(copyCount int) { + C.QPrinter_SetCopyCount(this.h, (C.int)(copyCount)) +} + +func (this *QPrinter) CopyCount() int { + return (int)(C.QPrinter_CopyCount(this.h)) +} + +func (this *QPrinter) SupportsMultipleCopies() bool { + return (bool)(C.QPrinter_SupportsMultipleCopies(this.h)) +} + +func (this *QPrinter) SetPaperSource(paperSource QPrinter__PaperSource) { + C.QPrinter_SetPaperSource(this.h, (C.int)(paperSource)) +} + +func (this *QPrinter) PaperSource() QPrinter__PaperSource { + return (QPrinter__PaperSource)(C.QPrinter_PaperSource(this.h)) +} + +func (this *QPrinter) SetDuplex(duplex QPrinter__DuplexMode) { + C.QPrinter_SetDuplex(this.h, (C.int)(duplex)) +} + +func (this *QPrinter) Duplex() QPrinter__DuplexMode { + return (QPrinter__DuplexMode)(C.QPrinter_Duplex(this.h)) +} + +func (this *QPrinter) SupportedResolutions() []int { + var _ma *C.struct_miqt_array = C.QPrinter_SupportedResolutions(this.h) + _ret := make([]int, int(_ma.len)) + _outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + _ret[i] = (int)(_outCast[i]) + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func (this *QPrinter) SetFontEmbeddingEnabled(enable bool) { + C.QPrinter_SetFontEmbeddingEnabled(this.h, (C.bool)(enable)) +} + +func (this *QPrinter) FontEmbeddingEnabled() bool { + return (bool)(C.QPrinter_FontEmbeddingEnabled(this.h)) +} + +func (this *QPrinter) SetDoubleSidedPrinting(enable bool) { + C.QPrinter_SetDoubleSidedPrinting(this.h, (C.bool)(enable)) +} + +func (this *QPrinter) DoubleSidedPrinting() bool { + return (bool)(C.QPrinter_DoubleSidedPrinting(this.h)) +} + +func (this *QPrinter) SetWinPageSize(winPageSize int) { + C.QPrinter_SetWinPageSize(this.h, (C.int)(winPageSize)) +} + +func (this *QPrinter) WinPageSize() int { + return (int)(C.QPrinter_WinPageSize(this.h)) +} + +func (this *QPrinter) PaperRect() *qt.QRect { + _ret := C.QPrinter_PaperRect(this.h) + _goptr := qt.UnsafeNewQRect(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinter) PageRect() *qt.QRect { + _ret := C.QPrinter_PageRect(this.h) + _goptr := qt.UnsafeNewQRect(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinter) PaperRectWithQPrinterUnit(param1 QPrinter__Unit) *qt.QRectF { + _ret := C.QPrinter_PaperRectWithQPrinterUnit(this.h, (C.int)(param1)) + _goptr := qt.UnsafeNewQRectF(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinter) PageRectWithQPrinterUnit(param1 QPrinter__Unit) *qt.QRectF { + _ret := C.QPrinter_PageRectWithQPrinterUnit(this.h, (C.int)(param1)) + _goptr := qt.UnsafeNewQRectF(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinter) PrinterSelectionOption() string { + var _ms *C.struct_miqt_string = C.QPrinter_PrinterSelectionOption(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinter) SetPrinterSelectionOption(printerSelectionOption string) { + printerSelectionOption_ms := libmiqt.Strdupg(printerSelectionOption) + defer C.free(printerSelectionOption_ms) + C.QPrinter_SetPrinterSelectionOption(this.h, (*C.struct_miqt_string)(printerSelectionOption_ms)) +} + +func (this *QPrinter) NewPage() bool { + return (bool)(C.QPrinter_NewPage(this.h)) +} + +func (this *QPrinter) Abort() bool { + return (bool)(C.QPrinter_Abort(this.h)) +} + +func (this *QPrinter) PrinterState() QPrinter__PrinterState { + return (QPrinter__PrinterState)(C.QPrinter_PrinterState(this.h)) +} + +func (this *QPrinter) PaintEngine() *qt.QPaintEngine { + return qt.UnsafeNewQPaintEngine(unsafe.Pointer(C.QPrinter_PaintEngine(this.h))) +} + +func (this *QPrinter) PrintEngine() *QPrintEngine { + return UnsafeNewQPrintEngine(unsafe.Pointer(C.QPrinter_PrintEngine(this.h))) +} + +func (this *QPrinter) SetFromTo(fromPage int, toPage int) { + C.QPrinter_SetFromTo(this.h, (C.int)(fromPage), (C.int)(toPage)) +} + +func (this *QPrinter) FromPage() int { + return (int)(C.QPrinter_FromPage(this.h)) +} + +func (this *QPrinter) ToPage() int { + return (int)(C.QPrinter_ToPage(this.h)) +} + +func (this *QPrinter) SetPrintRange(rangeVal QPrinter__PrintRange) { + C.QPrinter_SetPrintRange(this.h, (C.int)(rangeVal)) +} + +func (this *QPrinter) PrintRange() QPrinter__PrintRange { + return (QPrinter__PrintRange)(C.QPrinter_PrintRange(this.h)) +} + +func (this *QPrinter) SetMargins(m *qt.QPagedPaintDevice__Margins) { + C.QPrinter_SetMargins(this.h, (*C.QPagedPaintDevice__Margins)(m.UnsafePointer())) +} + +func (this *QPrinter) SetPageMargins(left float64, top float64, right float64, bottom float64, unit QPrinter__Unit) { + C.QPrinter_SetPageMargins(this.h, (C.double)(left), (C.double)(top), (C.double)(right), (C.double)(bottom), (C.int)(unit)) +} + +func (this *QPrinter) GetPageMargins(left *float64, top *float64, right *float64, bottom *float64, unit QPrinter__Unit) { + C.QPrinter_GetPageMargins(this.h, (*C.double)(unsafe.Pointer(left)), (*C.double)(unsafe.Pointer(top)), (*C.double)(unsafe.Pointer(right)), (*C.double)(unsafe.Pointer(bottom)), (C.int)(unit)) +} + +// Delete this object from C++ memory. +func (this *QPrinter) Delete() { + C.QPrinter_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QPrinter) GoGC() { + runtime.SetFinalizer(this, func(this *QPrinter) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qprinter.h b/qt/qprintsupport/gen_qprinter.h new file mode 100644 index 00000000..8f73d053 --- /dev/null +++ b/qt/qprintsupport/gen_qprinter.h @@ -0,0 +1,123 @@ +#ifndef GEN_QPRINTER_H +#define GEN_QPRINTER_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +#if defined(WORKAROUND_INNER_CLASS_DEFINITION_QPagedPaintDevice__Margins) +typedef QPagedPaintDevice::Margins QPagedPaintDevice__Margins; +#else +class QPagedPaintDevice__Margins; +#endif +class QPaintEngine; +class QPrintEngine; +class QPrinter; +class QPrinterInfo; +class QRect; +class QRectF; +class QSizeF; +#else +typedef struct QPagedPaintDevice__Margins QPagedPaintDevice__Margins; +typedef struct QPaintEngine QPaintEngine; +typedef struct QPrintEngine QPrintEngine; +typedef struct QPrinter QPrinter; +typedef struct QPrinterInfo QPrinterInfo; +typedef struct QRect QRect; +typedef struct QRectF QRectF; +typedef struct QSizeF QSizeF; +#endif + +QPrinter* QPrinter_new(); +QPrinter* QPrinter_new2(QPrinterInfo* printer); +QPrinter* QPrinter_new3(int mode); +QPrinter* QPrinter_new4(QPrinterInfo* printer, int mode); +int QPrinter_DevType(const QPrinter* self); +void QPrinter_SetOutputFormat(QPrinter* self, int format); +int QPrinter_OutputFormat(const QPrinter* self); +void QPrinter_SetPdfVersion(QPrinter* self, int version); +int QPrinter_PdfVersion(const QPrinter* self); +void QPrinter_SetPrinterName(QPrinter* self, struct miqt_string* printerName); +struct miqt_string* QPrinter_PrinterName(const QPrinter* self); +bool QPrinter_IsValid(const QPrinter* self); +void QPrinter_SetOutputFileName(QPrinter* self, struct miqt_string* outputFileName); +struct miqt_string* QPrinter_OutputFileName(const QPrinter* self); +void QPrinter_SetPrintProgram(QPrinter* self, struct miqt_string* printProgram); +struct miqt_string* QPrinter_PrintProgram(const QPrinter* self); +void QPrinter_SetDocName(QPrinter* self, struct miqt_string* docName); +struct miqt_string* QPrinter_DocName(const QPrinter* self); +void QPrinter_SetCreator(QPrinter* self, struct miqt_string* creator); +struct miqt_string* QPrinter_Creator(const QPrinter* self); +void QPrinter_SetOrientation(QPrinter* self, int orientation); +int QPrinter_Orientation(const QPrinter* self); +void QPrinter_SetPageSize(QPrinter* self, int pageSize); +int QPrinter_PageSize(const QPrinter* self); +void QPrinter_SetPageSizeMM(QPrinter* self, QSizeF* size); +void QPrinter_SetPaperSize(QPrinter* self, int paperSize); +int QPrinter_PaperSize(const QPrinter* self); +void QPrinter_SetPaperSize2(QPrinter* self, QSizeF* paperSize, int unit); +QSizeF* QPrinter_PaperSizeWithUnit(const QPrinter* self, int unit); +void QPrinter_SetPaperName(QPrinter* self, struct miqt_string* paperName); +struct miqt_string* QPrinter_PaperName(const QPrinter* self); +void QPrinter_SetPageOrder(QPrinter* self, int pageOrder); +int QPrinter_PageOrder(const QPrinter* self); +void QPrinter_SetResolution(QPrinter* self, int resolution); +int QPrinter_Resolution(const QPrinter* self); +void QPrinter_SetColorMode(QPrinter* self, int colorMode); +int QPrinter_ColorMode(const QPrinter* self); +void QPrinter_SetCollateCopies(QPrinter* self, bool collate); +bool QPrinter_CollateCopies(const QPrinter* self); +void QPrinter_SetFullPage(QPrinter* self, bool fullPage); +bool QPrinter_FullPage(const QPrinter* self); +void QPrinter_SetNumCopies(QPrinter* self, int numCopies); +int QPrinter_NumCopies(const QPrinter* self); +int QPrinter_ActualNumCopies(const QPrinter* self); +void QPrinter_SetCopyCount(QPrinter* self, int copyCount); +int QPrinter_CopyCount(const QPrinter* self); +bool QPrinter_SupportsMultipleCopies(const QPrinter* self); +void QPrinter_SetPaperSource(QPrinter* self, int paperSource); +int QPrinter_PaperSource(const QPrinter* self); +void QPrinter_SetDuplex(QPrinter* self, int duplex); +int QPrinter_Duplex(const QPrinter* self); +struct miqt_array* QPrinter_SupportedResolutions(const QPrinter* self); +void QPrinter_SetFontEmbeddingEnabled(QPrinter* self, bool enable); +bool QPrinter_FontEmbeddingEnabled(const QPrinter* self); +void QPrinter_SetDoubleSidedPrinting(QPrinter* self, bool enable); +bool QPrinter_DoubleSidedPrinting(const QPrinter* self); +void QPrinter_SetWinPageSize(QPrinter* self, int winPageSize); +int QPrinter_WinPageSize(const QPrinter* self); +QRect* QPrinter_PaperRect(const QPrinter* self); +QRect* QPrinter_PageRect(const QPrinter* self); +QRectF* QPrinter_PaperRectWithQPrinterUnit(const QPrinter* self, int param1); +QRectF* QPrinter_PageRectWithQPrinterUnit(const QPrinter* self, int param1); +struct miqt_string* QPrinter_PrinterSelectionOption(const QPrinter* self); +void QPrinter_SetPrinterSelectionOption(QPrinter* self, struct miqt_string* printerSelectionOption); +bool QPrinter_NewPage(QPrinter* self); +bool QPrinter_Abort(QPrinter* self); +int QPrinter_PrinterState(const QPrinter* self); +QPaintEngine* QPrinter_PaintEngine(const QPrinter* self); +QPrintEngine* QPrinter_PrintEngine(const QPrinter* self); +void QPrinter_SetFromTo(QPrinter* self, int fromPage, int toPage); +int QPrinter_FromPage(const QPrinter* self); +int QPrinter_ToPage(const QPrinter* self); +void QPrinter_SetPrintRange(QPrinter* self, int rangeVal); +int QPrinter_PrintRange(const QPrinter* self); +void QPrinter_SetMargins(QPrinter* self, QPagedPaintDevice__Margins* m); +void QPrinter_SetPageMargins(QPrinter* self, double left, double top, double right, double bottom, int unit); +void QPrinter_GetPageMargins(const QPrinter* self, double* left, double* top, double* right, double* bottom, int unit); +void QPrinter_Delete(QPrinter* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif diff --git a/qt/qprintsupport/gen_qprinterinfo.cpp b/qt/qprintsupport/gen_qprinterinfo.cpp new file mode 100644 index 00000000..485710f0 --- /dev/null +++ b/qt/qprintsupport/gen_qprinterinfo.cpp @@ -0,0 +1,215 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "gen_qprinterinfo.h" +#include "_cgo_export.h" + +QPrinterInfo* QPrinterInfo_new() { + return new QPrinterInfo(); +} + +QPrinterInfo* QPrinterInfo_new2(QPrinterInfo* other) { + return new QPrinterInfo(*other); +} + +QPrinterInfo* QPrinterInfo_new3(QPrinter* printer) { + return new QPrinterInfo(*printer); +} + +void QPrinterInfo_OperatorAssign(QPrinterInfo* self, QPrinterInfo* other) { + self->operator=(*other); +} + +struct miqt_string* QPrinterInfo_PrinterName(const QPrinterInfo* self) { + QString _ret = self->printerName(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrinterInfo_Description(const QPrinterInfo* self) { + QString _ret = self->description(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrinterInfo_Location(const QPrinterInfo* self) { + QString _ret = self->location(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrinterInfo_MakeAndModel(const QPrinterInfo* self) { + QString _ret = self->makeAndModel(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +bool QPrinterInfo_IsNull(const QPrinterInfo* self) { + return self->isNull(); +} + +bool QPrinterInfo_IsDefault(const QPrinterInfo* self) { + return self->isDefault(); +} + +bool QPrinterInfo_IsRemote(const QPrinterInfo* self) { + return self->isRemote(); +} + +int QPrinterInfo_State(const QPrinterInfo* self) { + QPrinter::PrinterState _ret = self->state(); + return static_cast(_ret); +} + +struct miqt_array* QPrinterInfo_SupportedPageSizes(const QPrinterInfo* self) { + QList _ret = self->supportedPageSizes(); + // Convert QList<> from C++ memory to manually-managed C memory + QPageSize** _arr = static_cast(malloc(sizeof(QPageSize*) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + _arr[i] = new QPageSize(_ret[i]); + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +QPageSize* QPrinterInfo_DefaultPageSize(const QPrinterInfo* self) { + return new QPageSize(self->defaultPageSize()); +} + +bool QPrinterInfo_SupportsCustomPageSizes(const QPrinterInfo* self) { + return self->supportsCustomPageSizes(); +} + +QPageSize* QPrinterInfo_MinimumPhysicalPageSize(const QPrinterInfo* self) { + return new QPageSize(self->minimumPhysicalPageSize()); +} + +QPageSize* QPrinterInfo_MaximumPhysicalPageSize(const QPrinterInfo* self) { + return new QPageSize(self->maximumPhysicalPageSize()); +} + +struct miqt_array* QPrinterInfo_SupportedPaperSizes(const QPrinterInfo* self) { + QList _ret = self->supportedPaperSizes(); + // Convert QList<> from C++ memory to manually-managed C memory + int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + QPagedPaintDevice::PageSize _lv_ret = _ret[i]; + _arr[i] = static_cast(_lv_ret); + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +struct miqt_array* QPrinterInfo_SupportedResolutions(const QPrinterInfo* self) { + QList _ret = self->supportedResolutions(); + // Convert QList<> from C++ memory to manually-managed C memory + int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + _arr[i] = _ret[i]; + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +int QPrinterInfo_DefaultDuplexMode(const QPrinterInfo* self) { + QPrinter::DuplexMode _ret = self->defaultDuplexMode(); + return static_cast(_ret); +} + +struct miqt_array* QPrinterInfo_SupportedDuplexModes(const QPrinterInfo* self) { + QList _ret = self->supportedDuplexModes(); + // Convert QList<> from C++ memory to manually-managed C memory + int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + QPrinter::DuplexMode _lv_ret = _ret[i]; + _arr[i] = static_cast(_lv_ret); + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +int QPrinterInfo_DefaultColorMode(const QPrinterInfo* self) { + QPrinter::ColorMode _ret = self->defaultColorMode(); + return static_cast(_ret); +} + +struct miqt_array* QPrinterInfo_SupportedColorModes(const QPrinterInfo* self) { + QList _ret = self->supportedColorModes(); + // Convert QList<> from C++ memory to manually-managed C memory + int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + QPrinter::ColorMode _lv_ret = _ret[i]; + _arr[i] = static_cast(_lv_ret); + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +struct miqt_array* QPrinterInfo_AvailablePrinterNames() { + QStringList _ret = QPrinterInfo::availablePrinterNames(); + // Convert QList<> from C++ memory to manually-managed C memory + struct miqt_string** _arr = static_cast(malloc(sizeof(struct miqt_string*) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + QString _lv_ret = _ret[i]; + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _lv_b = _lv_ret.toUtf8(); + _arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length()); + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +struct miqt_array* QPrinterInfo_AvailablePrinters() { + QList _ret = QPrinterInfo::availablePrinters(); + // Convert QList<> from C++ memory to manually-managed C memory + QPrinterInfo** _arr = static_cast(malloc(sizeof(QPrinterInfo*) * _ret.length())); + for (size_t i = 0, e = _ret.length(); i < e; ++i) { + _arr[i] = new QPrinterInfo(_ret[i]); + } + struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); + _out->len = _ret.length(); + _out->data = static_cast(_arr); + return _out; +} + +struct miqt_string* QPrinterInfo_DefaultPrinterName() { + QString _ret = QPrinterInfo::defaultPrinterName(); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +QPrinterInfo* QPrinterInfo_DefaultPrinter() { + return new QPrinterInfo(QPrinterInfo::defaultPrinter()); +} + +QPrinterInfo* QPrinterInfo_PrinterInfo(struct miqt_string* printerName) { + QString printerName_QString = QString::fromUtf8(&printerName->data, printerName->len); + return new QPrinterInfo(QPrinterInfo::printerInfo(printerName_QString)); +} + +void QPrinterInfo_Delete(QPrinterInfo* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qprinterinfo.go b/qt/qprintsupport/gen_qprinterinfo.go new file mode 100644 index 00000000..dffa39d6 --- /dev/null +++ b/qt/qprintsupport/gen_qprinterinfo.go @@ -0,0 +1,267 @@ +package qprintsupport + +/* + +#include "gen_qprinterinfo.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/libmiqt" + "github.com/mappu/miqt/qt" + "runtime" + "unsafe" +) + +type QPrinterInfo struct { + h *C.QPrinterInfo +} + +func (this *QPrinterInfo) cPointer() *C.QPrinterInfo { + if this == nil { + return nil + } + return this.h +} + +func (this *QPrinterInfo) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQPrinterInfo(h *C.QPrinterInfo) *QPrinterInfo { + if h == nil { + return nil + } + return &QPrinterInfo{h: h} +} + +func UnsafeNewQPrinterInfo(h unsafe.Pointer) *QPrinterInfo { + return newQPrinterInfo((*C.QPrinterInfo)(h)) +} + +// NewQPrinterInfo constructs a new QPrinterInfo object. +func NewQPrinterInfo() *QPrinterInfo { + ret := C.QPrinterInfo_new() + return newQPrinterInfo(ret) +} + +// NewQPrinterInfo2 constructs a new QPrinterInfo object. +func NewQPrinterInfo2(other *QPrinterInfo) *QPrinterInfo { + ret := C.QPrinterInfo_new2(other.cPointer()) + return newQPrinterInfo(ret) +} + +// NewQPrinterInfo3 constructs a new QPrinterInfo object. +func NewQPrinterInfo3(printer *QPrinter) *QPrinterInfo { + ret := C.QPrinterInfo_new3(printer.cPointer()) + return newQPrinterInfo(ret) +} + +func (this *QPrinterInfo) OperatorAssign(other *QPrinterInfo) { + C.QPrinterInfo_OperatorAssign(this.h, other.cPointer()) +} + +func (this *QPrinterInfo) PrinterName() string { + var _ms *C.struct_miqt_string = C.QPrinterInfo_PrinterName(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinterInfo) Description() string { + var _ms *C.struct_miqt_string = C.QPrinterInfo_Description(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinterInfo) Location() string { + var _ms *C.struct_miqt_string = C.QPrinterInfo_Location(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinterInfo) MakeAndModel() string { + var _ms *C.struct_miqt_string = C.QPrinterInfo_MakeAndModel(this.h) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrinterInfo) IsNull() bool { + return (bool)(C.QPrinterInfo_IsNull(this.h)) +} + +func (this *QPrinterInfo) IsDefault() bool { + return (bool)(C.QPrinterInfo_IsDefault(this.h)) +} + +func (this *QPrinterInfo) IsRemote() bool { + return (bool)(C.QPrinterInfo_IsRemote(this.h)) +} + +func (this *QPrinterInfo) State() QPrinter__PrinterState { + return (QPrinter__PrinterState)(C.QPrinterInfo_State(this.h)) +} + +func (this *QPrinterInfo) SupportedPageSizes() []qt.QPageSize { + var _ma *C.struct_miqt_array = C.QPrinterInfo_SupportedPageSizes(this.h) + _ret := make([]qt.QPageSize, int(_ma.len)) + _outCast := (*[0xffff]*C.QPageSize)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + _lv_ret := _outCast[i] + _lv_goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(_lv_ret)) + _lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + _ret[i] = *_lv_goptr + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func (this *QPrinterInfo) DefaultPageSize() *qt.QPageSize { + _ret := C.QPrinterInfo_DefaultPageSize(this.h) + _goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinterInfo) SupportsCustomPageSizes() bool { + return (bool)(C.QPrinterInfo_SupportsCustomPageSizes(this.h)) +} + +func (this *QPrinterInfo) MinimumPhysicalPageSize() *qt.QPageSize { + _ret := C.QPrinterInfo_MinimumPhysicalPageSize(this.h) + _goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinterInfo) MaximumPhysicalPageSize() *qt.QPageSize { + _ret := C.QPrinterInfo_MaximumPhysicalPageSize(this.h) + _goptr := qt.UnsafeNewQPageSize(unsafe.Pointer(_ret)) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func (this *QPrinterInfo) SupportedPaperSizes() []qt.QPagedPaintDevice__PageSize { + var _ma *C.struct_miqt_array = C.QPrinterInfo_SupportedPaperSizes(this.h) + _ret := make([]qt.QPagedPaintDevice__PageSize, int(_ma.len)) + _outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + _ret[i] = (qt.QPagedPaintDevice__PageSize)(_outCast[i]) + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func (this *QPrinterInfo) SupportedResolutions() []int { + var _ma *C.struct_miqt_array = C.QPrinterInfo_SupportedResolutions(this.h) + _ret := make([]int, int(_ma.len)) + _outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + _ret[i] = (int)(_outCast[i]) + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func (this *QPrinterInfo) DefaultDuplexMode() QPrinter__DuplexMode { + return (QPrinter__DuplexMode)(C.QPrinterInfo_DefaultDuplexMode(this.h)) +} + +func (this *QPrinterInfo) SupportedDuplexModes() []QPrinter__DuplexMode { + var _ma *C.struct_miqt_array = C.QPrinterInfo_SupportedDuplexModes(this.h) + _ret := make([]QPrinter__DuplexMode, int(_ma.len)) + _outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + _ret[i] = (QPrinter__DuplexMode)(_outCast[i]) + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func (this *QPrinterInfo) DefaultColorMode() QPrinter__ColorMode { + return (QPrinter__ColorMode)(C.QPrinterInfo_DefaultColorMode(this.h)) +} + +func (this *QPrinterInfo) SupportedColorModes() []QPrinter__ColorMode { + var _ma *C.struct_miqt_array = C.QPrinterInfo_SupportedColorModes(this.h) + _ret := make([]QPrinter__ColorMode, int(_ma.len)) + _outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + _ret[i] = (QPrinter__ColorMode)(_outCast[i]) + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func QPrinterInfo_AvailablePrinterNames() []string { + var _ma *C.struct_miqt_array = C.QPrinterInfo_AvailablePrinterNames() + _ret := make([]string, int(_ma.len)) + _outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + var _lv_ms *C.struct_miqt_string = _outCast[i] + _lv_ret := C.GoStringN(&_lv_ms.data, C.int(int64(_lv_ms.len))) + C.free(unsafe.Pointer(_lv_ms)) + _ret[i] = _lv_ret + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func QPrinterInfo_AvailablePrinters() []QPrinterInfo { + var _ma *C.struct_miqt_array = C.QPrinterInfo_AvailablePrinters() + _ret := make([]QPrinterInfo, int(_ma.len)) + _outCast := (*[0xffff]*C.QPrinterInfo)(unsafe.Pointer(_ma.data)) // hey ya + for i := 0; i < int(_ma.len); i++ { + _lv_ret := _outCast[i] + _lv_goptr := newQPrinterInfo(_lv_ret) + _lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + _ret[i] = *_lv_goptr + } + C.free(unsafe.Pointer(_ma)) + return _ret +} + +func QPrinterInfo_DefaultPrinterName() string { + var _ms *C.struct_miqt_string = C.QPrinterInfo_DefaultPrinterName() + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrinterInfo_DefaultPrinter() *QPrinterInfo { + _ret := C.QPrinterInfo_DefaultPrinter() + _goptr := newQPrinterInfo(_ret) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +func QPrinterInfo_PrinterInfo(printerName string) *QPrinterInfo { + printerName_ms := libmiqt.Strdupg(printerName) + defer C.free(printerName_ms) + _ret := C.QPrinterInfo_PrinterInfo((*C.struct_miqt_string)(printerName_ms)) + _goptr := newQPrinterInfo(_ret) + _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer + return _goptr +} + +// Delete this object from C++ memory. +func (this *QPrinterInfo) Delete() { + C.QPrinterInfo_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QPrinterInfo) GoGC() { + runtime.SetFinalizer(this, func(this *QPrinterInfo) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qprinterinfo.h b/qt/qprintsupport/gen_qprinterinfo.h new file mode 100644 index 00000000..6d1dbfc4 --- /dev/null +++ b/qt/qprintsupport/gen_qprinterinfo.h @@ -0,0 +1,60 @@ +#ifndef GEN_QPRINTERINFO_H +#define GEN_QPRINTERINFO_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class QPageSize; +class QPrinter; +class QPrinterInfo; +#else +typedef struct QPageSize QPageSize; +typedef struct QPrinter QPrinter; +typedef struct QPrinterInfo QPrinterInfo; +#endif + +QPrinterInfo* QPrinterInfo_new(); +QPrinterInfo* QPrinterInfo_new2(QPrinterInfo* other); +QPrinterInfo* QPrinterInfo_new3(QPrinter* printer); +void QPrinterInfo_OperatorAssign(QPrinterInfo* self, QPrinterInfo* other); +struct miqt_string* QPrinterInfo_PrinterName(const QPrinterInfo* self); +struct miqt_string* QPrinterInfo_Description(const QPrinterInfo* self); +struct miqt_string* QPrinterInfo_Location(const QPrinterInfo* self); +struct miqt_string* QPrinterInfo_MakeAndModel(const QPrinterInfo* self); +bool QPrinterInfo_IsNull(const QPrinterInfo* self); +bool QPrinterInfo_IsDefault(const QPrinterInfo* self); +bool QPrinterInfo_IsRemote(const QPrinterInfo* self); +int QPrinterInfo_State(const QPrinterInfo* self); +struct miqt_array* QPrinterInfo_SupportedPageSizes(const QPrinterInfo* self); +QPageSize* QPrinterInfo_DefaultPageSize(const QPrinterInfo* self); +bool QPrinterInfo_SupportsCustomPageSizes(const QPrinterInfo* self); +QPageSize* QPrinterInfo_MinimumPhysicalPageSize(const QPrinterInfo* self); +QPageSize* QPrinterInfo_MaximumPhysicalPageSize(const QPrinterInfo* self); +struct miqt_array* QPrinterInfo_SupportedPaperSizes(const QPrinterInfo* self); +struct miqt_array* QPrinterInfo_SupportedResolutions(const QPrinterInfo* self); +int QPrinterInfo_DefaultDuplexMode(const QPrinterInfo* self); +struct miqt_array* QPrinterInfo_SupportedDuplexModes(const QPrinterInfo* self); +int QPrinterInfo_DefaultColorMode(const QPrinterInfo* self); +struct miqt_array* QPrinterInfo_SupportedColorModes(const QPrinterInfo* self); +struct miqt_array* QPrinterInfo_AvailablePrinterNames(); +struct miqt_array* QPrinterInfo_AvailablePrinters(); +struct miqt_string* QPrinterInfo_DefaultPrinterName(); +QPrinterInfo* QPrinterInfo_DefaultPrinter(); +QPrinterInfo* QPrinterInfo_PrinterInfo(struct miqt_string* printerName); +void QPrinterInfo_Delete(QPrinterInfo* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif diff --git a/qt/qprintsupport/gen_qprintpreviewdialog.cpp b/qt/qprintsupport/gen_qprintpreviewdialog.cpp new file mode 100644 index 00000000..7b150395 --- /dev/null +++ b/qt/qprintsupport/gen_qprintpreviewdialog.cpp @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "gen_qprintpreviewdialog.h" +#include "_cgo_export.h" + +QPrintPreviewDialog* QPrintPreviewDialog_new() { + return new QPrintPreviewDialog(); +} + +QPrintPreviewDialog* QPrintPreviewDialog_new2(QPrinter* printer) { + return new QPrintPreviewDialog(printer); +} + +QPrintPreviewDialog* QPrintPreviewDialog_new3(QWidget* parent) { + return new QPrintPreviewDialog(parent); +} + +QPrintPreviewDialog* QPrintPreviewDialog_new4(QWidget* parent, int flags) { + return new QPrintPreviewDialog(parent, static_cast(flags)); +} + +QPrintPreviewDialog* QPrintPreviewDialog_new5(QPrinter* printer, QWidget* parent) { + return new QPrintPreviewDialog(printer, parent); +} + +QPrintPreviewDialog* QPrintPreviewDialog_new6(QPrinter* printer, QWidget* parent, int flags) { + return new QPrintPreviewDialog(printer, parent, static_cast(flags)); +} + +QMetaObject* QPrintPreviewDialog_MetaObject(const QPrintPreviewDialog* self) { + return (QMetaObject*) self->metaObject(); +} + +void* QPrintPreviewDialog_Metacast(QPrintPreviewDialog* self, const char* param1) { + return self->qt_metacast(param1); +} + +struct miqt_string* QPrintPreviewDialog_Tr(const char* s) { + QString _ret = QPrintPreviewDialog::tr(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewDialog_TrUtf8(const char* s) { + QString _ret = QPrintPreviewDialog::trUtf8(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +QPrinter* QPrintPreviewDialog_Printer(QPrintPreviewDialog* self) { + return self->printer(); +} + +void QPrintPreviewDialog_SetVisible(QPrintPreviewDialog* self, bool visible) { + self->setVisible(visible); +} + +void QPrintPreviewDialog_Done(QPrintPreviewDialog* self, int result) { + self->done(static_cast(result)); +} + +void QPrintPreviewDialog_PaintRequested(QPrintPreviewDialog* self, QPrinter* printer) { + self->paintRequested(printer); +} + +void QPrintPreviewDialog_connect_PaintRequested(QPrintPreviewDialog* self, intptr_t slot) { + QPrintPreviewDialog::connect(self, static_cast(&QPrintPreviewDialog::paintRequested), self, [=](QPrinter* printer) { + QPrinter* sigval1 = printer; + miqt_exec_callback_QPrintPreviewDialog_PaintRequested(slot, sigval1); + }); +} + +struct miqt_string* QPrintPreviewDialog_Tr2(const char* s, const char* c) { + QString _ret = QPrintPreviewDialog::tr(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewDialog_Tr3(const char* s, const char* c, int n) { + QString _ret = QPrintPreviewDialog::tr(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewDialog_TrUtf82(const char* s, const char* c) { + QString _ret = QPrintPreviewDialog::trUtf8(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewDialog_TrUtf83(const char* s, const char* c, int n) { + QString _ret = QPrintPreviewDialog::trUtf8(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrintPreviewDialog_Delete(QPrintPreviewDialog* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qprintpreviewdialog.go b/qt/qprintsupport/gen_qprintpreviewdialog.go new file mode 100644 index 00000000..218797d4 --- /dev/null +++ b/qt/qprintsupport/gen_qprintpreviewdialog.go @@ -0,0 +1,200 @@ +package qprintsupport + +/* + +#include "gen_qprintpreviewdialog.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/qt" + "runtime" + "runtime/cgo" + "unsafe" +) + +type QPrintPreviewDialog struct { + h *C.QPrintPreviewDialog + *qt.QDialog +} + +func (this *QPrintPreviewDialog) cPointer() *C.QPrintPreviewDialog { + if this == nil { + return nil + } + return this.h +} + +func (this *QPrintPreviewDialog) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQPrintPreviewDialog(h *C.QPrintPreviewDialog) *QPrintPreviewDialog { + if h == nil { + return nil + } + return &QPrintPreviewDialog{h: h, QDialog: qt.UnsafeNewQDialog(unsafe.Pointer(h))} +} + +func UnsafeNewQPrintPreviewDialog(h unsafe.Pointer) *QPrintPreviewDialog { + return newQPrintPreviewDialog((*C.QPrintPreviewDialog)(h)) +} + +// NewQPrintPreviewDialog constructs a new QPrintPreviewDialog object. +func NewQPrintPreviewDialog() *QPrintPreviewDialog { + ret := C.QPrintPreviewDialog_new() + return newQPrintPreviewDialog(ret) +} + +// NewQPrintPreviewDialog2 constructs a new QPrintPreviewDialog object. +func NewQPrintPreviewDialog2(printer *QPrinter) *QPrintPreviewDialog { + ret := C.QPrintPreviewDialog_new2(printer.cPointer()) + return newQPrintPreviewDialog(ret) +} + +// NewQPrintPreviewDialog3 constructs a new QPrintPreviewDialog object. +func NewQPrintPreviewDialog3(parent *qt.QWidget) *QPrintPreviewDialog { + ret := C.QPrintPreviewDialog_new3((*C.QWidget)(parent.UnsafePointer())) + return newQPrintPreviewDialog(ret) +} + +// NewQPrintPreviewDialog4 constructs a new QPrintPreviewDialog object. +func NewQPrintPreviewDialog4(parent *qt.QWidget, flags qt.WindowType) *QPrintPreviewDialog { + ret := C.QPrintPreviewDialog_new4((*C.QWidget)(parent.UnsafePointer()), (C.int)(flags)) + return newQPrintPreviewDialog(ret) +} + +// NewQPrintPreviewDialog5 constructs a new QPrintPreviewDialog object. +func NewQPrintPreviewDialog5(printer *QPrinter, parent *qt.QWidget) *QPrintPreviewDialog { + ret := C.QPrintPreviewDialog_new5(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer())) + return newQPrintPreviewDialog(ret) +} + +// NewQPrintPreviewDialog6 constructs a new QPrintPreviewDialog object. +func NewQPrintPreviewDialog6(printer *QPrinter, parent *qt.QWidget, flags qt.WindowType) *QPrintPreviewDialog { + ret := C.QPrintPreviewDialog_new6(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer()), (C.int)(flags)) + return newQPrintPreviewDialog(ret) +} + +func (this *QPrintPreviewDialog) MetaObject() *qt.QMetaObject { + return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPrintPreviewDialog_MetaObject(this.h))) +} + +func (this *QPrintPreviewDialog) Metacast(param1 string) unsafe.Pointer { + param1_Cstring := C.CString(param1) + defer C.free(unsafe.Pointer(param1_Cstring)) + return C.QPrintPreviewDialog_Metacast(this.h, param1_Cstring) +} + +func QPrintPreviewDialog_Tr(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewDialog_Tr(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewDialog_TrUtf8(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewDialog_TrUtf8(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrintPreviewDialog) Printer() *QPrinter { + return UnsafeNewQPrinter(unsafe.Pointer(C.QPrintPreviewDialog_Printer(this.h))) +} + +func (this *QPrintPreviewDialog) SetVisible(visible bool) { + C.QPrintPreviewDialog_SetVisible(this.h, (C.bool)(visible)) +} + +func (this *QPrintPreviewDialog) Done(result int) { + C.QPrintPreviewDialog_Done(this.h, (C.int)(result)) +} + +func (this *QPrintPreviewDialog) PaintRequested(printer *QPrinter) { + C.QPrintPreviewDialog_PaintRequested(this.h, printer.cPointer()) +} +func (this *QPrintPreviewDialog) OnPaintRequested(slot func(printer *QPrinter)) { + C.QPrintPreviewDialog_connect_PaintRequested(this.h, C.intptr_t(cgo.NewHandle(slot))) +} + +//export miqt_exec_callback_QPrintPreviewDialog_PaintRequested +func miqt_exec_callback_QPrintPreviewDialog_PaintRequested(cb C.intptr_t, printer *C.QPrinter) { + gofunc, ok := cgo.Handle(cb).Value().(func(printer *QPrinter)) + if !ok { + panic("miqt: callback of non-callback type (heap corruption?)") + } + + // Convert all CABI parameters to Go parameters + slotval1 := UnsafeNewQPrinter(unsafe.Pointer(printer)) + + gofunc(slotval1) +} + +func QPrintPreviewDialog_Tr2(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewDialog_Tr2(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewDialog_Tr3(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewDialog_Tr3(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewDialog_TrUtf82(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewDialog_TrUtf82(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewDialog_TrUtf83(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewDialog_TrUtf83(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +// Delete this object from C++ memory. +func (this *QPrintPreviewDialog) Delete() { + C.QPrintPreviewDialog_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QPrintPreviewDialog) GoGC() { + runtime.SetFinalizer(this, func(this *QPrintPreviewDialog) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qprintpreviewdialog.h b/qt/qprintsupport/gen_qprintpreviewdialog.h new file mode 100644 index 00000000..14fc4a03 --- /dev/null +++ b/qt/qprintsupport/gen_qprintpreviewdialog.h @@ -0,0 +1,53 @@ +#ifndef GEN_QPRINTPREVIEWDIALOG_H +#define GEN_QPRINTPREVIEWDIALOG_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class QMetaObject; +class QPrintPreviewDialog; +class QPrinter; +class QWidget; +#else +typedef struct QMetaObject QMetaObject; +typedef struct QPrintPreviewDialog QPrintPreviewDialog; +typedef struct QPrinter QPrinter; +typedef struct QWidget QWidget; +#endif + +QPrintPreviewDialog* QPrintPreviewDialog_new(); +QPrintPreviewDialog* QPrintPreviewDialog_new2(QPrinter* printer); +QPrintPreviewDialog* QPrintPreviewDialog_new3(QWidget* parent); +QPrintPreviewDialog* QPrintPreviewDialog_new4(QWidget* parent, int flags); +QPrintPreviewDialog* QPrintPreviewDialog_new5(QPrinter* printer, QWidget* parent); +QPrintPreviewDialog* QPrintPreviewDialog_new6(QPrinter* printer, QWidget* parent, int flags); +QMetaObject* QPrintPreviewDialog_MetaObject(const QPrintPreviewDialog* self); +void* QPrintPreviewDialog_Metacast(QPrintPreviewDialog* self, const char* param1); +struct miqt_string* QPrintPreviewDialog_Tr(const char* s); +struct miqt_string* QPrintPreviewDialog_TrUtf8(const char* s); +QPrinter* QPrintPreviewDialog_Printer(QPrintPreviewDialog* self); +void QPrintPreviewDialog_SetVisible(QPrintPreviewDialog* self, bool visible); +void QPrintPreviewDialog_Done(QPrintPreviewDialog* self, int result); +void QPrintPreviewDialog_PaintRequested(QPrintPreviewDialog* self, QPrinter* printer); +void QPrintPreviewDialog_connect_PaintRequested(QPrintPreviewDialog* self, intptr_t slot); +struct miqt_string* QPrintPreviewDialog_Tr2(const char* s, const char* c); +struct miqt_string* QPrintPreviewDialog_Tr3(const char* s, const char* c, int n); +struct miqt_string* QPrintPreviewDialog_TrUtf82(const char* s, const char* c); +struct miqt_string* QPrintPreviewDialog_TrUtf83(const char* s, const char* c, int n); +void QPrintPreviewDialog_Delete(QPrintPreviewDialog* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif diff --git a/qt/qprintsupport/gen_qprintpreviewwidget.cpp b/qt/qprintsupport/gen_qprintpreviewwidget.cpp new file mode 100644 index 00000000..22cd37df --- /dev/null +++ b/qt/qprintsupport/gen_qprintpreviewwidget.cpp @@ -0,0 +1,214 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "gen_qprintpreviewwidget.h" +#include "_cgo_export.h" + +QPrintPreviewWidget* QPrintPreviewWidget_new(QPrinter* printer) { + return new QPrintPreviewWidget(printer); +} + +QPrintPreviewWidget* QPrintPreviewWidget_new2() { + return new QPrintPreviewWidget(); +} + +QPrintPreviewWidget* QPrintPreviewWidget_new3(QPrinter* printer, QWidget* parent) { + return new QPrintPreviewWidget(printer, parent); +} + +QPrintPreviewWidget* QPrintPreviewWidget_new4(QPrinter* printer, QWidget* parent, int flags) { + return new QPrintPreviewWidget(printer, parent, static_cast(flags)); +} + +QPrintPreviewWidget* QPrintPreviewWidget_new5(QWidget* parent) { + return new QPrintPreviewWidget(parent); +} + +QPrintPreviewWidget* QPrintPreviewWidget_new6(QWidget* parent, int flags) { + return new QPrintPreviewWidget(parent, static_cast(flags)); +} + +QMetaObject* QPrintPreviewWidget_MetaObject(const QPrintPreviewWidget* self) { + return (QMetaObject*) self->metaObject(); +} + +void* QPrintPreviewWidget_Metacast(QPrintPreviewWidget* self, const char* param1) { + return self->qt_metacast(param1); +} + +struct miqt_string* QPrintPreviewWidget_Tr(const char* s) { + QString _ret = QPrintPreviewWidget::tr(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewWidget_TrUtf8(const char* s) { + QString _ret = QPrintPreviewWidget::trUtf8(s); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +double QPrintPreviewWidget_ZoomFactor(const QPrintPreviewWidget* self) { + qreal _ret = self->zoomFactor(); + return static_cast(_ret); +} + +int QPrintPreviewWidget_Orientation(const QPrintPreviewWidget* self) { + QPrinter::Orientation _ret = self->orientation(); + return static_cast(_ret); +} + +int QPrintPreviewWidget_ViewMode(const QPrintPreviewWidget* self) { + QPrintPreviewWidget::ViewMode _ret = self->viewMode(); + return static_cast(_ret); +} + +int QPrintPreviewWidget_ZoomMode(const QPrintPreviewWidget* self) { + QPrintPreviewWidget::ZoomMode _ret = self->zoomMode(); + return static_cast(_ret); +} + +int QPrintPreviewWidget_CurrentPage(const QPrintPreviewWidget* self) { + return self->currentPage(); +} + +int QPrintPreviewWidget_PageCount(const QPrintPreviewWidget* self) { + return self->pageCount(); +} + +void QPrintPreviewWidget_SetVisible(QPrintPreviewWidget* self, bool visible) { + self->setVisible(visible); +} + +void QPrintPreviewWidget_Print(QPrintPreviewWidget* self) { + self->print(); +} + +void QPrintPreviewWidget_ZoomIn(QPrintPreviewWidget* self) { + self->zoomIn(); +} + +void QPrintPreviewWidget_ZoomOut(QPrintPreviewWidget* self) { + self->zoomOut(); +} + +void QPrintPreviewWidget_SetZoomFactor(QPrintPreviewWidget* self, double zoomFactor) { + self->setZoomFactor(static_cast(zoomFactor)); +} + +void QPrintPreviewWidget_SetOrientation(QPrintPreviewWidget* self, int orientation) { + self->setOrientation(static_cast(orientation)); +} + +void QPrintPreviewWidget_SetViewMode(QPrintPreviewWidget* self, int viewMode) { + self->setViewMode(static_cast(viewMode)); +} + +void QPrintPreviewWidget_SetZoomMode(QPrintPreviewWidget* self, int zoomMode) { + self->setZoomMode(static_cast(zoomMode)); +} + +void QPrintPreviewWidget_SetCurrentPage(QPrintPreviewWidget* self, int pageNumber) { + self->setCurrentPage(static_cast(pageNumber)); +} + +void QPrintPreviewWidget_FitToWidth(QPrintPreviewWidget* self) { + self->fitToWidth(); +} + +void QPrintPreviewWidget_FitInView(QPrintPreviewWidget* self) { + self->fitInView(); +} + +void QPrintPreviewWidget_SetLandscapeOrientation(QPrintPreviewWidget* self) { + self->setLandscapeOrientation(); +} + +void QPrintPreviewWidget_SetPortraitOrientation(QPrintPreviewWidget* self) { + self->setPortraitOrientation(); +} + +void QPrintPreviewWidget_SetSinglePageViewMode(QPrintPreviewWidget* self) { + self->setSinglePageViewMode(); +} + +void QPrintPreviewWidget_SetFacingPagesViewMode(QPrintPreviewWidget* self) { + self->setFacingPagesViewMode(); +} + +void QPrintPreviewWidget_SetAllPagesViewMode(QPrintPreviewWidget* self) { + self->setAllPagesViewMode(); +} + +void QPrintPreviewWidget_UpdatePreview(QPrintPreviewWidget* self) { + self->updatePreview(); +} + +void QPrintPreviewWidget_PaintRequested(QPrintPreviewWidget* self, QPrinter* printer) { + self->paintRequested(printer); +} + +void QPrintPreviewWidget_connect_PaintRequested(QPrintPreviewWidget* self, intptr_t slot) { + QPrintPreviewWidget::connect(self, static_cast(&QPrintPreviewWidget::paintRequested), self, [=](QPrinter* printer) { + QPrinter* sigval1 = printer; + miqt_exec_callback_QPrintPreviewWidget_PaintRequested(slot, sigval1); + }); +} + +void QPrintPreviewWidget_PreviewChanged(QPrintPreviewWidget* self) { + self->previewChanged(); +} + +void QPrintPreviewWidget_connect_PreviewChanged(QPrintPreviewWidget* self, intptr_t slot) { + QPrintPreviewWidget::connect(self, static_cast(&QPrintPreviewWidget::previewChanged), self, [=]() { + miqt_exec_callback_QPrintPreviewWidget_PreviewChanged(slot); + }); +} + +struct miqt_string* QPrintPreviewWidget_Tr2(const char* s, const char* c) { + QString _ret = QPrintPreviewWidget::tr(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewWidget_Tr3(const char* s, const char* c, int n) { + QString _ret = QPrintPreviewWidget::tr(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewWidget_TrUtf82(const char* s, const char* c) { + QString _ret = QPrintPreviewWidget::trUtf8(s, c); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +struct miqt_string* QPrintPreviewWidget_TrUtf83(const char* s, const char* c, int n) { + QString _ret = QPrintPreviewWidget::trUtf8(s, c, static_cast(n)); + // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory + QByteArray _b = _ret.toUtf8(); + return miqt_strdup(_b.data(), _b.length()); +} + +void QPrintPreviewWidget_ZoomIn1(QPrintPreviewWidget* self, double zoom) { + self->zoomIn(static_cast(zoom)); +} + +void QPrintPreviewWidget_ZoomOut1(QPrintPreviewWidget* self, double zoom) { + self->zoomOut(static_cast(zoom)); +} + +void QPrintPreviewWidget_Delete(QPrintPreviewWidget* self) { + delete self; +} + diff --git a/qt/qprintsupport/gen_qprintpreviewwidget.go b/qt/qprintsupport/gen_qprintpreviewwidget.go new file mode 100644 index 00000000..7f02f444 --- /dev/null +++ b/qt/qprintsupport/gen_qprintpreviewwidget.go @@ -0,0 +1,321 @@ +package qprintsupport + +/* + +#include "gen_qprintpreviewwidget.h" +#include + +*/ +import "C" + +import ( + "github.com/mappu/miqt/qt" + "runtime" + "runtime/cgo" + "unsafe" +) + +type QPrintPreviewWidget__ViewMode int + +const ( + QPrintPreviewWidget__SinglePageView QPrintPreviewWidget__ViewMode = 0 + QPrintPreviewWidget__FacingPagesView QPrintPreviewWidget__ViewMode = 1 + QPrintPreviewWidget__AllPagesView QPrintPreviewWidget__ViewMode = 2 +) + +type QPrintPreviewWidget__ZoomMode int + +const ( + QPrintPreviewWidget__CustomZoom QPrintPreviewWidget__ZoomMode = 0 + QPrintPreviewWidget__FitToWidth QPrintPreviewWidget__ZoomMode = 1 + QPrintPreviewWidget__FitInView QPrintPreviewWidget__ZoomMode = 2 +) + +type QPrintPreviewWidget struct { + h *C.QPrintPreviewWidget + *qt.QWidget +} + +func (this *QPrintPreviewWidget) cPointer() *C.QPrintPreviewWidget { + if this == nil { + return nil + } + return this.h +} + +func (this *QPrintPreviewWidget) UnsafePointer() unsafe.Pointer { + if this == nil { + return nil + } + return unsafe.Pointer(this.h) +} + +func newQPrintPreviewWidget(h *C.QPrintPreviewWidget) *QPrintPreviewWidget { + if h == nil { + return nil + } + return &QPrintPreviewWidget{h: h, QWidget: qt.UnsafeNewQWidget(unsafe.Pointer(h))} +} + +func UnsafeNewQPrintPreviewWidget(h unsafe.Pointer) *QPrintPreviewWidget { + return newQPrintPreviewWidget((*C.QPrintPreviewWidget)(h)) +} + +// NewQPrintPreviewWidget constructs a new QPrintPreviewWidget object. +func NewQPrintPreviewWidget(printer *QPrinter) *QPrintPreviewWidget { + ret := C.QPrintPreviewWidget_new(printer.cPointer()) + return newQPrintPreviewWidget(ret) +} + +// NewQPrintPreviewWidget2 constructs a new QPrintPreviewWidget object. +func NewQPrintPreviewWidget2() *QPrintPreviewWidget { + ret := C.QPrintPreviewWidget_new2() + return newQPrintPreviewWidget(ret) +} + +// NewQPrintPreviewWidget3 constructs a new QPrintPreviewWidget object. +func NewQPrintPreviewWidget3(printer *QPrinter, parent *qt.QWidget) *QPrintPreviewWidget { + ret := C.QPrintPreviewWidget_new3(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer())) + return newQPrintPreviewWidget(ret) +} + +// NewQPrintPreviewWidget4 constructs a new QPrintPreviewWidget object. +func NewQPrintPreviewWidget4(printer *QPrinter, parent *qt.QWidget, flags qt.WindowType) *QPrintPreviewWidget { + ret := C.QPrintPreviewWidget_new4(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer()), (C.int)(flags)) + return newQPrintPreviewWidget(ret) +} + +// NewQPrintPreviewWidget5 constructs a new QPrintPreviewWidget object. +func NewQPrintPreviewWidget5(parent *qt.QWidget) *QPrintPreviewWidget { + ret := C.QPrintPreviewWidget_new5((*C.QWidget)(parent.UnsafePointer())) + return newQPrintPreviewWidget(ret) +} + +// NewQPrintPreviewWidget6 constructs a new QPrintPreviewWidget object. +func NewQPrintPreviewWidget6(parent *qt.QWidget, flags qt.WindowType) *QPrintPreviewWidget { + ret := C.QPrintPreviewWidget_new6((*C.QWidget)(parent.UnsafePointer()), (C.int)(flags)) + return newQPrintPreviewWidget(ret) +} + +func (this *QPrintPreviewWidget) MetaObject() *qt.QMetaObject { + return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QPrintPreviewWidget_MetaObject(this.h))) +} + +func (this *QPrintPreviewWidget) Metacast(param1 string) unsafe.Pointer { + param1_Cstring := C.CString(param1) + defer C.free(unsafe.Pointer(param1_Cstring)) + return C.QPrintPreviewWidget_Metacast(this.h, param1_Cstring) +} + +func QPrintPreviewWidget_Tr(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewWidget_Tr(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewWidget_TrUtf8(s string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewWidget_TrUtf8(s_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrintPreviewWidget) ZoomFactor() float64 { + return (float64)(C.QPrintPreviewWidget_ZoomFactor(this.h)) +} + +func (this *QPrintPreviewWidget) Orientation() QPrinter__Orientation { + return (QPrinter__Orientation)(C.QPrintPreviewWidget_Orientation(this.h)) +} + +func (this *QPrintPreviewWidget) ViewMode() QPrintPreviewWidget__ViewMode { + return (QPrintPreviewWidget__ViewMode)(C.QPrintPreviewWidget_ViewMode(this.h)) +} + +func (this *QPrintPreviewWidget) ZoomMode() QPrintPreviewWidget__ZoomMode { + return (QPrintPreviewWidget__ZoomMode)(C.QPrintPreviewWidget_ZoomMode(this.h)) +} + +func (this *QPrintPreviewWidget) CurrentPage() int { + return (int)(C.QPrintPreviewWidget_CurrentPage(this.h)) +} + +func (this *QPrintPreviewWidget) PageCount() int { + return (int)(C.QPrintPreviewWidget_PageCount(this.h)) +} + +func (this *QPrintPreviewWidget) SetVisible(visible bool) { + C.QPrintPreviewWidget_SetVisible(this.h, (C.bool)(visible)) +} + +func (this *QPrintPreviewWidget) Print() { + C.QPrintPreviewWidget_Print(this.h) +} + +func (this *QPrintPreviewWidget) ZoomIn() { + C.QPrintPreviewWidget_ZoomIn(this.h) +} + +func (this *QPrintPreviewWidget) ZoomOut() { + C.QPrintPreviewWidget_ZoomOut(this.h) +} + +func (this *QPrintPreviewWidget) SetZoomFactor(zoomFactor float64) { + C.QPrintPreviewWidget_SetZoomFactor(this.h, (C.double)(zoomFactor)) +} + +func (this *QPrintPreviewWidget) SetOrientation(orientation QPrinter__Orientation) { + C.QPrintPreviewWidget_SetOrientation(this.h, (C.int)(orientation)) +} + +func (this *QPrintPreviewWidget) SetViewMode(viewMode QPrintPreviewWidget__ViewMode) { + C.QPrintPreviewWidget_SetViewMode(this.h, (C.int)(viewMode)) +} + +func (this *QPrintPreviewWidget) SetZoomMode(zoomMode QPrintPreviewWidget__ZoomMode) { + C.QPrintPreviewWidget_SetZoomMode(this.h, (C.int)(zoomMode)) +} + +func (this *QPrintPreviewWidget) SetCurrentPage(pageNumber int) { + C.QPrintPreviewWidget_SetCurrentPage(this.h, (C.int)(pageNumber)) +} + +func (this *QPrintPreviewWidget) FitToWidth() { + C.QPrintPreviewWidget_FitToWidth(this.h) +} + +func (this *QPrintPreviewWidget) FitInView() { + C.QPrintPreviewWidget_FitInView(this.h) +} + +func (this *QPrintPreviewWidget) SetLandscapeOrientation() { + C.QPrintPreviewWidget_SetLandscapeOrientation(this.h) +} + +func (this *QPrintPreviewWidget) SetPortraitOrientation() { + C.QPrintPreviewWidget_SetPortraitOrientation(this.h) +} + +func (this *QPrintPreviewWidget) SetSinglePageViewMode() { + C.QPrintPreviewWidget_SetSinglePageViewMode(this.h) +} + +func (this *QPrintPreviewWidget) SetFacingPagesViewMode() { + C.QPrintPreviewWidget_SetFacingPagesViewMode(this.h) +} + +func (this *QPrintPreviewWidget) SetAllPagesViewMode() { + C.QPrintPreviewWidget_SetAllPagesViewMode(this.h) +} + +func (this *QPrintPreviewWidget) UpdatePreview() { + C.QPrintPreviewWidget_UpdatePreview(this.h) +} + +func (this *QPrintPreviewWidget) PaintRequested(printer *QPrinter) { + C.QPrintPreviewWidget_PaintRequested(this.h, printer.cPointer()) +} +func (this *QPrintPreviewWidget) OnPaintRequested(slot func(printer *QPrinter)) { + C.QPrintPreviewWidget_connect_PaintRequested(this.h, C.intptr_t(cgo.NewHandle(slot))) +} + +//export miqt_exec_callback_QPrintPreviewWidget_PaintRequested +func miqt_exec_callback_QPrintPreviewWidget_PaintRequested(cb C.intptr_t, printer *C.QPrinter) { + gofunc, ok := cgo.Handle(cb).Value().(func(printer *QPrinter)) + if !ok { + panic("miqt: callback of non-callback type (heap corruption?)") + } + + // Convert all CABI parameters to Go parameters + slotval1 := UnsafeNewQPrinter(unsafe.Pointer(printer)) + + gofunc(slotval1) +} + +func (this *QPrintPreviewWidget) PreviewChanged() { + C.QPrintPreviewWidget_PreviewChanged(this.h) +} +func (this *QPrintPreviewWidget) OnPreviewChanged(slot func()) { + C.QPrintPreviewWidget_connect_PreviewChanged(this.h, C.intptr_t(cgo.NewHandle(slot))) +} + +//export miqt_exec_callback_QPrintPreviewWidget_PreviewChanged +func miqt_exec_callback_QPrintPreviewWidget_PreviewChanged(cb C.intptr_t) { + gofunc, ok := cgo.Handle(cb).Value().(func()) + if !ok { + panic("miqt: callback of non-callback type (heap corruption?)") + } + + gofunc() +} + +func QPrintPreviewWidget_Tr2(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewWidget_Tr2(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewWidget_Tr3(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewWidget_Tr3(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewWidget_TrUtf82(s string, c string) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewWidget_TrUtf82(s_Cstring, c_Cstring) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func QPrintPreviewWidget_TrUtf83(s string, c string, n int) string { + s_Cstring := C.CString(s) + defer C.free(unsafe.Pointer(s_Cstring)) + c_Cstring := C.CString(c) + defer C.free(unsafe.Pointer(c_Cstring)) + var _ms *C.struct_miqt_string = C.QPrintPreviewWidget_TrUtf83(s_Cstring, c_Cstring, (C.int)(n)) + _ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len))) + C.free(unsafe.Pointer(_ms)) + return _ret +} + +func (this *QPrintPreviewWidget) ZoomIn1(zoom float64) { + C.QPrintPreviewWidget_ZoomIn1(this.h, (C.double)(zoom)) +} + +func (this *QPrintPreviewWidget) ZoomOut1(zoom float64) { + C.QPrintPreviewWidget_ZoomOut1(this.h, (C.double)(zoom)) +} + +// Delete this object from C++ memory. +func (this *QPrintPreviewWidget) Delete() { + C.QPrintPreviewWidget_Delete(this.h) +} + +// GoGC adds a Go Finalizer to this pointer, so that it will be deleted +// from C++ memory once it is unreachable from Go memory. +func (this *QPrintPreviewWidget) GoGC() { + runtime.SetFinalizer(this, func(this *QPrintPreviewWidget) { + this.Delete() + runtime.KeepAlive(this.h) + }) +} diff --git a/qt/qprintsupport/gen_qprintpreviewwidget.h b/qt/qprintsupport/gen_qprintpreviewwidget.h new file mode 100644 index 00000000..d69a32a1 --- /dev/null +++ b/qt/qprintsupport/gen_qprintpreviewwidget.h @@ -0,0 +1,77 @@ +#ifndef GEN_QPRINTPREVIEWWIDGET_H +#define GEN_QPRINTPREVIEWWIDGET_H + +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +#include "../../libmiqt/libmiqt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +class QMetaObject; +class QPrintPreviewWidget; +class QPrinter; +class QWidget; +#else +typedef struct QMetaObject QMetaObject; +typedef struct QPrintPreviewWidget QPrintPreviewWidget; +typedef struct QPrinter QPrinter; +typedef struct QWidget QWidget; +#endif + +QPrintPreviewWidget* QPrintPreviewWidget_new(QPrinter* printer); +QPrintPreviewWidget* QPrintPreviewWidget_new2(); +QPrintPreviewWidget* QPrintPreviewWidget_new3(QPrinter* printer, QWidget* parent); +QPrintPreviewWidget* QPrintPreviewWidget_new4(QPrinter* printer, QWidget* parent, int flags); +QPrintPreviewWidget* QPrintPreviewWidget_new5(QWidget* parent); +QPrintPreviewWidget* QPrintPreviewWidget_new6(QWidget* parent, int flags); +QMetaObject* QPrintPreviewWidget_MetaObject(const QPrintPreviewWidget* self); +void* QPrintPreviewWidget_Metacast(QPrintPreviewWidget* self, const char* param1); +struct miqt_string* QPrintPreviewWidget_Tr(const char* s); +struct miqt_string* QPrintPreviewWidget_TrUtf8(const char* s); +double QPrintPreviewWidget_ZoomFactor(const QPrintPreviewWidget* self); +int QPrintPreviewWidget_Orientation(const QPrintPreviewWidget* self); +int QPrintPreviewWidget_ViewMode(const QPrintPreviewWidget* self); +int QPrintPreviewWidget_ZoomMode(const QPrintPreviewWidget* self); +int QPrintPreviewWidget_CurrentPage(const QPrintPreviewWidget* self); +int QPrintPreviewWidget_PageCount(const QPrintPreviewWidget* self); +void QPrintPreviewWidget_SetVisible(QPrintPreviewWidget* self, bool visible); +void QPrintPreviewWidget_Print(QPrintPreviewWidget* self); +void QPrintPreviewWidget_ZoomIn(QPrintPreviewWidget* self); +void QPrintPreviewWidget_ZoomOut(QPrintPreviewWidget* self); +void QPrintPreviewWidget_SetZoomFactor(QPrintPreviewWidget* self, double zoomFactor); +void QPrintPreviewWidget_SetOrientation(QPrintPreviewWidget* self, int orientation); +void QPrintPreviewWidget_SetViewMode(QPrintPreviewWidget* self, int viewMode); +void QPrintPreviewWidget_SetZoomMode(QPrintPreviewWidget* self, int zoomMode); +void QPrintPreviewWidget_SetCurrentPage(QPrintPreviewWidget* self, int pageNumber); +void QPrintPreviewWidget_FitToWidth(QPrintPreviewWidget* self); +void QPrintPreviewWidget_FitInView(QPrintPreviewWidget* self); +void QPrintPreviewWidget_SetLandscapeOrientation(QPrintPreviewWidget* self); +void QPrintPreviewWidget_SetPortraitOrientation(QPrintPreviewWidget* self); +void QPrintPreviewWidget_SetSinglePageViewMode(QPrintPreviewWidget* self); +void QPrintPreviewWidget_SetFacingPagesViewMode(QPrintPreviewWidget* self); +void QPrintPreviewWidget_SetAllPagesViewMode(QPrintPreviewWidget* self); +void QPrintPreviewWidget_UpdatePreview(QPrintPreviewWidget* self); +void QPrintPreviewWidget_PaintRequested(QPrintPreviewWidget* self, QPrinter* printer); +void QPrintPreviewWidget_connect_PaintRequested(QPrintPreviewWidget* self, intptr_t slot); +void QPrintPreviewWidget_PreviewChanged(QPrintPreviewWidget* self); +void QPrintPreviewWidget_connect_PreviewChanged(QPrintPreviewWidget* self, intptr_t slot); +struct miqt_string* QPrintPreviewWidget_Tr2(const char* s, const char* c); +struct miqt_string* QPrintPreviewWidget_Tr3(const char* s, const char* c, int n); +struct miqt_string* QPrintPreviewWidget_TrUtf82(const char* s, const char* c); +struct miqt_string* QPrintPreviewWidget_TrUtf83(const char* s, const char* c, int n); +void QPrintPreviewWidget_ZoomIn1(QPrintPreviewWidget* self, double zoom); +void QPrintPreviewWidget_ZoomOut1(QPrintPreviewWidget* self, double zoom); +void QPrintPreviewWidget_Delete(QPrintPreviewWidget* self); + +#ifdef __cplusplus +} /* extern C */ +#endif + +#endif