mirror of https://github.com/KLayout/klayout.git
WIP: Fixed GSI to some extent, some tests
This commit is contained in:
parent
82909001c4
commit
125543957d
|
|
@ -809,9 +809,6 @@ include "QWindow", [ "<QWindow>", "<QScreen>",
|
|||
include "QOffscreenSurface", [ "<QOffscreenSurface>", "<QScreen>" ]
|
||||
include "QScreenOrientationChangeEvent", [ "<QScreenOrientationChangeEvent>", "<QScreen>" ]
|
||||
|
||||
drop_method "QRgba64", /QRgba64::QRgba64\(.*quint64/ # some problem with quint64 type ... @@@ TODO: debug later
|
||||
drop_method "QRgba64", /QRgba64::operator=\(.*quint64/ # some problem with quint64 type ... @@@ TODO: debug later
|
||||
drop_method "QRgba64", /QRgba64::quint64/ # some problem with quint64 type ... @@@ TODO: debug later
|
||||
drop_method "QWindow", /QWindow::handle/ # QPlatformWindow not available
|
||||
drop_method "QScreen", /QScreen::handle/ # QPlatformScreen not available
|
||||
drop_method "QSurface", /QSurface::surfaceHandle/ # QPlatformSurface not available
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ grammar CPP
|
|||
rule id
|
||||
"operator" s "," /
|
||||
"operator" s ( bin_op / unary_op / "," ) /
|
||||
"operator" sp [a-zA-Z\*\& \t\n\r]+ &( s "(" ) /
|
||||
"operator" sp [a-zA-Z_0-9\*\& \t\n\r]+ &( s "(" ) /
|
||||
"~"? [a-zA-Z_] [a-zA-Z_0-9]*
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -612,21 +612,13 @@ struct DB_PUBLIC_TEMPLATE box
|
|||
*/
|
||||
double double_area () const;
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Conversion to string
|
||||
*
|
||||
* If dbu is set, it determines the factor by which the coordinates are multiplied to render
|
||||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string to_string (double dbu) const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
if (empty ()) {
|
||||
return "()";
|
||||
|
|
|
|||
|
|
@ -586,21 +586,13 @@ public:
|
|||
return dx_abs () + dy_abs ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Conversion to a string.
|
||||
*
|
||||
* If dbu is set, it determines the factor by which the coordinates are multiplied to render
|
||||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string to_string (double dbu) const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
return "(" + m_p1.to_string (dbu) + ";" + m_p2.to_string (dbu) + ")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,21 +387,13 @@ public:
|
|||
return m_first.is_ortho () && m_second.is_ortho ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Conversion to a string.
|
||||
*
|
||||
* If dbu is set, it determines the factor by which the coordinates are multiplied to render
|
||||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string to_string (double dbu) const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
return lesser ().to_string (dbu) + (m_symmetric ? "|" : "/") + greater ().to_string (dbu);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,14 +285,6 @@ public:
|
|||
*/
|
||||
double sq_double_distance () const;
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief String conversion
|
||||
*
|
||||
|
|
@ -300,7 +292,7 @@ public:
|
|||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string
|
||||
to_string (double dbu) const
|
||||
to_string (double dbu = 0.0) const
|
||||
{
|
||||
if (dbu == 1.0) {
|
||||
return tl::db_to_string (m_x) + "," + tl::db_to_string (m_y);
|
||||
|
|
|
|||
|
|
@ -757,9 +757,9 @@ public:
|
|||
/**
|
||||
* @brief String conversion
|
||||
*/
|
||||
std::string to_string () const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
return std::string ("(") + tl::to_quoted_string (string ()) + "," + m_trans.to_string () + ")";
|
||||
return std::string ("(") + tl::to_quoted_string (string ()) + "," + m_trans.to_string (dbu) + ")";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1472,10 +1472,10 @@ public:
|
|||
/**
|
||||
* @brief String conversion
|
||||
*/
|
||||
std::string to_string () const
|
||||
std::string to_string (double dbu = 0.0) const
|
||||
{
|
||||
std::string s1 = fixpoint_trans<C>::to_string ();
|
||||
std::string s2 = m_u.to_string ();
|
||||
std::string s2 = m_u.to_string (dbu);
|
||||
if (! s1.empty () && ! s2.empty ()) {
|
||||
return s1 + " " + s2;
|
||||
} else {
|
||||
|
|
@ -2242,14 +2242,6 @@ public:
|
|||
return ! equal (t);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default string conversion
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief String conversion
|
||||
*
|
||||
|
|
@ -2257,7 +2249,7 @@ public:
|
|||
* When lazy is set to true, output that is not required (i.e. magnification when 1)
|
||||
* is dropped. If dbu is set, the coordinates are multiplied with this factor to render micron units.
|
||||
*/
|
||||
std::string to_string (bool lazy, double dbu = 0.0) const
|
||||
std::string to_string (bool lazy = false, double dbu = 0.0) const
|
||||
{
|
||||
std::string s;
|
||||
if (is_mirror ()) {
|
||||
|
|
|
|||
|
|
@ -327,14 +327,6 @@ public:
|
|||
*/
|
||||
double sq_double_length () const;
|
||||
|
||||
/**
|
||||
* @brief Default conversion to string
|
||||
*/
|
||||
std::string to_string () const
|
||||
{
|
||||
return to_string (0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief String conversion
|
||||
*
|
||||
|
|
@ -342,7 +334,7 @@ public:
|
|||
* micron units. In addition, a micron format is chosen for output of these coordinates.
|
||||
*/
|
||||
std::string
|
||||
to_string (double dbu) const
|
||||
to_string (double dbu = 0.0) const
|
||||
{
|
||||
if (dbu == 1.0) {
|
||||
return tl::db_to_string (m_x) + "," + tl::db_to_string (m_y);
|
||||
|
|
|
|||
|
|
@ -441,10 +441,13 @@ struct box_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Returns a string representing this box\n"
|
||||
"\n"
|
||||
"This string can be turned into a box again by using \\from_s\n"
|
||||
"This string can be turned into a box again by using \\from_s\n. "
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -439,8 +439,11 @@ struct edge_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief Returns a string representing the edge\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Returns a string representing the edge\n "
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("is_parallel?", &C::parallel, gsi::arg ("e"),
|
||||
"@brief Test for being parallel\n"
|
||||
|
|
|
|||
|
|
@ -156,8 +156,11 @@ struct edge_pair_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief Returns a string representing the edge pair\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Returns a string representing the edge pair\n "
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("bbox", &C::bbox,
|
||||
"@brief Gets the bounding box of the edge pair\n"
|
||||
|
|
|
|||
|
|
@ -234,8 +234,11 @@ struct point_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief String conversion\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion.\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -345,8 +345,11 @@ struct text_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
"@brief Convert to a string\n"
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief Convert to a string.\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -333,8 +333,11 @@ struct trans_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("disp", (const vector_type &(C::*) () const) &C::disp,
|
||||
"@brief Gets to the displacement vector\n"
|
||||
|
|
@ -853,8 +856,12 @@ struct cplx_trans_defs
|
|||
"\n"
|
||||
"This method has been added in version 0.23.\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("lazy", false), gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion\n"
|
||||
"If 'lazy' is true, some parts are omitted when not required.\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The lazy and DBU arguments have been added in version 0.27.6.\n"
|
||||
) +
|
||||
method ("disp", (displacement_type (C::*)() const) &C::disp,
|
||||
"@brief Gets the displacement\n"
|
||||
|
|
|
|||
|
|
@ -264,8 +264,11 @@ struct vector_defs
|
|||
"@brief Creates an object from a string\n"
|
||||
"Creates the object from a string representation (as returned by \\to_s)\n"
|
||||
) +
|
||||
method ("to_s", (std::string (C::*) () const) &C::to_string,
|
||||
method ("to_s", &C::to_string, gsi::arg ("dbu", 0.0),
|
||||
"@brief String conversion\n"
|
||||
"If a DBU is given, the output units will be micrometers.\n"
|
||||
"\n"
|
||||
"The DBU argument has been added in version 0.27.6.\n"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ template <class X> struct _create<X, true> { static void *call () { return new X
|
|||
|
||||
template <class X, bool> struct _clone;
|
||||
template <class X> struct _clone<X, false> { static void *call (const void *) { throw tl::Exception (tl::to_string (tr ("Object cannot be copied here"))); } };
|
||||
template <class X> struct _clone<X, true> { static void *call (const void *other) { new X (*(const X *)other); } };
|
||||
template <class X> struct _clone<X, true> { static void *call (const void *other) { return new X (*(const X *)other); } };
|
||||
|
||||
template <class X, bool> struct _assign;
|
||||
template <class X> struct _assign<X, false> { static void call (void *, const void *) { throw tl::Exception (tl::to_string (tr ("Object cannot be copied here"))); } };
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@ tl::Variant A::new_a_by_variant ()
|
|||
return tl::Variant (A ());
|
||||
}
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
|
||||
std::vector<int>
|
||||
A::qba_cref_to_ia (const QByteArray &ba)
|
||||
{
|
||||
|
|
@ -134,8 +136,8 @@ A::ia_cref_to_qba (const std::vector<int> &ia)
|
|||
return ba;
|
||||
}
|
||||
|
||||
const QByteArray &
|
||||
A::ia_cref_to_qba_cref (const std::vector<int> &ia)
|
||||
QByteArray &
|
||||
A::ia_cref_to_qba_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QByteArray ba;
|
||||
ba.clear ();
|
||||
|
|
@ -145,6 +147,120 @@ A::ia_cref_to_qba_cref (const std::vector<int> &ia)
|
|||
return ba;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
std::vector<int>
|
||||
A::qbav_cref_to_ia (const QByteArrayView &ba)
|
||||
{
|
||||
const char *cp = ba.constData ();
|
||||
size_t n = ba.size ();
|
||||
std::vector<int> ia;
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back (int (*cp++));
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QByteArrayView
|
||||
A::ia_cref_to_qbav (const std::vector<int> &ia)
|
||||
{
|
||||
static QByteArray ba;
|
||||
ba.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
ba.push_back (char (*i));
|
||||
}
|
||||
return ba;
|
||||
}
|
||||
|
||||
QByteArrayView &
|
||||
A::ia_cref_to_qbav_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QByteArray ba;
|
||||
ba.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
ba.push_back (char (*i));
|
||||
}
|
||||
static QByteArrayView bav;
|
||||
bav = ba;
|
||||
return bav;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
std::vector<int>
|
||||
A::qs_cref_to_ia (const QString &qs)
|
||||
{
|
||||
const QChar *cp = qs.constData ();
|
||||
size_t n = qs.size ();
|
||||
std::vector<int> ia;
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back ((*cp++).unicode ());
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QString
|
||||
A::ia_cref_to_qs (const std::vector<int> &ia)
|
||||
{
|
||||
QString s;
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
QString &
|
||||
A::ia_cref_to_qs_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QString s;
|
||||
s.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
std::vector<int>
|
||||
A::qsv_cref_to_ia (const QStringView &qs)
|
||||
{
|
||||
const QChar *cp = qs.constData ();
|
||||
size_t n = qs.size ();
|
||||
std::vector<int> ia;
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
ia.push_back ((*cp++).unicode ());
|
||||
}
|
||||
return ia;
|
||||
}
|
||||
|
||||
QStringView
|
||||
A::ia_cref_to_qsv (const std::vector<int> &ia)
|
||||
{
|
||||
QString s;
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
QStringView &
|
||||
A::ia_cref_to_qsv_ref (const std::vector<int> &ia)
|
||||
{
|
||||
static QString s;
|
||||
s.clear ();
|
||||
for (std::vector<int>::const_iterator i = ia.begin (); i != ia.end (); ++i) {
|
||||
s.push_back (char (*i));
|
||||
}
|
||||
static QStringView sv;
|
||||
sv = s;
|
||||
return sv;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
std::vector<int>
|
||||
A::ba_cref_to_ia (const std::vector<char> &ba)
|
||||
{
|
||||
|
|
@ -877,6 +993,7 @@ static gsi::Class<A> decl_a ("", "A",
|
|||
gsi::method ("new_a_by_variant", &A::new_a_by_variant) +
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
|
||||
gsi::method ("qba_cref_to_ia", &A::qba_cref_to_ia) +
|
||||
gsi::method ("qba_ref_to_ia", &A::qba_ref_to_ia) +
|
||||
gsi::method ("qba_cptr_to_ia", &A::qba_cptr_to_ia) +
|
||||
|
|
@ -884,7 +1001,49 @@ static gsi::Class<A> decl_a ("", "A",
|
|||
gsi::method ("qba_to_ia", &A::qba_to_ia) +
|
||||
gsi::method ("ia_cref_to_qba", &A::ia_cref_to_qba) +
|
||||
gsi::method ("ia_cref_to_qba_cref", &A::ia_cref_to_qba_cref) +
|
||||
gsi::method ("ia_cref_to_qba_ref", &A::ia_cref_to_qba_ref) +
|
||||
gsi::method ("ia_cptr_to_qba_cptr", &A::ia_cref_to_qba_cptr) +
|
||||
gsi::method ("ia_cptr_to_qba_ptr", &A::ia_cref_to_qba_ptr) +
|
||||
|
||||
gsi::method ("qs_cref_to_ia", &A::qs_cref_to_ia) +
|
||||
gsi::method ("qs_ref_to_ia", &A::qs_ref_to_ia) +
|
||||
gsi::method ("qs_cptr_to_ia", &A::qs_cptr_to_ia) +
|
||||
gsi::method ("qs_ptr_to_ia", &A::qs_ptr_to_ia) +
|
||||
gsi::method ("qs_to_ia", &A::qs_to_ia) +
|
||||
gsi::method ("ia_cref_to_qs", &A::ia_cref_to_qs) +
|
||||
gsi::method ("ia_cref_to_qs_cref", &A::ia_cref_to_qs_cref) +
|
||||
gsi::method ("ia_cref_to_qs_ref", &A::ia_cref_to_qs_ref) +
|
||||
gsi::method ("ia_cptr_to_qs_cptr", &A::ia_cref_to_qs_cptr) +
|
||||
gsi::method ("ia_cptr_to_qs_ptr", &A::ia_cref_to_qs_ptr) +
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
gsi::method ("qbav_cref_to_ia", &A::qbav_cref_to_ia) +
|
||||
gsi::method ("qbav_ref_to_ia", &A::qbav_ref_to_ia) +
|
||||
gsi::method ("qbav_cptr_to_ia", &A::qbav_cptr_to_ia) +
|
||||
gsi::method ("qbav_ptr_to_ia", &A::qbav_ptr_to_ia) +
|
||||
gsi::method ("qbav_to_ia", &A::qbav_to_ia) +
|
||||
gsi::method ("ia_cref_to_qbav", &A::ia_cref_to_qbav) +
|
||||
gsi::method ("ia_cref_to_qbav_cref", &A::ia_cref_to_qbav_cref) +
|
||||
gsi::method ("ia_cref_to_qbav_ref", &A::ia_cref_to_qbav_ref) +
|
||||
gsi::method ("ia_cptr_to_qbav_cptr", &A::ia_cref_to_qbav_cptr) +
|
||||
gsi::method ("ia_cptr_to_qbav_ptr", &A::ia_cref_to_qbav_ptr) +
|
||||
|
||||
gsi::method ("qsv_cref_to_ia", &A::qsv_cref_to_ia) +
|
||||
gsi::method ("qsv_ref_to_ia", &A::qsv_ref_to_ia) +
|
||||
gsi::method ("qsv_cptr_to_ia", &A::qsv_cptr_to_ia) +
|
||||
gsi::method ("qsv_ptr_to_ia", &A::qsv_ptr_to_ia) +
|
||||
gsi::method ("qsv_to_ia", &A::qsv_to_ia) +
|
||||
gsi::method ("ia_cref_to_qsv", &A::ia_cref_to_qsv) +
|
||||
gsi::method ("ia_cref_to_qsv_cref", &A::ia_cref_to_qsv_cref) +
|
||||
gsi::method ("ia_cref_to_qsv_ref", &A::ia_cref_to_qsv_ref) +
|
||||
gsi::method ("ia_cptr_to_qsv_cptr", &A::ia_cref_to_qsv_cptr) +
|
||||
gsi::method ("ia_cptr_to_qsv_ptr", &A::ia_cref_to_qsv_ptr) +
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
gsi::method ("ba_cref_to_ia", &A::ba_cref_to_ia) +
|
||||
gsi::method ("ba_ref_to_ia", &A::ba_ref_to_ia) +
|
||||
gsi::method ("ba_cptr_to_ia", &A::ba_cptr_to_ia) +
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ struct A
|
|||
static tl::Variant new_a_by_variant ();
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QByteArray
|
||||
*/
|
||||
|
|
@ -108,11 +109,84 @@ struct A
|
|||
static std::vector<int> qba_ptr_to_ia (QByteArray *ba) { return qba_cref_to_ia (*ba); }
|
||||
static std::vector<int> qba_to_ia (QByteArray ba) { return qba_cref_to_ia (ba); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QByteArrayView
|
||||
*/
|
||||
static std::vector<int> qbav_cref_to_ia (const QByteArrayView &ba);
|
||||
static std::vector<int> qbav_ref_to_ia (QByteArrayView &ba) { return qbav_cref_to_ia (ba); }
|
||||
static std::vector<int> qbav_cptr_to_ia (const QByteArrayView *ba) { return qbav_cref_to_ia (*ba); }
|
||||
static std::vector<int> qbav_ptr_to_ia (QByteArrayView *ba) { return qbav_cref_to_ia (*ba); }
|
||||
static std::vector<int> qbav_to_ia (QByteArrayView ba) { return qbav_cref_to_ia (ba); }
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QString
|
||||
*/
|
||||
static std::vector<int> qs_cref_to_ia (const QString &qs);
|
||||
static std::vector<int> qs_ref_to_ia (QString &qs) { return qs_cref_to_ia (qs); }
|
||||
static std::vector<int> qs_cptr_to_ia (const QString *qs) { return qs_cref_to_ia (*qs); }
|
||||
static std::vector<int> qs_ptr_to_ia (QString *qs) { return qs_cref_to_ia (*qs); }
|
||||
static std::vector<int> qs_to_ia (QString qs) { return qs_cref_to_ia (qs); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests access to QStringView
|
||||
*/
|
||||
static std::vector<int> qsv_cref_to_ia (const QStringView &qs);
|
||||
static std::vector<int> qsv_ref_to_ia (QStringView &qs) { return qsv_cref_to_ia (qs); }
|
||||
static std::vector<int> qsv_cptr_to_ia (const QStringView *qs) { return qsv_cref_to_ia (*qs); }
|
||||
static std::vector<int> qsv_ptr_to_ia (QStringView *qs) { return qsv_cref_to_ia (*qs); }
|
||||
static std::vector<int> qsv_to_ia (QStringView qs) { return qsv_cref_to_ia (qs); }
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QByteArray
|
||||
*/
|
||||
static QByteArray ia_cref_to_qba (const std::vector<int> &ia);
|
||||
static const QByteArray &ia_cref_to_qba_cref (const std::vector<int> &ia);
|
||||
static QByteArray &ia_cref_to_qba_ref (const std::vector<int> &ia);
|
||||
static const QByteArray &ia_cref_to_qba_cref (const std::vector<int> &ia) { return ia_cref_to_qba_ref (ia); }
|
||||
static const QByteArray *ia_cref_to_qba_cptr (const std::vector<int> &ia) { return &ia_cref_to_qba_ref (ia); }
|
||||
static QByteArray *ia_cref_to_qba_ptr (const std::vector<int> &ia) { return &ia_cref_to_qba_ref (ia); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QByteArrayView (uses a static buffer)
|
||||
*/
|
||||
static QByteArrayView ia_cref_to_qbav (const std::vector<int> &ia);
|
||||
static QByteArrayView &ia_cref_to_qbav_ref (const std::vector<int> &ia);
|
||||
static const QByteArrayView &ia_cref_to_qbav_cref (const std::vector<int> &ia) { return ia_cref_to_qbav_ref (ia); }
|
||||
static const QByteArrayView *ia_cref_to_qbav_cptr (const std::vector<int> &ia) { return &ia_cref_to_qbav_ref (ia); }
|
||||
static QByteArrayView *ia_cref_to_qbav_ptr (const std::vector<int> &ia) { return &ia_cref_to_qbav_ref (ia); }
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QString
|
||||
*/
|
||||
static QString ia_cref_to_qs (const std::vector<int> &ia);
|
||||
static QString &ia_cref_to_qs_ref (const std::vector<int> &ia);
|
||||
static const QString &ia_cref_to_qs_cref (const std::vector<int> &ia) { return ia_cref_to_qs_ref (ia); }
|
||||
static const QString *ia_cref_to_qs_cptr (const std::vector<int> &ia) { return &ia_cref_to_qs_ref (ia); }
|
||||
static QString *ia_cref_to_qs_ptr (const std::vector<int> &ia) { return &ia_cref_to_qs_ref (ia); }
|
||||
|
||||
#if QT_VERSION >= 0x60000
|
||||
|
||||
/**
|
||||
* @brief Byte sequences: tests return of QStringView (uses a static buffer)
|
||||
*/
|
||||
static QStringView ia_cref_to_qsv (const std::vector<int> &ia);
|
||||
static QStringView &ia_cref_to_qsv_ref (const std::vector<int> &ia);
|
||||
static const QStringView &ia_cref_to_qsv_cref (const std::vector<int> &ia) { return ia_cref_to_qsv_ref (ia); }
|
||||
static const QStringView *ia_cref_to_qsv_cptr (const std::vector<int> &ia) { return &ia_cref_to_qsv_ref (ia); }
|
||||
static QStringView *ia_cref_to_qsv_ptr (const std::vector<int> &ia) { return &ia_cref_to_qsv_ref (ia); }
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -207,11 +281,13 @@ struct A
|
|||
|
||||
std::string a10_d (double f) { return tl::to_string (f); }
|
||||
std::vector<char> a10_d_ba (double f) { std::string s = tl::to_string (f); return std::vector<char> (s.begin (), s.end ()); }
|
||||
|
||||
#if defined(HAVE_QT)
|
||||
QByteArray a10_d_qba (double f) { return tl::to_qstring (tl::to_string (f)).toUtf8 (); }
|
||||
QString a10_d_qstr (double f) { return tl::to_qstring (tl::to_string (f)); }
|
||||
QStringRef a10_d_qstrref (double f) { m_s = tl::to_qstring (tl::to_string (f)); return QStringRef (&m_s); }
|
||||
#endif
|
||||
|
||||
std::string a10_f (float f) { return tl::to_string(f); }
|
||||
std::string a10_s (short l) { return tl::to_string(int (l)); }
|
||||
std::string a10_us (unsigned short l) { return tl::to_string(int (l)); }
|
||||
|
|
|
|||
|
|
@ -170,6 +170,25 @@ static void _call_f_isTransparent_c0 (const qt_gsi::GenericMethod * /*decl*/, vo
|
|||
}
|
||||
|
||||
|
||||
// QRgba64 &QRgba64::operator=(quint64 _rgba)
|
||||
|
||||
|
||||
static void _init_f_operator_eq__1103 (qt_gsi::GenericMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("_rgba");
|
||||
decl->add_arg<quint64 > (argspec_0);
|
||||
decl->set_return<QRgba64 & > ();
|
||||
}
|
||||
|
||||
static void _call_f_operator_eq__1103 (const qt_gsi::GenericMethod * /*decl*/, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
quint64 arg1 = gsi::arg_reader<quint64 >() (args, heap);
|
||||
ret.write<QRgba64 & > ((QRgba64 &)((QRgba64 *)cls)->operator= (arg1));
|
||||
}
|
||||
|
||||
|
||||
// QRgba64 QRgba64::premultiplied()
|
||||
|
||||
|
||||
|
|
@ -387,6 +406,25 @@ static void _call_f_fromRgba_3888 (const qt_gsi::GenericStaticMethod * /*decl*/,
|
|||
}
|
||||
|
||||
|
||||
// static QRgba64 QRgba64::fromRgba64(quint64 c)
|
||||
|
||||
|
||||
static void _init_f_fromRgba64_1103 (qt_gsi::GenericStaticMethod *decl)
|
||||
{
|
||||
static gsi::ArgSpecBase argspec_0 ("c");
|
||||
decl->add_arg<quint64 > (argspec_0);
|
||||
decl->set_return<QRgba64 > ();
|
||||
}
|
||||
|
||||
static void _call_f_fromRgba64_1103 (const qt_gsi::GenericStaticMethod * /*decl*/, gsi::SerialArgs &args, gsi::SerialArgs &ret)
|
||||
{
|
||||
__SUPPRESS_UNUSED_WARNING(args);
|
||||
tl::Heap heap;
|
||||
quint64 arg1 = gsi::arg_reader<quint64 >() (args, heap);
|
||||
ret.write<QRgba64 > ((QRgba64)QRgba64::fromRgba64 (arg1));
|
||||
}
|
||||
|
||||
|
||||
// static QRgba64 QRgba64::fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
|
||||
|
||||
|
||||
|
|
@ -430,6 +468,7 @@ static gsi::Methods methods_QRgba64 () {
|
|||
methods += new qt_gsi::GenericMethod ("green8", "@brief Method quint8 QRgba64::green8()\n", true, &_init_f_green8_c0, &_call_f_green8_c0);
|
||||
methods += new qt_gsi::GenericMethod ("isOpaque?", "@brief Method bool QRgba64::isOpaque()\n", true, &_init_f_isOpaque_c0, &_call_f_isOpaque_c0);
|
||||
methods += new qt_gsi::GenericMethod ("isTransparent?", "@brief Method bool QRgba64::isTransparent()\n", true, &_init_f_isTransparent_c0, &_call_f_isTransparent_c0);
|
||||
methods += new qt_gsi::GenericMethod ("assign", "@brief Method QRgba64 &QRgba64::operator=(quint64 _rgba)\n", false, &_init_f_operator_eq__1103, &_call_f_operator_eq__1103);
|
||||
methods += new qt_gsi::GenericMethod ("premultiplied", "@brief Method QRgba64 QRgba64::premultiplied()\n", true, &_init_f_premultiplied_c0, &_call_f_premultiplied_c0);
|
||||
methods += new qt_gsi::GenericMethod ("red", "@brief Method quint16 QRgba64::red()\n", true, &_init_f_red_c0, &_call_f_red_c0);
|
||||
methods += new qt_gsi::GenericMethod ("red8", "@brief Method quint8 QRgba64::red8()\n", true, &_init_f_red8_c0, &_call_f_red8_c0);
|
||||
|
|
@ -442,6 +481,7 @@ static gsi::Methods methods_QRgba64 () {
|
|||
methods += new qt_gsi::GenericMethod ("unpremultiplied", "@brief Method QRgba64 QRgba64::unpremultiplied()\n", true, &_init_f_unpremultiplied_c0, &_call_f_unpremultiplied_c0);
|
||||
methods += new qt_gsi::GenericStaticMethod ("fromArgb32", "@brief Static method QRgba64 QRgba64::fromArgb32(unsigned int rgb)\nThis method is static and can be called without an instance.", &_init_f_fromArgb32_1772, &_call_f_fromArgb32_1772);
|
||||
methods += new qt_gsi::GenericStaticMethod ("fromRgba", "@brief Static method QRgba64 QRgba64::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)\nThis method is static and can be called without an instance.", &_init_f_fromRgba_3888, &_call_f_fromRgba_3888);
|
||||
methods += new qt_gsi::GenericStaticMethod ("fromRgba64", "@brief Static method QRgba64 QRgba64::fromRgba64(quint64 c)\nThis method is static and can be called without an instance.", &_init_f_fromRgba64_1103, &_call_f_fromRgba64_1103);
|
||||
methods += new qt_gsi::GenericStaticMethod ("fromRgba64", "@brief Static method QRgba64 QRgba64::fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)\nThis method is static and can be called without an instance.", &_init_f_fromRgba64_4076, &_call_f_fromRgba64_4076);
|
||||
return methods;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace tl {
|
|||
* @brief An exception indicating that string extraction is not available for a certain type
|
||||
*/
|
||||
class TL_PUBLIC ExtractorNotImplementedException
|
||||
: tl::Exception
|
||||
: public tl::Exception
|
||||
{
|
||||
public:
|
||||
ExtractorNotImplementedException ();
|
||||
|
|
@ -55,7 +55,7 @@ public:
|
|||
* @brief An exception indicating that string conversion is not available for a certain type
|
||||
*/
|
||||
class TL_PUBLIC StringConversionException
|
||||
: tl::Exception
|
||||
: public tl::Exception
|
||||
{
|
||||
public:
|
||||
StringConversionException ();
|
||||
|
|
|
|||
|
|
@ -2807,16 +2807,22 @@ class Basic_TestClass < TestBase
|
|||
|
||||
# binary strings
|
||||
|
||||
qba = RBA::A::ia_cref_to_qba([ 17, 42, 0, 8 ])
|
||||
assert_equal(qba.inspect, "\"\\x11*\\x00\\b\"")
|
||||
assert_equal(RBA::A::qba_to_ia(qba), [ 17, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::qba_cref_to_ia(qba), [ 17, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::qba_cptr_to_ia(qba), [ 17, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::qba_ref_to_ia(qba), [ 17, 42, 0, 8 ])
|
||||
assert_equal(RBA::A::qba_ptr_to_ia(qba), [ 17, 42, 0, 8 ])
|
||||
|
||||
qba = RBA::A::ia_cref_to_qba([ 16, 42, 0, 8 ])
|
||||
assert_equal(qba.inspect, "\"\\x10*\\x00\\b\"")
|
||||
qba = RBA::A::ia_cref_to_qba_cref([ 17, 42, 0, 8 ])
|
||||
assert_equal(qba.inspect, "\"\\x11*\\x00\\b\"")
|
||||
qba = RBA::A::ia_cref_to_qba_ref([ 18, 42, 0, 8 ])
|
||||
assert_equal(qba.inspect, "\"\\x12*\\x00\\b\"")
|
||||
qba = RBA::A::ia_cref_to_qba_cptr([ 19, 42, 0, 8 ])
|
||||
assert_equal(qba.inspect, "\"\\x13*\\x00\\b\"")
|
||||
qba = RBA::A::ia_cref_to_qba_ptr([ 20, 42, 0, 8 ])
|
||||
assert_equal(qba.inspect, "\"\\x14*\\x00\\b\"")
|
||||
|
||||
assert_equal(RBA::A::qba_to_ia("\x00\x01\x02"), [ 0, 1, 2 ])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue