Commit ad5aeed3 authored by Alan Alpert's avatar Alan Alpert

Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging into qtquick2

parents faed3a79 4ff72975
......@@ -439,7 +439,20 @@
}
\endqml
The \c variant type can also hold:
A \c variant type property can also hold an image or pixmap.
A \c variant which contains a QPixmap or QImage is known as a
"scarce resource" and the declarative engine will attempt to
automatically release such resources after evaluation of any JavaScript
expression which requires one to be copied has completed.
Clients may explicitly release such a scarce resource by calling the
"destroy" method on the \c variant property from within JavaScript. They
may also explicitly preserve the scarce resource by calling the
"preserve" method on the \c variant property from within JavaScript.
For more information regarding the usage of a scarce resource, please
see \l{Scarce Resources in JavaScript}.
Finally, the \c variant type can also hold:
\list
\o An array of \l {QML Basic Types}{basic type} values
......
......@@ -168,6 +168,44 @@ Notice that calling \l {QML:Qt::include()}{Qt.include()} imports all functions f
\c factorial.js into the \c MyScript namespace, which means the QML component can also
access \c factorial() directly as \c MyScript.factorial().
In QtQuick 2.0, support has been added to allow JavaScript files to import other
JavaScript files and also QML modules using a variation of the standard QML import
syntax (where all of the previously described rules and qualifications apply).
A JavaScript file may import another in the following fashion:
\code
.import "filename.js" as UniqueQualifier
\endcode
For example:
\code
.import "factorial.js" as MathFunctions
\endcode
A JavaScript file may import a QML module in the following fashion:
\code
.import Module.Name MajorVersion.MinorVersion as UniqueQualifier
\endcode
For example:
\code
.import Qt.test 1.0 as JsQtTest
\endcode
In particular, this may be useful in order to access functionality provided
via a module API; see qmlRegisterModuleApi() for more information.
Due to the ability of a JavaScript file to import another script or QML module in
this fashion in QtQuick 2.0, some extra semantics are defined:
\list
\o a script with imports will not inherit imports from the QML file which imported it (so accessing Component.error will fail, for example)
\o a script without imports will inherit imports from the QML file which imported it (so accessing Component.error will succeed, for example)
\o a shared script (i.e., defined as .pragma library) does not inherit imports from any QML file even if it imports no other scripts
\endlist
The first semantic is conceptually correct, given that a particular script
might be imported by any number of QML files. The second semantic is retained
for the purposes of backwards-compatibility. The third semantic remains
unchanged from the current semantics for shared scripts, but is clarified here
in respect to the newly possible case (where the script imports other scripts
or modules).
\section1 Running JavaScript at Startup
......@@ -321,4 +359,195 @@ Item {
\endlist
\section1 Scarce Resources in JavaScript
As described in the documentation for \l{QML Basic Types}, a \c variant type
property may hold a "scarce resource" (image or pixmap). There are several
important semantics of scarce resources which should be noted:
\list
\o By default, a scarce resource is automatically released by the declarative engine as soon as evaluation of the expression in which the scarce resource is allocated is complete if there are no other references to the resource
\o A client may explicitly preserve a scarce resource, which will ensure that the resource will not be released until all references to the resource are released and the JavaScript engine runs its garbage collector
\o A client may explicitly destroy a scarce resource, which will immediately release the resource
\endlist
In most cases, allowing the engine to automatically release the resource is
the correct choice. In some cases, however, this may result in an invalid
variant being returned from a function in JavaScript, and in those cases it
may be necessary for clients to manually preserve or destroy resources for
themselves.
For the following examples, imagine that we have defined the following class:
\code
class AvatarExample : public QObject
{
Q_OBJECT
Q_PROPERTY(QPixmap avatar READ avatar WRITE setAvatar NOTIFY avatarChanged)
public:
AvatarExample(QObject *parent = 0) : QObject(parent), m_value(100, 100) { m_value.fill(Qt::blue); }
~AvatarExample() {}
QPixmap avatar() const { return m_value; }
void setAvatar(QPixmap v) { m_value = v; emit avatarChanged(); }
signals:
void avatarChanged();
private:
QPixmap m_value;
};
\endcode
and that we have registered it with the QML type-system as follows:
\code
qmlRegisterType<AvatarExample>("Qt.example", 1, 0, "AvatarExample");
\endcode
The AvatarExample class has a property which is a pixmap. When the property
is accessed in JavaScript scope, a copy of the resource will be created and
stored in a JavaScript object which can then be used within JavaScript. This
copy will take up valuable system resources, and so by default the scarce
resource copy in the JavaScript object will be released automatically by the
declarative engine once evaluation of the JavaScript expression is complete,
unless the client explicitly preserves it.
\section2 Example One: Automatic Release
In this example, the resource will be automatically
released after the binding expression evaluation is
complete.
\qml
// exampleOne.qml
import QtQuick 1.0
import Qt.example 1.0
QtObject {
property AvatarExample a;
a: AvatarExample { id: example }
property variant avatar: example.avatar
}
\endqml
\code
QDeclarativeComponent component(&engine, "exampleOne.qml");
QObject *object = component.create();
// The scarce resource will have been released automatically
// after the binding expression was evaluated.
// Since the scarce resource was not released explicitly prior
// to the binding expression being evaluated, we get the
// expected result:
//object->property("scarceResourceCopy").isValid() == true
delete object;
\endcode
\section2 Example Two: Explicit Preservation
In this example, the resource must be explicitly preserved in order
to prevent the declarative engine from automatically releasing the
resource after evaluation of the imported script.
\code
// exampleTwo.js
.import Qt.example 1.0 as QtExample
var component = Qt.createComponent("exampleOne.qml");
var exampleOneElement = component.createObject(null);
var avatarExample = exampleOneElement.a;
var retn = avatarExample.avatar;
// without the following call, the scarce resource held
// by retn would be automatically released by the engine
// after the import statement in exampleTwo.qml, prior
// to the variable assignment.
retn.preserve();
function importAvatar() {
return retn;
}
\endcode
\qml
// exampleTwo.qml
import QtQuick 1.0
import Qt.example 1.0
import "exampleTwo.js" as ExampleTwoJs
QtObject {
property variant avatar: ExampleTwoJs.importAvatar()
}
\endqml
\code
QDeclarativeComponent component(&engine, "exampleTwo.qml");
QObject *object = component.create();
// The resource was preserved explicitly during evaluation of the
// JavaScript expression. Thus, during property assignment, the
// scarce resource was still valid, and so we get the expected result:
//object->property("avatar").isValid() == true
// The scarce resource may not have been cleaned up by the JS GC yet;
// it will continue to consume system resources until the JS GC runs.
delete object;
\endcode
\section2 Example Three: Explicit Destruction
In the following example, we release (via destroy()) an explicitly preserved
scarce resource variant. This example shows how a client may free system
resources by releasing the scarce resource held in a JavaScript object, if
required, during evaluation of a JavaScript expression.
\code
// exampleThree.js
.import Qt.example 1.0 as QtExample
var component = Qt.createComponent("exampleOne.qml");
var exampleOneElement = component.createObject(null);
var avatarExample = exampleOneElement.a;
var retn = avatarExample.avatar;
retn.preserve();
function importAvatar() {
return retn;
}
function releaseAvatar() {
retn.destroy();
}
\endcode
\qml
// exampleThree.qml
import QtQuick 1.0
import Qt.example 1.0
import "exampleThree.js" as ExampleThreeJs
QtObject {
property variant avatarOne
property variant avatarTwo
Component.onCompleted: {
avatarOne = ExampleThreeJs.importAvatar(); // valid at this stage
ExampleThreeJs.releaseAvatar(); // explicit release
avatarTwo = ExampleThreeJs.importAvatar(); // invalid at this stage
}
}
\endqml
\code
QDeclarativeComponent component(&engine, "exampleThree.qml");
QObject *object = component.create();
// The scarce resource was explicitly preserved by the client during
// the evaluation of the imported script, and so the scarce resource
// remains valid until the explicit call to releaseAvatar(). As such,
// we get the expected results:
//object->property("avatarOne").isValid() == true
//object->property("avatarTwo").isValid() == false
// Because the scarce resource was released explicitly, it will no longer
// be consuming any system resources (beyond what a normal JS Object would;
// that small overhead will exist until the JS GC runs, as per any other
// JavaScript object).
delete object;
\endcode
*/
......@@ -103,6 +103,8 @@ QSGPaintedItemPrivate::QSGPaintedItemPrivate()
, geometryDirty(false)
, contentsDirty(false)
, opaquePainting(false)
, antialiasing(false)
, mipmap(false)
{
}
......@@ -225,6 +227,40 @@ void QSGPaintedItem::setAntialiasing(bool enable)
update();
}
/*!
Returns true if mipmaps are enabled; otherwise, false is returned.
By default, mipmapping is not enabled.
\sa setMipmap()
*/
bool QSGPaintedItem::mipmap() const
{
Q_D(const QSGPaintedItem);
return d->mipmap;
}
/*!
If \a enable is true, mipmapping is enabled on the associated texture.
Mipmapping increases rendering speed and reduces aliasing artifacts when the item is
scaled down.
By default, mipmapping is not enabled.
\sa mipmap()
*/
void QSGPaintedItem::setMipmap(bool enable)
{
Q_D(QSGPaintedItem);
if (d->mipmap == enable)
return;
d->mipmap = enable;
update();
}
/*!
This function returns the outer bounds of the item as a rectangle; all painting must be
restricted to inside an item's bounding rect.
......@@ -379,6 +415,11 @@ void QSGPaintedItem::setRenderTarget(RenderTarget target)
Reimplement this function in a QSGPaintedItem subclass to provide the
item's painting implementation, using \a painter.
\note The QML Scene Graph uses two separate threads, the main thread does things such as
processing events or updating animations while a second thread does the actual OpenGL rendering.
As a consequence, paint() is not called from the main GUI thread but from the GL enabled
renderer thread.
*/
/*!
......@@ -416,7 +457,7 @@ QSGNode *QSGPaintedItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
node->setSize(QSize(qRound(br.width()), qRound(br.height())));
node->setSmoothPainting(d->antialiasing);
node->setLinearFiltering(d->smooth);
node->setMipmapping(d->smooth);
node->setMipmapping(d->mipmap);
node->setOpaquePainting(d->opaquePainting);
node->setFillColor(d->fillColor);
node->setContentsScale(d->contentsScale);
......
......@@ -75,6 +75,9 @@ public:
bool antialiasing() const;
void setAntialiasing(bool enable);
bool mipmap() const;
void setMipmap(bool enable);
QRectF contentsBoundingRect() const;
QSize contentsSize() const;
......
......@@ -63,6 +63,7 @@ public:
bool contentsDirty : 1;
bool opaquePainting: 1;
bool antialiasing: 1;
bool mipmap: 1;
};
QT_END_NAMESPACE
......
......@@ -82,6 +82,7 @@ QSGShaderEffectTexture::QSGShaderEffectTexture(QSGItem *shaderSource)
, m_dirtyTexture(true)
, m_multisamplingSupportChecked(false)
, m_multisampling(false)
, m_grab(false)
{
}
......@@ -124,8 +125,9 @@ void QSGShaderEffectTexture::bind()
bool QSGShaderEffectTexture::updateTexture()
{
if (m_dirtyTexture) {
if ((m_live || m_grab) && m_dirtyTexture) {
grab();
m_grab = false;
return true;
}
return false;
......@@ -181,6 +183,15 @@ void QSGShaderEffectTexture::setLive(bool live)
markDirtyTexture();
}
void QSGShaderEffectTexture::scheduleUpdate()
{
if (m_grab)
return;
m_grab = true;
if (m_dirtyTexture)
emit textureChanged();
}
void QSGShaderEffectTexture::setRecursive(bool recursive)
{
m_recursive = recursive;
......@@ -188,10 +199,9 @@ void QSGShaderEffectTexture::setRecursive(bool recursive)
void QSGShaderEffectTexture::markDirtyTexture()
{
if (m_live) {
m_dirtyTexture = true;
m_dirtyTexture = true;
if (m_live || m_grab)
emit textureChanged();
}
}
void QSGShaderEffectTexture::grab()
......@@ -360,6 +370,7 @@ QSGShaderEffectSource::QSGShaderEffectSource(QSGItem *parent)
, m_hideSource(false)
, m_mipmap(false)
, m_recursive(false)
, m_grab(true)
{
setFlag(ItemHasContents);
m_texture = new QSGShaderEffectTexture(this);
......@@ -516,17 +527,12 @@ void QSGShaderEffectSource::setRecursive(bool enabled)
emit recursiveChanged();
}
void QSGShaderEffectSource::grab()
void QSGShaderEffectSource::scheduleUpdate()
{
if (!m_sourceItem)
if (m_grab)
return;
QSGCanvas *canvas = m_sourceItem->canvas();
if (!canvas)
return;
QSGCanvasPrivate::get(canvas)->updateDirtyNodes();
QGLContext *glctx = const_cast<QGLContext *>(canvas->context());
glctx->makeCurrent();
qobject_cast<QSGShaderEffectTexture *>(m_texture)->grab();
m_grab = true;
update();
}
static void get_wrap_mode(QSGShaderEffectSource::WrapMode mode, QSGTexture::WrapMode *hWrap, QSGTexture::WrapMode *vWrap)
......@@ -582,6 +588,7 @@ QSGNode *QSGShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNod
QSGShaderEffectTexture *tex = qobject_cast<QSGShaderEffectTexture *>(m_texture);
tex->setLive(m_live);
tex->setItem(QSGItemPrivate::get(m_sourceItem)->itemNode());
QRectF sourceRect = m_sourceRect.isNull()
? QRectF(0, 0, m_sourceItem->width(), m_sourceItem->height())
......@@ -591,11 +598,14 @@ QSGNode *QSGShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNod
? QSize(qCeil(qAbs(sourceRect.width())), qCeil(qAbs(sourceRect.height())))
: m_textureSize;
tex->setSize(textureSize);
tex->setLive(m_live);
tex->setRecursive(m_recursive);
tex->setFormat(GLenum(m_format));
tex->setHasMipmaps(m_mipmap);
if (m_grab)
tex->scheduleUpdate();
m_grab = false;
QSGTexture::Filtering filtering = QSGItemPrivate::get(this)->smooth
? QSGTexture::Linear
: QSGTexture::Nearest;
......
......@@ -112,7 +112,7 @@ public:
bool recursive() const { return bool(m_recursive); }
void setRecursive(bool recursive);
void grab();
void scheduleUpdate();
Q_SIGNALS:
void textureChanged();
......@@ -121,6 +121,8 @@ public Q_SLOTS:
void markDirtyTexture();
private:
void grab();
QSGNode *m_item;
QRectF m_rect;
QSize m_size;
......@@ -141,6 +143,7 @@ private:
uint m_dirtyTexture : 1;
uint m_multisamplingSupportChecked : 1;
uint m_multisampling : 1;
uint m_grab : 1;
};
class QSGShaderEffectSource : public QSGItem, public QSGTextureProvider
......@@ -204,7 +207,7 @@ public:
QSGTexture *texture() const;
const char *textureChangedSignal() const { return SIGNAL(textureChanged()); }
Q_INVOKABLE void grab();
Q_INVOKABLE void scheduleUpdate();
Q_SIGNALS:
void wrapModeChanged();
......@@ -233,6 +236,7 @@ private:
uint m_hideSource : 1;
uint m_mipmap : 1;
uint m_recursive : 1;
uint m_grab : 1;
};
QT_END_NAMESPACE
......
......@@ -153,7 +153,7 @@ void QSGTextNode::addTextDecorations(const QPointF &position, const QRawFont &fo
}
}
QSGGlyphNode *QSGTextNode::addGlyphs(const QPointF &position, const QGlyphs &glyphs, const QColor &color,
QSGGlyphNode *QSGTextNode::addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color,
QSGText::TextStyle style, const QColor &styleColor)
{
QSGGlyphNode *node = m_context->createGlyphNode();
......@@ -187,10 +187,10 @@ void QSGTextNode::addTextDocument(const QPointF &position, QTextDocument *textDo
void QSGTextNode::addTextLayout(const QPointF &position, QTextLayout *textLayout, const QColor &color,
QSGText::TextStyle style, const QColor &styleColor)
{
QList<QGlyphs> glyphsList(textLayout->glyphs());
QList<QGlyphRun> glyphsList(textLayout->glyphRuns());
for (int i=0; i<glyphsList.size(); ++i) {
QGlyphs glyphs = glyphsList.at(i);
QRawFont font = glyphs.font();
QGlyphRun glyphs = glyphsList.at(i);
QRawFont font = glyphs.rawFont();
addGlyphs(position + QPointF(0, font.ascent()), glyphs, color, style, styleColor);
}
......@@ -356,10 +356,10 @@ void QSGTextNode::addTextBlock(const QPointF &position, QTextDocument *textDocum
? overrideColor
: charFormat.foreground().color();
QList<QGlyphs> glyphsList = fragment.glyphs();
QList<QGlyphRun> glyphsList = fragment.glyphRuns();
for (int i=0; i<glyphsList.size(); ++i) {
QGlyphs glyphs = glyphsList.at(i);
QRawFont font = glyphs.font();
QGlyphRun glyphs = glyphsList.at(i);
QRawFont font = glyphs.rawFont();
QSGGlyphNode *glyphNode = addGlyphs(position + blockPosition + QPointF(0, font.ascent()),
glyphs, color, style, styleColor);
......
......@@ -72,7 +72,7 @@ public:
private:
void addTextBlock(const QPointF &position, QTextDocument *textDocument, const QTextBlock &block,
const QColor &overrideColor, QSGText::TextStyle style = QSGText::Normal, const QColor &styleColor = QColor());
QSGGlyphNode *addGlyphs(const QPointF &position, const QGlyphs &glyphs, const QColor &color,
QSGGlyphNode *addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color,
QSGText::TextStyle style = QSGText::Normal, const QColor &styleColor = QColor());
void addTextDecorations(const QPointF &position, const QRawFont &font, const QColor &color,
qreal width, bool hasOverline, bool hasStrikeOut, bool hasUnderline);
......
......@@ -144,9 +144,22 @@ QDeclarativeScarceResourceScriptClass::property(Object *object, const Identifier
}
/*
The user explicitly wants to preserve the resource.
We remove the scarce resource from the engine's linked list
of resources to release after evaluation completes.
This method is called when the user explicitly calls the "preserve" method of a scarce resource in JavaScript
within the specified evaluation context \a context of the script engine \a engine.
Calling this function signifies that the user explicitly wants to preserve the resource rather than let it
be automatically released once evaluation of the expression is complete.
This function removes the internal scarce resource from the declarative engine's linked list of scarce resources
to release after evaluation of the expression completes. This means that the resource will only be truly
released when the JavaScript engine's garbage collector is run.
Example:
\qml
function getIcon(model) {
var icon = model.avatar; // a pixmap property
icon.preserve(); // explicitly preserves the resource
return icon; // a valid variant will be returned
}
\endqml
*/
QScriptValue QDeclarativeScarceResourceScriptClass::preserve(QScriptContext *context, QScriptEngine *engine)
{
......@@ -168,8 +181,21 @@ QScriptValue QDeclarativeScarceResourceScriptClass::preserve(QScriptContext *con
}
/*
The user explicitly wants to release the resource.
We set the internal scarce resource variant to the invalid variant.
This method is called when the user explicitly calls the "destroy" method of a scarce resource in JavaScript
within the specified evaluation context \a context of the script engine \a engine.
Calling this function signifies that the user explicitly wants to release the resource.
This function sets the internal scarce resource variant to the invalid variant, in order to release the original resource,
and then removes the resource from the declarative engine's linked-list of scarce resources to
to release after evaluation of the expression completes, as it has already been released.
Example:
\qml
function getIcon(model) {
var icon = model.avatar; // a pixmap property
icon.destroy(); // explicitly releases the resource
return icon; // an invalid variant will be returned
}
\endqml
*/
QScriptValue QDeclarativeScarceResourceScriptClass::destroy(QScriptContext *context, QScriptEngine *engine)
{
......
......@@ -49,7 +49,7 @@
#include <QtCore/qrect.h>
#include <QtGui/qcolor.h>
#include <QtCore/qsharedpointer.h>
#include <QtGui/qglyphs.h>
#include <QtGui/qglyphrun.h>
#include <QtCore/qurl.h>
QT_BEGIN_HEADER
......@@ -103,7 +103,7 @@ public:
SubPixelAntialiasing
};
virtual void setGlyphs(const QPointF &position, const QGlyphs &glyphs) = 0;
virtual void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) = 0;
virtual void setColor(const QColor &color) = 0;
virtual QPointF baseLine() const = 0;
......
......@@ -69,12 +69,12 @@ void QSGDefaultGlyphNode::setColor(const QColor &color)
}
}
void QSGDefaultGlyphNode::setGlyphs(const QPointF &position, const QGlyphs &glyphs)
void QSGDefaultGlyphNode::setGlyphs(const QPointF &position, const QGlyphRun &glyphs)
{
if (m_material != 0)
delete m_material;
QRawFont font = glyphs.font();
QRawFont font = glyphs.rawFont();
m_material = new QSGTextMaskMaterial(font);
m_material->setColor(m_color);
......
......@@ -60,13 +60,13 @@ public:
~QSGDefaultGlyphNode();
virtual QPointF baseLine() const { return m_baseLine; }
virtual void setGlyphs(const QPointF &position, const QGlyphs &glyphs);
virtual void setGlyphs(const QPointF &position, const QGlyphRun &glyphs);
virtual void setColor(const QColor &color);
virtual void setPreferredAntialiasingMode(AntialiasingMode) { }
private:
QGlyphs m_glyphs;
QGlyphRun m_glyphs;
QPointF m_position;
QColor m_color;
......
......@@ -49,7 +49,7 @@
#include <private/qsgcontext_p.h>
#include <private/qrawfont_p.h>
#include <qglfunctions.h>
#include <qglyphs.h>
#include <qglyphrun.h>
#include <qrawfont.h>
QT_BEGIN_NAMESPACE
......
......@@ -87,9 +87,9 @@ void QSGDistanceFieldGlyphNode::setPreferredAntialiasingMode(AntialiasingMode mo
updateMaterial();
}
void QSGDistanceFieldGlyphNode::setGlyphs(const QPointF &position, const QGlyphs &glyphs)
void QSGDistanceFieldGlyphNode::setGlyphs(const QPointF &position, const QGlyphRun &glyphs)
{
QRawFont font = glyphs.font();
QRawFont font = glyphs.rawFont();
m_position = QPointF(position.x(), position.y() - font.ascent());
m_glyphs = glyphs;
......@@ -187,7 +187,7 @@ void QSGDistanceFieldGlyphNode::updateGeometry()
void QSGDistanceFieldGlyphNode::updateFont()
{
m_glyph_cache = QSGDistanceFieldGlyphCache::get(QGLContext::currentContext(), m_glyphs.font());
m_glyph_cache = QSGDistanceFieldGlyphCache::get(QGLContext::currentContext(), m_glyphs.rawFont());
}
void QSGDistanceFieldGlyphNode::updateMaterial()
......
......@@ -61,7 +61,7 @@ public:
~QSGDistanceFieldGlyphNode();
virtual QPointF baseLine() const { return m_baseLine; }
virtual void setGlyphs(const QPointF &position, const QGlyphs &glyphs);
virtual void setGlyphs(const QPointF &position, const QGlyphRun &glyphs);
virtual void setColor(const QColor &color);
virtual void setPreferredAntialiasingMode(AntialiasingMode mode);
......@@ -78,7 +78,7 @@ private:
QPointF m_baseLine;
QSGDistanceFieldTextMaterial *m_material;
QPointF m_position;
QGlyphs m_glyphs;
QGlyphRun m_glyphs;
QSGDistanceFieldGlyphCache *m_glyph_cache;
QSGGeometry m_geometry;
QSGText::TextStyle m_style;
......
import Test 1.0
MyQmlObject {
id: myObject
property int myValue: 1
object: myObject
result: ###
}
......@@ -2,6 +2,7 @@ import Test 1.0
MyQmlObject {
id: myObject
object: myObject
result: ###
}
......@@ -41,6 +41,7 @@
#include <qtest.h>
#include <QDeclarativeEngine>
#include <QDeclarativeContext>
#include <QDeclarativeComponent>
#include <QFile>
#include <QDebug>
......@@ -70,9 +71,12 @@ private slots:
void objectproperty();
void basicproperty_data();
void basicproperty();
void creation_data();
void creation();