Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase available Callbacks for Qt #1080

Merged
merged 4 commits into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
6 changes: 6 additions & 0 deletions qt/src/main/java/org/bytedeco/qt/helper/Qt5Widgets.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<ClickedCallback> cbs = Collections.synchronizedList(new ArrayList<ClickedCallback>());
Expand All @@ -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<ToggledCallback> cbs = Collections.synchronizedList(new ArrayList<ToggledCallback>());
Expand All @@ -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<TriggeredCallback> cbs = Collections.synchronizedList(new ArrayList<TriggeredCallback>());
Expand Down Expand Up @@ -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<ActivatedCallback> cbs = Collections.synchronizedList(new ArrayList<ActivatedCallback>());
Expand All @@ -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<MessageClickedCallback> cbs = Collections.synchronizedList(new ArrayList<MessageClickedCallback>());
Expand Down