KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
FloatingWindow_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 "FloatingWindow_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::FloatingWindow(group, suggestedGeometry, parent)
35{
36}
38 : ::KDDockWidgets::Core::FloatingWindow(suggestedGeometry, parent)
39{
40}
46{
47 return ::KDDockWidgets::Core::FloatingWindow::allDockWidgetsHave(arg__1);
48}
50{
51 return ::KDDockWidgets::Core::FloatingWindow::allDockWidgetsHave(arg__1);
52}
54{
55 return ::KDDockWidgets::Core::FloatingWindow::anyDockWidgetsHas(arg__1);
56}
58{
59 return ::KDDockWidgets::Core::FloatingWindow::anyDockWidgetsHas(arg__1);
60}
62{
63 return ::KDDockWidgets::Core::FloatingWindow::anyNonClosable();
64}
66{
67 return ::KDDockWidgets::Core::FloatingWindow::anyNonDockable();
68}
70{
71 return ::KDDockWidgets::Core::FloatingWindow::beingDeleted();
72}
73KDDockWidgets::Margins FloatingWindow_wrapper::contentMargins() const
74{
75 return ::KDDockWidgets::Core::FloatingWindow::contentMargins();
76}
77KDDockWidgets::Rect FloatingWindow_wrapper::dragRect() const
78{
79 return ::KDDockWidgets::Core::FloatingWindow::dragRect();
80}
82{
83 return ::KDDockWidgets::Core::FloatingWindow::dropArea();
84}
90{
91 return ::KDDockWidgets::Core::FloatingWindow::hasSingleDockWidget();
92}
94{
95 return ::KDDockWidgets::Core::FloatingWindow::hasSingleGroup();
96}
97bool FloatingWindow_wrapper::isInDragArea(KDDockWidgets::Point globalPoint) const
98{
99 return ::KDDockWidgets::Core::FloatingWindow::isInDragArea(globalPoint);
100}
102{
103 if (m_isMDICallback) {
104 const void *thisPtr = this;
105 return m_isMDICallback(const_cast<void *>(thisPtr));
106 } else {
107 return ::KDDockWidgets::Core::FloatingWindow::isMDI();
108 }
109}
111{
112 return ::KDDockWidgets::Core::FloatingWindow::isMDI();
113}
115{
116 return ::KDDockWidgets::Core::FloatingWindow::isUtilityWindow();
117}
119{
120 if (m_isWindowCallback) {
121 const void *thisPtr = this;
122 return m_isWindowCallback(const_cast<void *>(thisPtr));
123 } else {
124 return ::KDDockWidgets::Core::FloatingWindow::isWindow();
125 }
126}
128{
129 return ::KDDockWidgets::Core::FloatingWindow::isWindow();
130}
132{
133 return ::KDDockWidgets::Core::FloatingWindow::layout();
134}
136{
137 return ::KDDockWidgets::Core::FloatingWindow::mainWindow();
138}
144{
145 return ::KDDockWidgets::Core::FloatingWindow::multiSplitter();
146}
152{
154 const void *thisPtr = this;
155 m_setParentView_implCallback(const_cast<void *>(thisPtr), parent);
156 } else {
158 }
159}
164void FloatingWindow_wrapper::setSuggestedGeometry(KDDockWidgets::Rect suggestedRect)
165{
167}
169{
170 return ::KDDockWidgets::Core::FloatingWindow::singleFrame();
171}
173{
174 return ::KDDockWidgets::Core::FloatingWindow::supportsMaximizeButton();
175}
177{
178 return ::KDDockWidgets::Core::FloatingWindow::supportsMinimizeButton();
179}
181{
182 return ::KDDockWidgets::Core::FloatingWindow::titleBar();
183}
193{
194 return ::KDDockWidgets::Core::FloatingWindow::userType();
195}
199
200}
201}
203{
204 return reinterpret_cast<KDDockWidgets::Core::FloatingWindow *>(ptr);
205}
210extern "C" {
215void *c_KDDockWidgets__Core__FloatingWindow__constructor_Group_Rect_MainWindow(void *group_, void *suggestedGeometry_, void *parent_)
216{
217 auto group = reinterpret_cast<KDDockWidgets::Core::Group *>(group_);
218 assert(suggestedGeometry_);
219 auto &suggestedGeometry = *reinterpret_cast<KDDockWidgets::Rect *>(suggestedGeometry_);
220 auto parent = reinterpret_cast<KDDockWidgets::Core::MainWindow *>(parent_);
221 auto ptr = new KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper(group, suggestedGeometry, parent);
222 return reinterpret_cast<void *>(ptr);
223}
224void *c_KDDockWidgets__Core__FloatingWindow__constructor_Rect_MainWindow(void *suggestedGeometry_, void *parent_)
225{
226 assert(suggestedGeometry_);
227 auto &suggestedGeometry = *reinterpret_cast<KDDockWidgets::Rect *>(suggestedGeometry_);
228 auto parent = reinterpret_cast<KDDockWidgets::Core::MainWindow *>(parent_);
230 return reinterpret_cast<void *>(ptr);
231}
232// addDockWidget(KDDockWidgets::Core::DockWidget * arg__1, KDDockWidgets::Location location, KDDockWidgets::Core::DockWidget * relativeTo, KDDockWidgets::InitialOption arg__4)
233void c_KDDockWidgets__Core__FloatingWindow__addDockWidget_DockWidget_Location_DockWidget_InitialOption(void *thisObj, void *arg__1_, int location, void *relativeTo_, void *arg__4_)
234{
235 auto arg__1 = reinterpret_cast<KDDockWidgets::Core::DockWidget *>(arg__1_);
236 auto relativeTo = reinterpret_cast<KDDockWidgets::Core::DockWidget *>(relativeTo_);
237 assert(arg__4_);
238 auto &arg__4 = *reinterpret_cast<KDDockWidgets::InitialOption *>(arg__4_);
239 fromPtr(thisObj)->addDockWidget(arg__1, static_cast<KDDockWidgets::Location>(location), relativeTo, arg__4);
240}
241// allDockWidgetsHave(KDDockWidgets::DockWidgetOption arg__1) const
243{
244 const auto &result = fromPtr(thisObj)->allDockWidgetsHave(static_cast<KDDockWidgets::DockWidgetOption>(arg__1));
245 return result;
246}
247// allDockWidgetsHave(KDDockWidgets::LayoutSaverOption arg__1) const
249{
250 const auto &result = fromPtr(thisObj)->allDockWidgetsHave(static_cast<KDDockWidgets::LayoutSaverOption>(arg__1));
251 return result;
252}
253// anyDockWidgetsHas(KDDockWidgets::DockWidgetOption arg__1) const
255{
256 const auto &result = fromPtr(thisObj)->anyDockWidgetsHas(static_cast<KDDockWidgets::DockWidgetOption>(arg__1));
257 return result;
258}
259// anyDockWidgetsHas(KDDockWidgets::LayoutSaverOption arg__1) const
261{
262 const auto &result = fromPtr(thisObj)->anyDockWidgetsHas(static_cast<KDDockWidgets::LayoutSaverOption>(arg__1));
263 return result;
264}
265// anyNonClosable() const
267{
268 const auto &result = fromPtr(thisObj)->anyNonClosable();
269 return result;
270}
271// anyNonDockable() const
273{
274 const auto &result = fromPtr(thisObj)->anyNonDockable();
275 return result;
276}
277// beingDeleted() const
279{
280 const auto &result = fromPtr(thisObj)->beingDeleted();
281 return result;
282}
283// contentMargins() const
285{
286 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Margins> { fromPtr(thisObj)->contentMargins() };
287 return result;
288}
289// dragRect() const
291{
292 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Rect> { fromPtr(thisObj)->dragRect() };
293 return result;
294}
295// dropArea() const
297{
298 const auto &result = fromPtr(thisObj)->dropArea();
299 return result;
300}
301// ensureRectIsOnScreen(KDDockWidgets::Rect & geometry)
303{
304 assert(geometry_);
305 auto &geometry = *reinterpret_cast<KDDockWidgets::Rect *>(geometry_);
307}
308// hasSingleDockWidget() const
310{
311 const auto &result = fromPtr(thisObj)->hasSingleDockWidget();
312 return result;
313}
314// hasSingleGroup() const
316{
317 const auto &result = fromPtr(thisObj)->hasSingleGroup();
318 return result;
319}
320// isInDragArea(KDDockWidgets::Point globalPoint) const
322{
323 assert(globalPoint_);
324 auto &globalPoint = *reinterpret_cast<KDDockWidgets::Point *>(globalPoint_);
325 const auto &result = fromPtr(thisObj)->isInDragArea(globalPoint);
326 return result;
327}
328// isMDI() const
330{
331 const auto &result = [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->isMDI_nocallback();} else { return targetPtr->isMDI();} }();
332 return result;
333}
334// isUtilityWindow() const
336{
337 const auto &result = fromPtr(thisObj)->isUtilityWindow();
338 return result;
339}
340// isWindow() const
342{
343 const auto &result = [&] {auto targetPtr = fromPtr(thisObj);auto wrapperPtr = dynamic_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper*>(targetPtr);if (wrapperPtr) { return wrapperPtr->isWindow_nocallback();} else { return targetPtr->isWindow();} }();
344 return result;
345}
346// layout() const
348{
349 const auto &result = fromPtr(thisObj)->layout();
350 return result;
351}
352// mainWindow() const
354{
355 const auto &result = fromPtr(thisObj)->mainWindow();
356 return result;
357}
358// maybeCreateResizeHandler()
363// multiSplitter() const
365{
366 const auto &result = fromPtr(thisObj)->multiSplitter();
367 return result;
368}
369// scheduleDeleteLater()
374// setParentView_impl(KDDockWidgets::Core::View * parent)
376{
377 auto parent = reinterpret_cast<KDDockWidgets::Core::View *>(parent_);
379}
380// setSuggestedGeometry(KDDockWidgets::Rect suggestedRect)
382{
383 assert(suggestedRect_);
384 auto &suggestedRect = *reinterpret_cast<KDDockWidgets::Rect *>(suggestedRect_);
385 fromPtr(thisObj)->setSuggestedGeometry(suggestedRect);
386}
387// singleDockWidget() const
389{
390 const auto &result = fromPtr(thisObj)->singleDockWidget();
391 return result;
392}
393// singleFrame() const
395{
396 const auto &result = fromPtr(thisObj)->singleFrame();
397 return result;
398}
399// supportsMaximizeButton() const
401{
402 const auto &result = fromPtr(thisObj)->supportsMaximizeButton();
403 return result;
404}
405// supportsMinimizeButton() const
407{
408 const auto &result = fromPtr(thisObj)->supportsMinimizeButton();
409 return result;
410}
411// titleBar() const
413{
414 const auto &result = fromPtr(thisObj)->titleBar();
415 return result;
416}
417// updateTitleAndIcon()
422// updateTitleBarVisibility()
427// userType() const
429{
430 const auto &result = fromPtr(thisObj)->userType();
431 return result;
432}
434{
435 delete fromPtr(thisObj);
436}
438{
439 auto wrapper = fromWrapperPtr(ptr);
440 switch (methodId) {
441 case 1003:
442 wrapper->m_isMDICallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper::Callback_isMDI>(callback);
443 break;
444 case 1006:
445 wrapper->m_isWindowCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper::Callback_isWindow>(callback);
446 break;
447 case 331:
448 wrapper->m_setParentView_implCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper::Callback_setParentView_impl>(callback);
449 break;
450 case 1022:
451 wrapper->m_singleDockWidgetCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper::Callback_singleDockWidget>(callback);
452 break;
453 }
454}
455}
void c_KDDockWidgets__Core__FloatingWindow__setSuggestedGeometry_Rect(void *thisObj, void *suggestedRect_)
void c_KDDockWidgets__Core__FloatingWindow__setParentView_impl_View(void *thisObj, void *parent_)
void * c_KDDockWidgets__Core__FloatingWindow__layout(void *thisObj)
int c_KDDockWidgets__Core__FloatingWindow__userType(void *thisObj)
void * c_KDDockWidgets__Core__FloatingWindow__dropArea(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__isInDragArea_Point(void *thisObj, void *globalPoint_)
bool c_KDDockWidgets__Core__FloatingWindow__anyDockWidgetsHas_LayoutSaverOption(void *thisObj, int arg__1)
bool c_KDDockWidgets__Core__FloatingWindow__supportsMaximizeButton(void *thisObj)
void * c_KDDockWidgets__Core__FloatingWindow__singleFrame(void *thisObj)
void c_KDDockWidgets__Core__FloatingWindow__scheduleDeleteLater(void *thisObj)
void * c_KDDockWidgets__Core__FloatingWindow__singleDockWidget(void *thisObj)
void c_KDDockWidgets__Core__FloatingWindow__updateTitleBarVisibility(void *thisObj)
void c_KDDockWidgets__Core__FloatingWindow__addDockWidget_DockWidget_Location_DockWidget_InitialOption(void *thisObj, void *arg__1_, int location, void *relativeTo_, void *arg__4_)
void c_KDDockWidgets__Core__FloatingWindow__maybeCreateResizeHandler(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__isUtilityWindow(void *thisObj)
static KDDockWidgets::Core::FloatingWindow * fromPtr(void *ptr)
void c_KDDockWidgets__Core__FloatingWindow_Finalizer(void *cppObj)
void * c_KDDockWidgets__Core__FloatingWindow__constructor_Group_Rect_MainWindow(void *group_, void *suggestedGeometry_, void *parent_)
bool c_KDDockWidgets__Core__FloatingWindow__anyDockWidgetsHas_DockWidgetOption(void *thisObj, int arg__1)
void * c_KDDockWidgets__Core__FloatingWindow__titleBar(void *thisObj)
void * c_KDDockWidgets__Core__FloatingWindow__contentMargins(void *thisObj)
void c_KDDockWidgets__Core__FloatingWindow__updateTitleAndIcon(void *thisObj)
static KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::FloatingWindow_wrapper * fromWrapperPtr(void *ptr)
void * c_KDDockWidgets__Core__FloatingWindow__multiSplitter(void *thisObj)
void c_static_KDDockWidgets__Core__FloatingWindow__ensureRectIsOnScreen_Rect(void *geometry_)
bool c_KDDockWidgets__Core__FloatingWindow__supportsMinimizeButton(void *thisObj)
void * c_KDDockWidgets__Core__FloatingWindow__dragRect(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__hasSingleDockWidget(void *thisObj)
void * c_KDDockWidgets__Core__FloatingWindow__mainWindow(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__isMDI(void *thisObj)
void c_KDDockWidgets__Core__FloatingWindow__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
bool c_KDDockWidgets__Core__FloatingWindow__anyNonClosable(void *thisObj)
void * c_KDDockWidgets__Core__FloatingWindow__constructor_Rect_MainWindow(void *suggestedGeometry_, void *parent_)
void c_KDDockWidgets__Core__FloatingWindow__destructor(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__beingDeleted(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__isWindow(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__allDockWidgetsHave_DockWidgetOption(void *thisObj, int arg__1)
bool c_KDDockWidgets__Core__FloatingWindow__hasSingleGroup(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__anyNonDockable(void *thisObj)
bool c_KDDockWidgets__Core__FloatingWindow__allDockWidgetsHave_LayoutSaverOption(void *thisObj, int arg__1)
bool allDockWidgetsHave(KDDockWidgets::DockWidgetOption arg__1) const
bool anyDockWidgetsHas(KDDockWidgets::DockWidgetOption arg__1) const
virtual void setParentView_impl_nocallback(KDDockWidgets::Core::View *parent)
void(* Callback_setParentView_impl)(void *, KDDockWidgets::Core::View *parent)
FloatingWindow_wrapper(KDDockWidgets::Core::Group *group, KDDockWidgets::Rect suggestedGeometry, KDDockWidgets::Core::MainWindow *parent=nullptr)
void addDockWidget(KDDockWidgets::Core::DockWidget *arg__1, KDDockWidgets::Location location, KDDockWidgets::Core::DockWidget *relativeTo, KDDockWidgets::InitialOption arg__4={})
virtual void setParentView_impl(View *parent)
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
bool hasSingleDockWidget() const
checks if this FloatingWindow only has one dockwidget. This is a more specific case than hasSingleGro...
bool supportsMaximizeButton() const
Returns whether this floating window supports showing a maximize button.
MainWindow * mainWindow() const
Returns the MainWindow which is the transient parent of this FloatingWindow Can be nullptr if you cre...
bool allDockWidgetsHave(DockWidgetOption) const
Returns whether all dock widgets have the specified option set.
void setSuggestedGeometry(Rect suggestedRect, SuggestedGeometryHints=SuggestedGeometryHint_None)
Equivalent to setGeometry(), but the value might be adjusted.
Core::DropArea * multiSplitter() const
Returns the MultiSplitter.
Margins contentMargins() const
Returns the contents margins.
bool anyDockWidgetsHas(DockWidgetOption) const
Returns whether at least one dock widget has the specified option set.
Core::DockWidget * singleDockWidget() const override final
bool isUtilityWindow() const
Returns whether this window is a tool window Tool windows don't usually appear in the task bar.
Core::Group * singleFrame() const
If this floating window has only one Frame, it's returned, otherwise nullptr.
void addDockWidget(DockWidget *, KDDockWidgets::Location location, DockWidget *relativeTo, const InitialOption &={})
Adds the dock widget to the specified location.
bool beingDeleted() const
Returns whether a deleteLater has already been issued.
static void ensureRectIsOnScreen(Rect &geometry)
bool isInDragArea(Point globalPoint) const
Returns whether globalPoint is inside the title bar (or, when there's no title-bar,...
void updateTitleAndIcon()
updates the title and the icon
Layout * layout() const
Returns the Layout.
bool hasSingleGroup() const
checks if this FloatingWindow only has one group. If true it means there's no side-by-side dock widge...
bool supportsMinimizeButton() const
Returns whether this floating window supports showing a minimize button.
void scheduleDeleteLater()
Equivalent to deleteLater() but sets beingDeleted() to true.
Core::TitleBar * titleBar() const
Returns the title bar.
The widget (QWidget or QQuickItem) which holds a layout of dock widgets.
Definition Layout.h:57
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
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.
DockWidgetOption
DockWidget options to pass at construction time.
LayoutSaverOption
Options which will affect LayoutSaver save/restore.
Struct describing the preferred dock widget size and visibility when adding it to a layout.

© 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