KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
DelayedCall_c.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11#include "DelayedCall_c.h"
12
13
14#include <iostream>
15
16#include <cassert>
17
18
19namespace Dartagnan {
20
21typedef int (*CleanupCallback)(void *thisPtr);
23
24template<typename T>
25struct ValueWrapper
26{
27 T value;
28};
29
30}
32namespace KDDWBindingsCore {
34 : ::KDDockWidgets::Core::DelayedCall()
35{
36}
38{
39 if (m_callCallback) {
40 const void *thisPtr = this;
41 m_callCallback(const_cast<void *>(thisPtr));
42 } else {
43 std::cerr << "call: Warning: Calling pure-virtual\n";
44 return;
45 }
46}
48{
49 std::cerr << "call: Warning: Calling pure-virtual\n";
50 return;
51}
55
56}
57}
58static KDDockWidgets::Core::DelayedCall *fromPtr(void *ptr)
59{
60 return reinterpret_cast<KDDockWidgets::Core::DelayedCall *>(ptr);
61}
66extern "C" {
76// call()
78{
79 [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::DelayedCall_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->call_nocallback();} else { return targetPtr->call();} }();
80}
82{
83 delete fromPtr(thisObj);
84}
85void c_KDDockWidgets__Core__DelayedCall__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
86{
87 auto wrapper = fromWrapperPtr(ptr);
88 switch (methodId) {
89 case 307:
90 wrapper->m_callCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::DelayedCall_wrapper::Callback_call>(callback);
91 break;
92 }
93}
94}
void c_KDDockWidgets__Core__DelayedCall__call(void *thisObj)
void c_KDDockWidgets__Core__DelayedCall_Finalizer(void *cppObj)
static KDDockWidgets::Core::DelayedCall * fromPtr(void *ptr)
static KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::DelayedCall_wrapper * fromWrapperPtr(void *ptr)
void c_KDDockWidgets__Core__DelayedCall__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
void * c_KDDockWidgets__Core__DelayedCall__constructor()
void c_KDDockWidgets__Core__DelayedCall__destructor(void *thisObj)
int(* CleanupCallback)(void *thisPtr)
Definition Config_c.cpp:21
static CleanupCallback s_cleanupCallback
Definition Config_c.cpp:22
Class to abstract QAction, so code still works with QtQuick and Flutter.

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8