#include #include #include #include #include #include #include #include #include "gen_qprinterinfo.h" #include "_cgo_export.h" QPrinterInfo* QPrinterInfo_new() { return new QPrinterInfo(); } QPrinterInfo* QPrinterInfo_new2(QPrinterInfo* other) { return new QPrinterInfo(*other); } QPrinterInfo* QPrinterInfo_new3(QPrinter* printer) { return new QPrinterInfo(*printer); } void QPrinterInfo_OperatorAssign(QPrinterInfo* self, QPrinterInfo* other) { self->operator=(*other); } struct miqt_string QPrinterInfo_PrinterName(const QPrinterInfo* self) { QString _ret = self->printerName(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QPrinterInfo_Description(const QPrinterInfo* self) { QString _ret = self->description(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QPrinterInfo_Location(const QPrinterInfo* self) { QString _ret = self->location(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QPrinterInfo_MakeAndModel(const QPrinterInfo* self) { QString _ret = self->makeAndModel(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } bool QPrinterInfo_IsNull(const QPrinterInfo* self) { return self->isNull(); } bool QPrinterInfo_IsDefault(const QPrinterInfo* self) { return self->isDefault(); } bool QPrinterInfo_IsRemote(const QPrinterInfo* self) { return self->isRemote(); } int QPrinterInfo_State(const QPrinterInfo* self) { QPrinter::PrinterState _ret = self->state(); return static_cast(_ret); } struct miqt_array /* of QPageSize* */ QPrinterInfo_SupportedPageSizes(const QPrinterInfo* self) { QList _ret = self->supportedPageSizes(); // Convert QList<> from C++ memory to manually-managed C memory QPageSize** _arr = static_cast(malloc(sizeof(QPageSize*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = new QPageSize(_ret[i]); } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } QPageSize* QPrinterInfo_DefaultPageSize(const QPrinterInfo* self) { return new QPageSize(self->defaultPageSize()); } bool QPrinterInfo_SupportsCustomPageSizes(const QPrinterInfo* self) { return self->supportsCustomPageSizes(); } QPageSize* QPrinterInfo_MinimumPhysicalPageSize(const QPrinterInfo* self) { return new QPageSize(self->minimumPhysicalPageSize()); } QPageSize* QPrinterInfo_MaximumPhysicalPageSize(const QPrinterInfo* self) { return new QPageSize(self->maximumPhysicalPageSize()); } struct miqt_array /* of int */ QPrinterInfo_SupportedResolutions(const QPrinterInfo* self) { QList _ret = self->supportedResolutions(); // Convert QList<> from C++ memory to manually-managed C memory int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = _ret[i]; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } int QPrinterInfo_DefaultDuplexMode(const QPrinterInfo* self) { QPrinter::DuplexMode _ret = self->defaultDuplexMode(); return static_cast(_ret); } struct miqt_array /* of int */ QPrinterInfo_SupportedDuplexModes(const QPrinterInfo* self) { QList _ret = self->supportedDuplexModes(); // Convert QList<> from C++ memory to manually-managed C memory int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QPrinter::DuplexMode _lv_ret = _ret[i]; _arr[i] = static_cast(_lv_ret); } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } int QPrinterInfo_DefaultColorMode(const QPrinterInfo* self) { QPrinter::ColorMode _ret = self->defaultColorMode(); return static_cast(_ret); } struct miqt_array /* of int */ QPrinterInfo_SupportedColorModes(const QPrinterInfo* self) { QList _ret = self->supportedColorModes(); // Convert QList<> from C++ memory to manually-managed C memory int* _arr = static_cast(malloc(sizeof(int) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QPrinter::ColorMode _lv_ret = _ret[i]; _arr[i] = static_cast(_lv_ret); } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_array /* of struct miqt_string */ QPrinterInfo_AvailablePrinterNames() { QStringList _ret = QPrinterInfo::availablePrinterNames(); // Convert QList<> from C++ memory to manually-managed C memory struct miqt_string* _arr = static_cast(malloc(sizeof(struct miqt_string) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); struct miqt_string _lv_ms; _lv_ms.len = _lv_b.length(); _lv_ms.data = static_cast(malloc(_lv_ms.len)); memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len); _arr[i] = _lv_ms; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_array /* of QPrinterInfo* */ QPrinterInfo_AvailablePrinters() { QList _ret = QPrinterInfo::availablePrinters(); // Convert QList<> from C++ memory to manually-managed C memory QPrinterInfo** _arr = static_cast(malloc(sizeof(QPrinterInfo*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { _arr[i] = new QPrinterInfo(_ret[i]); } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_string QPrinterInfo_DefaultPrinterName() { QString _ret = QPrinterInfo::defaultPrinterName(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } QPrinterInfo* QPrinterInfo_DefaultPrinter() { return new QPrinterInfo(QPrinterInfo::defaultPrinter()); } QPrinterInfo* QPrinterInfo_PrinterInfo(struct miqt_string printerName) { QString printerName_QString = QString::fromUtf8(printerName.data, printerName.len); return new QPrinterInfo(QPrinterInfo::printerInfo(printerName_QString)); } void QPrinterInfo_Delete(QPrinterInfo* self) { delete self; }