diff --git a/cmd/genbindings/exceptions.go b/cmd/genbindings/exceptions.go index edb5c03c..5b1ed189 100644 --- a/cmd/genbindings/exceptions.go +++ b/cmd/genbindings/exceptions.go @@ -69,6 +69,11 @@ func ImportHeaderForClass(className string) bool { return false } + if strings.HasPrefix(className, "Qsci") { + // QScintilla - does not produce imports + return false + } + switch className { case "QGraphicsEffectSource", // e.g. qgraphicseffect.h "QAbstractConcatenable", // qstringbuilder.h @@ -150,6 +155,12 @@ func CheckComplexity(p CppParameter, isReturnType bool) error { if err := CheckComplexity(t, isReturnType); err != nil { // e.g. QGradientStops is a QVector<> (OK) of QGradientStop (not OK) return err } + + // qsciscintilla.h QsciScintilla_Annotate4: no copy ctor for private type QsciStyledText + // Works fine normally, but not in a list + if t.ParameterType == "QsciStyledText" { + return ErrTooComplex + } } if strings.Contains(p.ParameterType, "(*)") { // Function pointer. diff --git a/cmd/genbindings/main.go b/cmd/genbindings/main.go index 3e332255..52150a55 100644 --- a/cmd/genbindings/main.go +++ b/cmd/genbindings/main.go @@ -23,6 +23,8 @@ func importPathForQtPackage(packageName string) string { switch packageName { case "qt": return BaseModule + "/qt" + case "qscintilla": + return BaseModule + "/qt-restricted-extras/" + packageName default: return BaseModule + "/qt/" + packageName } @@ -126,6 +128,18 @@ func main() { filepath.Join(*outDir, "qt/qprintsupport"), ClangMatchSameHeaderDefinitionOnly, ) + + // Depends on QtCore/Gui/Widgets, QPrintSupport + generate( + "qscintilla", + []string{ + "/usr/include/x86_64-linux-gnu/qt5/Qsci", + }, + *clang, + strings.Fields(pkgConfigCflags("Qt5PrintSupport")), + filepath.Join(*outDir, "qt-restricted-extras/qscintilla"), + ClangMatchSameHeaderDefinitionOnly, + ) } func generate(packageName string, srcDirs []string, clangBin string, cflags []string, outDir string, matcher ClangMatcher) { diff --git a/docker/genbindings.Dockerfile b/docker/genbindings.Dockerfile index 749a36e8..0589d25d 100644 --- a/docker/genbindings.Dockerfile +++ b/docker/genbindings.Dockerfile @@ -1,4 +1,16 @@ FROM debian:bookworm RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ - apt-get install -qyy golang-go qtbase5-dev clang + apt-get install --no-install-recommends -qyy \ + golang-go \ + qtbase5-dev \ + libqscintilla2-qt5-dev \ + clang \ + git \ + ca-certificates \ + pkg-config \ + build-essential && \ + apt-get clean +RUN mkdir -p /usr/local/lib/pkgconfig +COPY pkg-config/QScintilla.pc.example /usr/local/lib/pkgconfig/QScintilla.pc +ENV GOFLAGS=-buildvcs=false diff --git a/pkg-config/QScintilla.pc.example b/pkg-config/QScintilla.pc.example new file mode 100644 index 00000000..fc740710 --- /dev/null +++ b/pkg-config/QScintilla.pc.example @@ -0,0 +1,9 @@ +includedir=/usr/include/x86_64-linux-gnu/qt5/Qsci/ + +Name: QScintilla +Description: Qt5 port of the Scintilla source code editing widget +URL: http://www.riverbankcomputing.co.uk/software/qscintilla +Version: 2.13.3 +Requires: Qt5Widgets, Qt5PrintSupport +Libs: -lqscintilla2_qt5 +Cflags: -I${includedir} diff --git a/qt-restricted-extras/qscintilla/cflags.go b/qt-restricted-extras/qscintilla/cflags.go new file mode 100644 index 00000000..391f0d16 --- /dev/null +++ b/qt-restricted-extras/qscintilla/cflags.go @@ -0,0 +1,8 @@ +package qscintilla + +/* +#cgo CFLAGS: +#cgo CXXFLAGS: -std=c++17 +#cgo pkg-config: QScintilla +*/ +import "C"