KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
KDDWBindingsCore/TabBar_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 "TabBar_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::TabBar(tabWidget)
35{
36}
38{
39 return ::KDDockWidgets::Core::TabBar::currentDockWidget();
40}
42{
43 return ::KDDockWidgets::Core::TabBar::currentIndex();
44}
46{
47 return ::KDDockWidgets::Core::TabBar::dockWidgetAt(localPos);
48}
50{
51 return ::KDDockWidgets::Core::TabBar::dockWidgetAt(index);
52}
53bool TabBar_wrapper::dragCanStart(KDDockWidgets::Point pressPos, KDDockWidgets::Point pos) const
54{
56 const void *thisPtr = this;
57 return m_dragCanStartCallback(const_cast<void *>(thisPtr), &pressPos, &pos);
58 } else {
59 return ::KDDockWidgets::Core::TabBar::dragCanStart(pressPos, pos);
60 }
61}
62bool TabBar_wrapper::dragCanStart_nocallback(KDDockWidgets::Point pressPos, KDDockWidgets::Point pos) const
63{
64 return ::KDDockWidgets::Core::TabBar::dragCanStart(pressPos, pos);
65}
67{
68 return ::KDDockWidgets::Core::TabBar::group();
69}
71{
72 return ::KDDockWidgets::Core::TabBar::hasSingleDockWidget();
73}
75{
76 return ::KDDockWidgets::Core::TabBar::indexOfDockWidget(dw);
77}
79{
80 if (m_isMDICallback) {
81 const void *thisPtr = this;
82 return m_isMDICallback(const_cast<void *>(thisPtr));
83 } else {
84 return ::KDDockWidgets::Core::TabBar::isMDI();
85 }
86}
88{
89 return ::KDDockWidgets::Core::TabBar::isMDI();
90}
92{
93 return ::KDDockWidgets::Core::TabBar::isMovingTab();
94}
96{
98 const void *thisPtr = this;
99 return m_isWindowCallback(const_cast<void *>(thisPtr));
100 } else {
101 return ::KDDockWidgets::Core::TabBar::isWindow();
102 }
103}
105{
106 return ::KDDockWidgets::Core::TabBar::isWindow();
107}
108void TabBar_wrapper::moveTabTo(int from, int to)
109{
111}
113{
114 return ::KDDockWidgets::Core::TabBar::numDockWidgets();
115}
116void TabBar_wrapper::onMouseDoubleClick(KDDockWidgets::Point localPos)
117{
119}
120void TabBar_wrapper::onMousePress(KDDockWidgets::Point localPos)
121{
123}
124KDDockWidgets::Rect TabBar_wrapper::rectForTab(int index) const
125{
126 return ::KDDockWidgets::Core::TabBar::rectForTab(index);
127}
132void TabBar_wrapper::renameTab(int index, const QString &arg__2)
133{
135}
145{
147 const void *thisPtr = this;
148 m_setParentView_implCallback(const_cast<void *>(thisPtr), parent);
149 } else {
151 }
152}
158{
159 return ::KDDockWidgets::Core::TabBar::stack();
160}
162{
163 return ::KDDockWidgets::Core::TabBar::tabsAreMovable();
164}
166{
167 return ::KDDockWidgets::Core::TabBar::text(index);
168}
172
173}
174}
176{
177 return reinterpret_cast<KDDockWidgets::Core::TabBar *>(ptr);
178}
183extern "C" {
189{
190 auto tabWidget = reinterpret_cast<KDDockWidgets::Core::Stack *>(tabWidget_);
192 return reinterpret_cast<void *>(ptr);
193}
194// currentDockWidget() const
196{
197 const auto &result = fromPtr(thisObj)->currentDockWidget();
198 return result;
199}
200// currentIndex() const
202{
203 const auto &result = fromPtr(thisObj)->currentIndex();
204 return result;
205}
206// dockWidgetAt(KDDockWidgets::Point localPos) const
207void *c_KDDockWidgets__Core__TabBar__dockWidgetAt_Point(void *thisObj, void *localPos_)
208{
209 assert(localPos_);
210 auto &localPos = *reinterpret_cast<KDDockWidgets::Point *>(localPos_);
211 const auto &result = fromPtr(thisObj)->dockWidgetAt(localPos);
212 return result;
213}
214// dockWidgetAt(int index) const
216{
217 const auto &result = fromPtr(thisObj)->dockWidgetAt(index);
218 return result;
219}
220// dragCanStart(KDDockWidgets::Point pressPos, KDDockWidgets::Point pos) const
221bool c_KDDockWidgets__Core__TabBar__dragCanStart_Point_Point(void *thisObj, void *pressPos_, void *pos_)
222{
223 assert(pressPos_);
224 auto &pressPos = *reinterpret_cast<KDDockWidgets::Point *>(pressPos_);
225 assert(pos_);
226 auto &pos = *reinterpret_cast<KDDockWidgets::Point *>(pos_);
227 const auto &result = [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->dragCanStart_nocallback(pressPos,pos);} else { return targetPtr->dragCanStart(pressPos,pos);} }();
228 return result;
229}
230// group() const
232{
233 const auto &result = fromPtr(thisObj)->group();
234 return result;
235}
236// hasSingleDockWidget() const
238{
239 const auto &result = fromPtr(thisObj)->hasSingleDockWidget();
240 return result;
241}
242// indexOfDockWidget(const KDDockWidgets::Core::DockWidget * dw) const
244{
245 auto dw = reinterpret_cast<KDDockWidgets::Core::DockWidget *>(dw_);
246 const auto &result = fromPtr(thisObj)->indexOfDockWidget(dw);
247 return result;
248}
249// isMDI() const
251{
252 const auto &result = [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->isMDI_nocallback();} else { return targetPtr->isMDI();} }();
253 return result;
254}
255// isMovingTab() const
257{
258 const auto &result = fromPtr(thisObj)->isMovingTab();
259 return result;
260}
261// isWindow() const
263{
264 const auto &result = [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->isWindow_nocallback();} else { return targetPtr->isWindow();} }();
265 return result;
266}
267// moveTabTo(int from, int to)
268void c_KDDockWidgets__Core__TabBar__moveTabTo_int_int(void *thisObj, int from, int to)
269{
270 fromPtr(thisObj)->moveTabTo(from, to);
271}
272// numDockWidgets() const
274{
275 const auto &result = fromPtr(thisObj)->numDockWidgets();
276 return result;
277}
278// onMouseDoubleClick(KDDockWidgets::Point localPos)
280{
281 assert(localPos_);
282 auto &localPos = *reinterpret_cast<KDDockWidgets::Point *>(localPos_);
283 fromPtr(thisObj)->onMouseDoubleClick(localPos);
284}
285// onMousePress(KDDockWidgets::Point localPos)
286void c_KDDockWidgets__Core__TabBar__onMousePress_Point(void *thisObj, void *localPos_)
287{
288 assert(localPos_);
289 auto &localPos = *reinterpret_cast<KDDockWidgets::Point *>(localPos_);
290 fromPtr(thisObj)->onMousePress(localPos);
291}
292// rectForTab(int index) const
294{
295 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Rect> { fromPtr(thisObj)->rectForTab(index) };
296 return result;
297}
298// removeDockWidget(KDDockWidgets::Core::DockWidget * dw)
300{
301 auto dw = reinterpret_cast<KDDockWidgets::Core::DockWidget *>(dw_);
302 fromPtr(thisObj)->removeDockWidget(dw);
303}
304// renameTab(int index, const QString & arg__2)
305void c_KDDockWidgets__Core__TabBar__renameTab_int_QString(void *thisObj, int index, const char *arg__2_)
306{
307 const auto arg__2 = QString::fromUtf8(arg__2_);
308 fromPtr(thisObj)->renameTab(index, arg__2);
309 free(( char * )arg__2_);
310}
311// setCurrentDockWidget(KDDockWidgets::Core::DockWidget * dw)
313{
314 auto dw = reinterpret_cast<KDDockWidgets::Core::DockWidget *>(dw_);
315 fromPtr(thisObj)->setCurrentDockWidget(dw);
316}
317// setCurrentIndex(int index)
319{
320 fromPtr(thisObj)->setCurrentIndex(index);
321}
322// setParentView_impl(KDDockWidgets::Core::View * parent)
324{
325 auto parent = reinterpret_cast<KDDockWidgets::Core::View *>(parent_);
327}
328// singleDockWidget() const
330{
331 const auto &result = fromPtr(thisObj)->singleDockWidget();
332 return result;
333}
334// stack() const
336{
337 const auto &result = fromPtr(thisObj)->stack();
338 return result;
339}
340// tabsAreMovable() const
342{
343 const auto &result = fromPtr(thisObj)->tabsAreMovable();
344 return result;
345}
346// text(int index) const
347void *c_KDDockWidgets__Core__TabBar__text_int(void *thisObj, int index)
348{
349 const auto &result = new Dartagnan::ValueWrapper<QString> { fromPtr(thisObj)->text(index) };
350 return result;
351}
353{
354 delete fromPtr(thisObj);
355}
356void c_KDDockWidgets__Core__TabBar__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
357{
358 auto wrapper = fromWrapperPtr(ptr);
359 switch (methodId) {
360 case 605:
361 wrapper->m_dragCanStartCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper::Callback_dragCanStart>(callback);
362 break;
363 case 615:
364 wrapper->m_isMDICallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper::Callback_isMDI>(callback);
365 break;
366 case 618:
367 wrapper->m_isWindowCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper::Callback_isWindow>(callback);
368 break;
369 case 331:
370 wrapper->m_setParentView_implCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper::Callback_setParentView_impl>(callback);
371 break;
372 case 634:
373 wrapper->m_singleDockWidgetCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper::Callback_singleDockWidget>(callback);
374 break;
375 }
376}
377}
void c_KDDockWidgets__Core__TabBar__renameTab_int_QString(void *thisObj, int index, const char *arg__2_)
void * c_KDDockWidgets__Core__TabBar__group(void *thisObj)
bool c_KDDockWidgets__Core__TabBar__dragCanStart_Point_Point(void *thisObj, void *pressPos_, void *pos_)
void c_KDDockWidgets__Core__TabBar__setParentView_impl_View(void *thisObj, void *parent_)
void c_KDDockWidgets__Core__TabBar__setCurrentIndex_int(void *thisObj, int index)
void c_KDDockWidgets__Core__TabBar__setCurrentDockWidget_DockWidget(void *thisObj, void *dw_)
int c_KDDockWidgets__Core__TabBar__numDockWidgets(void *thisObj)
void c_KDDockWidgets__Core__TabBar__destructor(void *thisObj)
void * c_KDDockWidgets__Core__TabBar__stack(void *thisObj)
int c_KDDockWidgets__Core__TabBar__indexOfDockWidget_DockWidget(void *thisObj, void *dw_)
static KDDockWidgets::Core::TabBar * fromPtr(void *ptr)
void * c_KDDockWidgets__Core__TabBar__rectForTab_int(void *thisObj, int index)
void c_KDDockWidgets__Core__TabBar_Finalizer(void *cppObj)
void * c_KDDockWidgets__Core__TabBar__text_int(void *thisObj, int index)
bool c_KDDockWidgets__Core__TabBar__hasSingleDockWidget(void *thisObj)
bool c_KDDockWidgets__Core__TabBar__isMovingTab(void *thisObj)
void * c_KDDockWidgets__Core__TabBar__currentDockWidget(void *thisObj)
void c_KDDockWidgets__Core__TabBar__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
void c_KDDockWidgets__Core__TabBar__onMousePress_Point(void *thisObj, void *localPos_)
void c_KDDockWidgets__Core__TabBar__moveTabTo_int_int(void *thisObj, int from, int to)
void c_KDDockWidgets__Core__TabBar__removeDockWidget_DockWidget(void *thisObj, void *dw_)
void c_KDDockWidgets__Core__TabBar__onMouseDoubleClick_Point(void *thisObj, void *localPos_)
void * c_KDDockWidgets__Core__TabBar__singleDockWidget(void *thisObj)
bool c_KDDockWidgets__Core__TabBar__isWindow(void *thisObj)
void * c_KDDockWidgets__Core__TabBar__constructor_Stack(void *tabWidget_)
bool c_KDDockWidgets__Core__TabBar__isMDI(void *thisObj)
void * c_KDDockWidgets__Core__TabBar__dockWidgetAt_Point(void *thisObj, void *localPos_)
int c_KDDockWidgets__Core__TabBar__currentIndex(void *thisObj)
void * c_KDDockWidgets__Core__TabBar__dockWidgetAt_int(void *thisObj, int index)
static KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TabBar_wrapper * fromWrapperPtr(void *ptr)
bool c_KDDockWidgets__Core__TabBar__tabsAreMovable(void *thisObj)
void(* Callback_setParentView_impl)(void *, KDDockWidgets::Core::View *parent)
virtual void setParentView_impl_nocallback(KDDockWidgets::Core::View *parent)
KDDockWidgets::Core::DockWidget * dockWidgetAt(KDDockWidgets::Point localPos) const
int indexOfDockWidget(const KDDockWidgets::Core::DockWidget *dw) const
virtual bool dragCanStart(KDDockWidgets::Point pressPos, KDDockWidgets::Point pos) const
bool(* Callback_dragCanStart)(void *, KDDockWidgets::Point *pressPos, KDDockWidgets::Point *pos)
virtual bool dragCanStart_nocallback(KDDockWidgets::Point pressPos, KDDockWidgets::Point pos) const
virtual void setParentView_impl(View *parent)
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
void renameTab(int index, const QString &)
rename's the tab's text
void removeDockWidget(Core::DockWidget *dw)
int currentIndex() const
Returns the index of the current tab.
DockWidget * currentDockWidget() const
Returns the current dock widget.
void onMouseDoubleClick(Point localPos)
bool isMovingTab() const
Returns whether we're inside Core::TabBar::moveTab()
bool hasSingleDockWidget() const
returns whether there's only 1 tab
void moveTabTo(int from, int to)
void setCurrentIndex(int index)
DockWidget * singleDockWidget() const override final
DockWidget * dockWidgetAt(int index) const
returns the dock widgets at tab number index
void onMousePress(Point localPos)
Rect rectForTab(int index) const
int indexOfDockWidget(const Core::DockWidget *dw) const
Returns the tab index of the specified dock widget.
QString text(int index) const
void setCurrentDockWidget(DockWidget *dw)
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.
QString fromUtf8(const char *str, int size)

© 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