KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
Size_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 "Size_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}
36Size_wrapper::Size_wrapper(int width, int height)
37 : ::KDDockWidgets::Size(width, height)
38{
39}
40KDDockWidgets::Size Size_wrapper::boundedTo(KDDockWidgets::Size sz) const
41{
42 return ::KDDockWidgets::Size::boundedTo(sz);
43}
44KDDockWidgets::Size Size_wrapper::expandedTo(KDDockWidgets::Size sz) const
45{
46 return ::KDDockWidgets::Size::expandedTo(sz);
47}
49{
50 return ::KDDockWidgets::Size::height();
51}
53{
54 return ::KDDockWidgets::Size::isEmpty();
55}
57{
58 return ::KDDockWidgets::Size::isNull();
59}
61{
62 return ::KDDockWidgets::Size::isValid();
63}
65{
66 ::KDDockWidgets::Size::setHeight(h);
67}
69{
70 ::KDDockWidgets::Size::setWidth(w);
71}
73{
74 return ::KDDockWidgets::Size::width();
75}
79
80}
81static KDDockWidgets::Size *fromPtr(void *ptr)
82{
83 return reinterpret_cast<KDDockWidgets::Size *>(ptr);
84}
89extern "C" {
91{
92 delete reinterpret_cast<KDDockWidgetsBindings_wrappersNS::Size_wrapper *>(cppObj);
93}
95{
97 return reinterpret_cast<void *>(ptr);
98}
100{
101 auto ptr = new KDDockWidgetsBindings_wrappersNS::Size_wrapper(width, height);
102 return reinterpret_cast<void *>(ptr);
103}
104// boundedTo(KDDockWidgets::Size sz) const
105void *c_KDDockWidgets__Size__boundedTo_Size(void *thisObj, void *sz_)
106{
107 assert(sz_);
108 auto &sz = *reinterpret_cast<KDDockWidgets::Size *>(sz_);
109 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Size> { fromPtr(thisObj)->boundedTo(sz) };
110 return result;
111}
112// expandedTo(KDDockWidgets::Size sz) const
113void *c_KDDockWidgets__Size__expandedTo_Size(void *thisObj, void *sz_)
114{
115 assert(sz_);
116 auto &sz = *reinterpret_cast<KDDockWidgets::Size *>(sz_);
117 const auto &result = new Dartagnan::ValueWrapper<KDDockWidgets::Size> { fromPtr(thisObj)->expandedTo(sz) };
118 return result;
119}
120// height() const
122{
123 const auto &result = fromPtr(thisObj)->height();
124 return result;
125}
126// isEmpty() const
128{
129 const auto &result = fromPtr(thisObj)->isEmpty();
130 return result;
131}
132// isNull() const
134{
135 const auto &result = fromPtr(thisObj)->isNull();
136 return result;
137}
138// isValid() const
140{
141 const auto &result = fromPtr(thisObj)->isValid();
142 return result;
143}
144// setHeight(int h)
145void c_KDDockWidgets__Size__setHeight_int(void *thisObj, int h)
146{
147 fromPtr(thisObj)->setHeight(h);
148}
149// setWidth(int w)
150void c_KDDockWidgets__Size__setWidth_int(void *thisObj, int w)
151{
152 fromPtr(thisObj)->setWidth(w);
153}
154// width() const
156{
157 const auto &result = fromPtr(thisObj)->width();
158 return result;
159}
161{
162 delete fromPtr(thisObj);
163}
164}
void * c_KDDockWidgets__Size__expandedTo_Size(void *thisObj, void *sz_)
Definition Size_c.cpp:113
void * c_KDDockWidgets__Size__boundedTo_Size(void *thisObj, void *sz_)
Definition Size_c.cpp:105
int c_KDDockWidgets__Size__width(void *thisObj)
Definition Size_c.cpp:155
void c_KDDockWidgets__Size__setHeight_int(void *thisObj, int h)
Definition Size_c.cpp:145
static KDDockWidgets::Size * fromPtr(void *ptr)
Definition Size_c.cpp:81
void c_KDDockWidgets__Size_Finalizer(void *cppObj)
Definition Size_c.cpp:90
void * c_KDDockWidgets__Size__constructor()
Definition Size_c.cpp:94
int c_KDDockWidgets__Size__height(void *thisObj)
Definition Size_c.cpp:121
bool c_KDDockWidgets__Size__isEmpty(void *thisObj)
Definition Size_c.cpp:127
bool c_KDDockWidgets__Size__isValid(void *thisObj)
Definition Size_c.cpp:139
void * c_KDDockWidgets__Size__constructor_int_int(int width, int height)
Definition Size_c.cpp:99
bool c_KDDockWidgets__Size__isNull(void *thisObj)
Definition Size_c.cpp:133
void c_KDDockWidgets__Size__setWidth_int(void *thisObj, int w)
Definition Size_c.cpp:150
void c_KDDockWidgets__Size__destructor(void *thisObj)
Definition Size_c.cpp:160
static KDDockWidgetsBindings_wrappersNS::Size_wrapper * fromWrapperPtr(void *ptr)
Definition Size_c.cpp:85
KDDockWidgets::Size expandedTo(KDDockWidgets::Size sz) const
Definition Size_c.cpp:44
KDDockWidgets::Size boundedTo(KDDockWidgets::Size sz) const
Definition Size_c.cpp:40
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