KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
Layout_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 "Layout_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 {
38{
39 return ::KDDockWidgets::Core::Layout::asDropArea();
40}
42{
43 return ::KDDockWidgets::Core::Layout::checkSanity();
44}
50{
51 return ::KDDockWidgets::Core::Layout::containsGroup(arg__1);
52}
53bool Layout_wrapper::containsItem(const KDDockWidgets::Core::Item *arg__1) const
54{
55 return ::KDDockWidgets::Core::Layout::containsItem(arg__1);
56}
58{
59 return ::KDDockWidgets::Core::Layout::count();
60}
66{
67 return ::KDDockWidgets::Core::Layout::floatingWindow();
68}
69bool Layout_wrapper::isInMainWindow(bool honourNesting) const
70{
71 return ::KDDockWidgets::Core::Layout::isInMainWindow(honourNesting);
72}
73KDDockWidgets::Core::Item *Layout_wrapper::itemForGroup(const KDDockWidgets::Core::Group *group) const
74{
75 return ::KDDockWidgets::Core::Layout::itemForGroup(group);
76}
78{
79 return ::KDDockWidgets::Core::Layout::layoutHeight();
80}
81KDDockWidgets::Size Layout_wrapper::layoutMaximumSizeHint() const
82{
83 return ::KDDockWidgets::Core::Layout::layoutMaximumSizeHint();
84}
85KDDockWidgets::Size Layout_wrapper::layoutMinimumSize() const
86{
87 return ::KDDockWidgets::Core::Layout::layoutMinimumSize();
88}
89KDDockWidgets::Size Layout_wrapper::layoutSize() const
90{
91 return ::KDDockWidgets::Core::Layout::layoutSize();
92}
94{
95 return ::KDDockWidgets::Core::Layout::layoutWidth();
96}
98{
99 return ::KDDockWidgets::Core::Layout::mainWindow(honourNesting);
100}
102{
103 return ::KDDockWidgets::Core::Layout::placeholderCount();
104}
105void Layout_wrapper::removeItem(KDDockWidgets::Core::Item *item)
106{
108}
109void Layout_wrapper::restorePlaceholder(KDDockWidgets::Core::DockWidget *dw, KDDockWidgets::Core::Item *arg__2, int tabIndex)
110{
112}
117void Layout_wrapper::setLayoutSize(KDDockWidgets::Size arg__1)
118{
120}
122{
124 const void *thisPtr = this;
125 m_setParentView_implCallback(const_cast<void *>(thisPtr), parent);
126 } else {
128 }
129}
143{
144 return ::KDDockWidgets::Core::Layout::visibleCount();
145}
149
150}
151}
153{
154 return reinterpret_cast<KDDockWidgets::Core::Layout *>(ptr);
155}
160extern "C" {
166{
167 auto arg__2 = reinterpret_cast<KDDockWidgets::Core::View *>(arg__2_);
169 return reinterpret_cast<void *>(ptr);
170}
171// asDropArea() const
173{
174 const auto &result = fromPtr(thisObj)->asDropArea();
175 return result;
176}
177// checkSanity() const
179{
180 const auto &result = fromPtr(thisObj)->checkSanity();
181 return result;
182}
183// clearLayout()
185{
186 fromPtr(thisObj)->clearLayout();
187}
188// containsGroup(const KDDockWidgets::Core::Group * arg__1) const
190{
191 auto arg__1 = reinterpret_cast<KDDockWidgets::Core::Group *>(arg__1_);
192 const auto &result = fromPtr(thisObj)->containsGroup(arg__1);
193 return result;
194}
195// containsItem(const KDDockWidgets::Core::Item * arg__1) const
196bool c_KDDockWidgets__Core__Layout__containsItem_Item(void *thisObj, void *arg__1_)
197{
198 auto arg__1 = reinterpret_cast<KDDockWidgets::Core::Item *>(arg__1_);
199 const auto &result = fromPtr(thisObj)->containsItem(arg__1);
200 return result;
201}
202// count() const
204{
205 const auto &result = fromPtr(thisObj)->count();
206 return result;
207}
208// dumpLayout() const
210{
211 fromPtr(thisObj)->dumpLayout();
212}
213// floatingWindow() const
215{
216 const auto &result = fromPtr(thisObj)->floatingWindow();
217 return result;
218}
219// isInMainWindow(bool honourNesting) const
220bool c_KDDockWidgets__Core__Layout__isInMainWindow_bool(void *thisObj, bool honourNesting)
221{
222 const auto &result = fromPtr(thisObj)->isInMainWindow(honourNesting);
223 return result;
224}
225// itemForGroup(const KDDockWidgets::Core::Group * group) const
227{
228 auto group = reinterpret_cast<KDDockWidgets::Core::Group *>(group_);
229 const auto &result = fromPtr(thisObj)->itemForGroup(group);
230 return result;
231}
232// layoutHeight() const
234{
235 const auto &result = fromPtr(thisObj)->layoutHeight();
236 return result;
237}
238// layoutMaximumSizeHint() const
240{
241 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Size> { fromPtr(thisObj)->layoutMaximumSizeHint() };
242 return result;
243}
244// layoutMinimumSize() const
246{
247 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Size> { fromPtr(thisObj)->layoutMinimumSize() };
248 return result;
249}
250// layoutSize() const
252{
253 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Size> { fromPtr(thisObj)->layoutSize() };
254 return result;
255}
256// layoutWidth() const
258{
259 const auto &result = fromPtr(thisObj)->layoutWidth();
260 return result;
261}
262// mainWindow(bool honourNesting) const
263void *c_KDDockWidgets__Core__Layout__mainWindow_bool(void *thisObj, bool honourNesting)
264{
265 const auto &result = fromPtr(thisObj)->mainWindow(honourNesting);
266 return result;
267}
268// placeholderCount() const
270{
271 const auto &result = fromPtr(thisObj)->placeholderCount();
272 return result;
273}
274// removeItem(KDDockWidgets::Core::Item * item)
276{
277 auto item = reinterpret_cast<KDDockWidgets::Core::Item *>(item_);
278 fromPtr(thisObj)->removeItem(item);
279}
280// restorePlaceholder(KDDockWidgets::Core::DockWidget * dw, KDDockWidgets::Core::Item * arg__2, int tabIndex)
281void c_KDDockWidgets__Core__Layout__restorePlaceholder_DockWidget_Item_int(void *thisObj, void *dw_, void *arg__2_, int tabIndex)
282{
283 auto dw = reinterpret_cast<KDDockWidgets::Core::DockWidget *>(dw_);
284 auto arg__2 = reinterpret_cast<KDDockWidgets::Core::Item *>(arg__2_);
285 fromPtr(thisObj)->restorePlaceholder(dw, arg__2, tabIndex);
286}
287// setLayoutMinimumSize(KDDockWidgets::Size arg__1)
289{
290 assert(arg__1_);
291 auto &arg__1 = *reinterpret_cast<KDDockWidgets::Size *>(arg__1_);
292 fromWrapperPtr(thisObj)->setLayoutMinimumSize(arg__1);
293}
294// setLayoutSize(KDDockWidgets::Size arg__1)
296{
297 assert(arg__1_);
298 auto &arg__1 = *reinterpret_cast<KDDockWidgets::Size *>(arg__1_);
299 fromPtr(thisObj)->setLayoutSize(arg__1);
300}
301// setParentView_impl(KDDockWidgets::Core::View * parent)
303{
304 auto parent = reinterpret_cast<KDDockWidgets::Core::View *>(parent_);
306}
307// updateSizeConstraints()
312// viewAboutToBeDeleted()
317// visibleCount() const
319{
320 const auto &result = fromPtr(thisObj)->visibleCount();
321 return result;
322}
324{
325 delete fromPtr(thisObj);
326}
327void c_KDDockWidgets__Core__Layout__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
328{
329 auto wrapper = fromWrapperPtr(ptr);
330 switch (methodId) {
331 case 331:
332 wrapper->m_setParentView_implCallback = reinterpret_cast<KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::Layout_wrapper::Callback_setParentView_impl>(callback);
333 break;
334 }
335}
336}
bool c_KDDockWidgets__Core__Layout__isInMainWindow_bool(void *thisObj, bool honourNesting)
Definition Layout_c.cpp:220
void c_KDDockWidgets__Core__Layout__setLayoutMinimumSize_Size(void *thisObj, void *arg__1_)
Definition Layout_c.cpp:288
void c_KDDockWidgets__Core__Layout__setLayoutSize_Size(void *thisObj, void *arg__1_)
Definition Layout_c.cpp:295
void * c_KDDockWidgets__Core__Layout__layoutSize(void *thisObj)
Definition Layout_c.cpp:251
int c_KDDockWidgets__Core__Layout__visibleCount(void *thisObj)
Definition Layout_c.cpp:318
void c_KDDockWidgets__Core__Layout__setParentView_impl_View(void *thisObj, void *parent_)
Definition Layout_c.cpp:302
void * c_KDDockWidgets__Core__Layout__floatingWindow(void *thisObj)
Definition Layout_c.cpp:214
void * c_KDDockWidgets__Core__Layout__itemForGroup_Group(void *thisObj, void *group_)
Definition Layout_c.cpp:226
static KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::Layout_wrapper * fromWrapperPtr(void *ptr)
Definition Layout_c.cpp:156
void c_KDDockWidgets__Core__Layout__dumpLayout(void *thisObj)
Definition Layout_c.cpp:209
int c_KDDockWidgets__Core__Layout__layoutHeight(void *thisObj)
Definition Layout_c.cpp:233
int c_KDDockWidgets__Core__Layout__count(void *thisObj)
Definition Layout_c.cpp:203
void c_KDDockWidgets__Core__Layout__removeItem_Item(void *thisObj, void *item_)
Definition Layout_c.cpp:275
bool c_KDDockWidgets__Core__Layout__containsGroup_Group(void *thisObj, void *arg__1_)
Definition Layout_c.cpp:189
void c_KDDockWidgets__Core__Layout_Finalizer(void *cppObj)
Definition Layout_c.cpp:161
void c_KDDockWidgets__Core__Layout__updateSizeConstraints(void *thisObj)
Definition Layout_c.cpp:308
void c_KDDockWidgets__Core__Layout__restorePlaceholder_DockWidget_Item_int(void *thisObj, void *dw_, void *arg__2_, int tabIndex)
Definition Layout_c.cpp:281
void * c_KDDockWidgets__Core__Layout__layoutMinimumSize(void *thisObj)
Definition Layout_c.cpp:245
void * c_KDDockWidgets__Core__Layout__constructor_ViewType_View(int arg__1, void *arg__2_)
Definition Layout_c.cpp:165
int c_KDDockWidgets__Core__Layout__layoutWidth(void *thisObj)
Definition Layout_c.cpp:257
void c_KDDockWidgets__Core__Layout__clearLayout(void *thisObj)
Definition Layout_c.cpp:184
static KDDockWidgets::Core::Layout * fromPtr(void *ptr)
Definition Layout_c.cpp:152
void * c_KDDockWidgets__Core__Layout__mainWindow_bool(void *thisObj, bool honourNesting)
Definition Layout_c.cpp:263
void c_KDDockWidgets__Core__Layout__viewAboutToBeDeleted(void *thisObj)
Definition Layout_c.cpp:313
int c_KDDockWidgets__Core__Layout__placeholderCount(void *thisObj)
Definition Layout_c.cpp:269
void c_KDDockWidgets__Core__Layout__registerVirtualMethodCallback(void *ptr, void *callback, int methodId)
Definition Layout_c.cpp:327
bool c_KDDockWidgets__Core__Layout__checkSanity(void *thisObj)
Definition Layout_c.cpp:178
void * c_KDDockWidgets__Core__Layout__layoutMaximumSizeHint(void *thisObj)
Definition Layout_c.cpp:239
void c_KDDockWidgets__Core__Layout__destructor(void *thisObj)
Definition Layout_c.cpp:323
bool c_KDDockWidgets__Core__Layout__containsItem_Item(void *thisObj, void *arg__1_)
Definition Layout_c.cpp:196
void * c_KDDockWidgets__Core__Layout__asDropArea(void *thisObj)
Definition Layout_c.cpp:172
virtual void setParentView_impl_nocallback(KDDockWidgets::Core::View *parent)
Definition Layout_c.cpp:130
KDDockWidgets::Core::MainWindow * mainWindow(bool honourNesting=false) const
Definition Layout_c.cpp:97
void restorePlaceholder(KDDockWidgets::Core::DockWidget *dw, KDDockWidgets::Core::Item *arg__2, int tabIndex)
Definition Layout_c.cpp:109
Layout_wrapper(KDDockWidgets::Core::ViewType arg__1, KDDockWidgets::Core::View *arg__2)
Definition Layout_c.cpp:33
virtual void setParentView_impl(KDDockWidgets::Core::View *parent)
Definition Layout_c.cpp:121
bool containsGroup(const KDDockWidgets::Core::Group *arg__1) const
Definition Layout_c.cpp:49
void(* Callback_setParentView_impl)(void *, KDDockWidgets::Core::View *parent)
Definition Layout_c.h:55
KDDockWidgets::Core::FloatingWindow * floatingWindow() const
Definition Layout_c.cpp:65
KDDockWidgets::Core::Item * itemForGroup(const KDDockWidgets::Core::Group *group) const
Definition Layout_c.cpp:73
bool containsItem(const KDDockWidgets::Core::Item *arg__1) const
Definition Layout_c.cpp:53
virtual void setParentView_impl(View *parent)
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
The widget (QWidget or QQuickItem) which holds a layout of dock widgets.
Definition Layout.h:57
bool containsItem(const Core::Item *) const
Returns true if this layout contains the specified item.
Definition Layout.cpp:199
int visibleCount() const
Returns the number of visible Items in this layout. Which is count minus placeholderCount.
Definition Layout.cpp:214
int layoutHeight() const
returns the contents height. Usually it's the same height as the respective parent MultiSplitter.
Definition Layout.h:96
void setLayoutSize(Size)
setter for the contents size The "contents size" is just the size() of this layout....
Definition Layout.cpp:185
int count() const
Returns the number of Item objects in this layout. This includes non-visible (placeholder) Items too.
Definition Layout.cpp:209
int placeholderCount() const
Returns the number of placeholder items in this layout. This is the same as count minus visibleCount.
Definition Layout.cpp:219
bool checkSanity() const
Runs some sanity checks. Returns true if everything is OK.
Definition Layout.cpp:141
Core::Item * itemForGroup(const Core::Group *group) const
returns the Item that holds group in this layout
Definition Layout.cpp:224
Size layoutSize() const
Returns the size of the contents.
Definition Layout.cpp:131
void dumpLayout() const
dumps the layout to stderr
Definition Layout.cpp:146
int layoutWidth() const
returns the contents width. Usually it's the same width as the respective parent MultiSplitter.
Definition Layout.h:87
Core::DropArea * asDropArea() const
Definition Layout.cpp:337
void removeItem(Core::Item *item)
Removes an item from this MultiSplitter.
Definition Layout.cpp:269
bool containsGroup(const Core::Group *) const
Returns true if this layout contains the specified group.
Definition Layout.cpp:204
void restorePlaceholder(Core::DockWidget *dw, Core::Item *, int tabIndex)
restores the dockwidget dw to its previous position
Definition Layout.cpp:151
Size layoutMaximumSizeHint() const
returns the layout's maximum size hint
Definition Layout.cpp:117
void updateSizeConstraints()
Updates the min size of this layout.
Definition Layout.cpp:279
bool isInMainWindow(bool honourNesting=false) const
Returns whether this layout is in a MainWindow.
Definition Layout.cpp:68
Core::MainWindow * mainWindow(bool honourNesting=false) const
Definition Layout.cpp:73
void setLayoutMinimumSize(Size)
setter for the minimum size minimumSize
Definition Layout.cpp:122
Size layoutMinimumSize() const
returns the layout's minimum size setLayoutMinimumSize
Definition Layout.cpp:112
void clearLayout()
clears the layout
Definition Layout.cpp:136
Core::FloatingWindow * floatingWindow() const
Definition Layout.cpp:95
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
ViewType
Each View type also has a specific Controller associated with, except for ViewType::None.
Definition Controller.h:26
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