diff --git a/CHANGELOG.md b/CHANGELOG.md index 4de9317cb9e..86c74c2bf82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Increase the amount of function pointers available for callbacks in presets for Qt ([pull #1080](https://github.com/bytedeco/javacpp-presets/pull/1080)) * Map C++ JIT classes and functions of TorchScript in presets for PyTorch ([issue #1068](https://github.com/bytedeco/javacpp-presets/issues/1068)) * Synchronize `cachePackage()` and prevent repeated package caching in all presets ([pull #1071](https://github.com/bytedeco/javacpp-presets/pull/1071)) * Build FFmpeg with VA-API enabled and bundle its libraries to avoid loading issues ([issue bytedeco/javacv#1188](https://github.com/bytedeco/javacv/issues/1188)) diff --git a/qt/src/main/java/org/bytedeco/qt/helper/Qt5Widgets.java b/qt/src/main/java/org/bytedeco/qt/helper/Qt5Widgets.java index cf09a8f23db..01ab8b826a8 100644 --- a/qt/src/main/java/org/bytedeco/qt/helper/Qt5Widgets.java +++ b/qt/src/main/java/org/bytedeco/qt/helper/Qt5Widgets.java @@ -30,6 +30,7 @@ import org.bytedeco.javacpp.FunctionPointer; import org.bytedeco.javacpp.Loader; import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.Allocator; import org.bytedeco.javacpp.annotation.Cast; import org.bytedeco.javacpp.annotation.Const; import org.bytedeco.javacpp.annotation.Name; @@ -49,6 +50,7 @@ public class Qt5Widgets extends org.bytedeco.qt.presets.Qt5Widgets { @Name("[=](const QAbstractButton *sender, const QObject *context, void (*functor)(int, bool), int target){QObject::connect(sender, &QAbstractButton::clicked, context, [functor,target](bool checked){functor(target, checked);});}") public native static void QAbstractButton_clicked(@Const QAbstractButton sender, @Const QObject context, ClickedCallback functor, int target); + @Allocator(max = 100) public static class ClickedCallback extends FunctionPointer { static { Loader.load(); } private static List cbs = Collections.synchronizedList(new ArrayList()); @@ -73,6 +75,7 @@ public void clicked(boolean checked) {} @Name("[=](const QAbstractButton *sender, const QObject *context, void (*functor)(int, bool), int target){QObject::connect(sender, &QAbstractButton::toggled, context, [functor,target](bool checked){functor(target, checked);});}") public native static void QAbstractButton_toggled(@Const QAbstractButton sender, @Const QObject context, ToggledCallback functor, int target); + @Allocator(max = 100) public static class ToggledCallback extends FunctionPointer { static { Loader.load(); } private static List cbs = Collections.synchronizedList(new ArrayList()); @@ -92,6 +95,7 @@ public void toggled(boolean checked) {} @Name("[=](const QAction *sender, const QObject *context, void (*functor)(int, bool), int target){QObject::connect(sender, &QAction::triggered, context, [functor,target](bool checked){functor(target, checked);});}") public native static void QAction_triggered(@Const QAction sender, @Const QObject context, TriggeredCallback functor, int target); + @Allocator(max = 100) public static class TriggeredCallback extends FunctionPointer { static { Loader.load(); } private static List cbs = Collections.synchronizedList(new ArrayList()); @@ -140,6 +144,7 @@ public void currentIndexChanged(int index) {} @Name("[=](const QSystemTrayIcon *sender, const QObject *context, void (*functor)(int, QSystemTrayIcon::ActivationReason), int target){QObject::connect(sender, &QSystemTrayIcon::activated, context, [functor,target](QSystemTrayIcon::ActivationReason reason){functor(target, reason);});}") public native static void QSystemTrayIcon_activated(@Const QSystemTrayIcon sender, @Const QObject context, ActivatedCallback functor, int target); + @Allocator(max = 100) public static class ActivatedCallback extends FunctionPointer { static { Loader.load(); } private static List cbs = Collections.synchronizedList(new ArrayList()); @@ -164,6 +169,7 @@ public void activated(QSystemTrayIcon.ActivationReason reason) {} @Name("[=](const QSystemTrayIcon *sender, const QObject *context, void (*functor)(int), int target){QObject::connect(sender, &QSystemTrayIcon::messageClicked, context, [functor,target](){functor(target);});}") public native static void QSystemTrayIcon_messageClicked(@Const QSystemTrayIcon sender, @Const QObject context, MessageClickedCallback functor, int target); + @Allocator(max = 100) public static class MessageClickedCallback extends FunctionPointer { static { Loader.load(); } private static List cbs = Collections.synchronizedList(new ArrayList());