qscintilla: add support

This commit is contained in:
mappu 2024-10-20 17:59:13 +13:00
parent 8a0c7029ed
commit 7ff290b7d1
5 changed files with 55 additions and 1 deletions

View File

@ -69,6 +69,11 @@ func ImportHeaderForClass(className string) bool {
return false return false
} }
if strings.HasPrefix(className, "Qsci") {
// QScintilla - does not produce imports
return false
}
switch className { switch className {
case "QGraphicsEffectSource", // e.g. qgraphicseffect.h case "QGraphicsEffectSource", // e.g. qgraphicseffect.h
"QAbstractConcatenable", // qstringbuilder.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) if err := CheckComplexity(t, isReturnType); err != nil { // e.g. QGradientStops is a QVector<> (OK) of QGradientStop (not OK)
return err 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. if strings.Contains(p.ParameterType, "(*)") { // Function pointer.

View File

@ -23,6 +23,8 @@ func importPathForQtPackage(packageName string) string {
switch packageName { switch packageName {
case "qt": case "qt":
return BaseModule + "/qt" return BaseModule + "/qt"
case "qscintilla":
return BaseModule + "/qt-restricted-extras/" + packageName
default: default:
return BaseModule + "/qt/" + packageName return BaseModule + "/qt/" + packageName
} }
@ -126,6 +128,18 @@ func main() {
filepath.Join(*outDir, "qt/qprintsupport"), filepath.Join(*outDir, "qt/qprintsupport"),
ClangMatchSameHeaderDefinitionOnly, 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) { func generate(packageName string, srcDirs []string, clangBin string, cflags []string, outDir string, matcher ClangMatcher) {

View File

@ -1,4 +1,16 @@
FROM debian:bookworm FROM debian:bookworm
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ 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

View File

@ -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}

View File

@ -0,0 +1,8 @@
package qscintilla
/*
#cgo CFLAGS:
#cgo CXXFLAGS: -std=c++17
#cgo pkg-config: QScintilla
*/
import "C"