From: APTX
Date: Wed, 23 Sep 2009 13:14:43 +0000 (+0200)
Subject: - Port to the State machine classes from 4.6.0.
X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=e2c0c11cae0971ec470eeb3012dc993eb780d39f;p=aniplayer-old.git
- Port to the State machine classes from 4.6.0.
- Remove qtstatemachine-solution lib.
---
diff --git a/lib/anidbudpclient/anidbudpclient.pro b/lib/anidbudpclient/anidbudpclient.pro
index 9575960..9f2968b 100644
--- a/lib/anidbudpclient/anidbudpclient.pro
+++ b/lib/anidbudpclient/anidbudpclient.pro
@@ -57,5 +57,3 @@ CONV_HEADERS += include/AniDBUdpClient/Client \
include/AniDBUdpClient/UptimeCommand \
include/AniDBUdpClient/Hash \
include/AniDBUdpClient/UptimeCommand \
-
-include(../../lib/qtstatemachine/src/qtstatemachine.pri)
diff --git a/lib/anidbudpclient/client.cpp b/lib/anidbudpclient/client.cpp
index 151d856..4acb117 100644
--- a/lib/anidbudpclient/client.cpp
+++ b/lib/anidbudpclient/client.cpp
@@ -1,9 +1,8 @@
#include "client.h"
-#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
#include
@@ -52,20 +51,20 @@ qDebug() << "Api instance init!";
setFloodInterval(5);
- stateMachine = new QtStateMachine(this);
-
- errorState = new QtState;
- disconnectedState = new QtState;
- connectingState = new QtState;
- connectedState = new QtState;
- authenticatingState = new QtState(connectedState);
- idleState = new QtState(connectedState);
- idleTimeoutState = new QtState(connectedState);
- sendState = new QtState(connectedState);
- waitState = new QtState(connectedState);
- recieveState = new QtState;
- recieveFailState = new QtState;
- connectedHistoryState = connectedState->addHistoryState();
+ stateMachine = new QStateMachine(this);
+
+ errorState = new QState;
+ disconnectedState = new QState;
+ connectingState = new QState;
+ connectedState = new QState;
+ authenticatingState = new QState(connectedState);
+ idleState = new QState(connectedState);
+ idleTimeoutState = new QState(connectedState);
+ sendState = new QState(connectedState);
+ waitState = new QState(connectedState);
+ recieveState = new QState;
+ recieveFailState = new QState;
+ connectedHistoryState = new QHistoryState(connectedState);
stateMachine->addState(errorState);
stateMachine->addState(disconnectedState);
@@ -111,19 +110,19 @@ qDebug() << "Api instance init!";
// ------------ END Transitions -------------------
// ------------- Methods ---------------------
- errorState->invokeMethodOnEntry(this, "enterErrorState");
- disconnectedState->invokeMethodOnEntry(this, "enterDisconnectedState");
- connectingState->invokeMethodOnEntry(this, "enterConnectingState");
- connectedState->invokeMethodOnEntry(this, "enterConnectedState");
- authenticatingState->invokeMethodOnEntry(this, "enterAuthenticatingState");
- sendState->invokeMethodOnEntry(this, "enterSendState");
- waitState->invokeMethodOnEntry(this, "enterWaitState");
- idleState->invokeMethodOnEntry(this, "enterIdleState");
- idleState->invokeMethodOnExit(this, "exitIdleState");
- idleTimeoutState->invokeMethodOnEntry(this, "enterIdleTiemoutState");
-
- recieveState->invokeMethodOnEntry(this, "enterRecieveState");
- recieveFailState->invokeMethodOnEntry(this, "enterRecieveFailState");
+ QObject::connect(errorState, SIGNAL(entered()), this, SLOT(enterErrorState()));
+ QObject::connect(disconnectedState, SIGNAL(entered()), this, SLOT(enterDisconnectedState()));
+ QObject::connect(connectingState, SIGNAL(entered()), this, SLOT(enterConnectingState()));
+ QObject::connect(connectedState, SIGNAL(entered()), this, SLOT(enterConnectedState()));
+ QObject::connect(authenticatingState, SIGNAL(entered()), this, SLOT(enterAuthenticatingState()));
+ QObject::connect(sendState, SIGNAL(entered()), this, SLOT(enterSendState()));
+ QObject::connect(waitState, SIGNAL(entered()), this, SLOT(enterWaitState()));
+ QObject::connect(idleState, SIGNAL(entered()), this, SLOT(enterIdleState()));
+ QObject::connect(idleState, SIGNAL(exited()), this, SLOT(exitIdleState()));
+ QObject::connect(idleTimeoutState, SIGNAL(entered()), this, SLOT(enterIdleTiemoutState()));
+
+ QObject::connect(recieveState, SIGNAL(entered()), this, SLOT(enterRecieveState()));
+ QObject::connect(recieveFailState, SIGNAL(entered()), this, SLOT(enterRecieveFailState()));
// ------------ END Methods -------------------
stateMachine->start();
diff --git a/lib/anidbudpclient/client.h b/lib/anidbudpclient/client.h
index 728ba49..6f5b854 100644
--- a/lib/anidbudpclient/client.h
+++ b/lib/anidbudpclient/client.h
@@ -12,9 +12,9 @@
#include "anidbudpclient_global.h"
#include "authcommand.h"
-class QtStateMachine;
-class QtState;
-class QtHistoryState;
+class QStateMachine;
+class QState;
+class QHistoryState;
class QUdpSocket;
class QTimer;
@@ -208,22 +208,22 @@ private:
static const int UDP_API_COMMAND_TIMEOUT = 10;
- QtStateMachine *stateMachine;
- QtState *errorState;
- QtState *disconnectedState;
- QtState *connectingState;
- QtState *connectedState;
- QtState *authenticatingState;
+ QStateMachine *stateMachine;
+ QState *errorState;
+ QState *disconnectedState;
+ QState *connectingState;
+ QState *connectedState;
+ QState *authenticatingState;
- QtState *idleState;
- QtState *idleTimeoutState;
- QtState *sendState;
- QtState *waitState;
+ QState *idleState;
+ QState *idleTimeoutState;
+ QState *sendState;
+ QState *waitState;
- QtState *recieveState;
- QtState *recieveFailState;
+ QState *recieveState;
+ QState *recieveFailState;
- QtHistoryState *connectedHistoryState;
+ QHistoryState *connectedHistoryState;
};
class CommandData : QObject
diff --git a/lib/qtstatemachine/.licenseAccepted b/lib/qtstatemachine/.licenseAccepted
deleted file mode 100644
index d788f0d..0000000
--- a/lib/qtstatemachine/.licenseAccepted
+++ /dev/null
@@ -1 +0,0 @@
-license accepted
diff --git a/lib/qtstatemachine/INSTALL.TXT b/lib/qtstatemachine/INSTALL.TXT
deleted file mode 100644
index 8d41864..0000000
--- a/lib/qtstatemachine/INSTALL.TXT
+++ /dev/null
@@ -1,254 +0,0 @@
-INSTALLATION INSTRUCTIONS
-
-These instructions refer to the package you are installing as
-some-package.tar.gz or some-package.zip. The .zip file is intended for use
-on Windows.
-
-The directory you choose for the installation will be referred to as
-your-install-dir.
-
-Note to Qt Visual Studio Integration users: In the instructions below,
-instead of building from command line with nmake, you can use the menu
-command 'Qt->Open Solution from .pro file' on the .pro files in the
-example and plugin directories, and then build from within Visual
-Studio.
-
-Unpacking and installation
---------------------------
-
-1. Unpacking the archive (if you have not done so already).
-
- On Unix and Mac OS X (in a terminal window):
-
- cd your-install-dir
- gunzip some-package.tar.gz
- tar xvf some-package.tar
-
- This creates the subdirectory some-package containing the files.
-
- On Windows:
-
- Unpack the .zip archive by right-clicking it in explorer and
- choosing "Extract All...". If your version of Windows does not
- have zip support, you can use the infozip tools available
- from www.info-zip.org.
-
- If you are using the infozip tools (in a command prompt window):
- cd your-install-dir
- unzip some-package.zip
-
-2. Configuring the package.
-
- The configure script is called "configure" on unix/mac and
- "configure.bat" on Windows. It should be run from a command line
- after cd'ing to the package directory.
-
- You can choose whether you want to use the component by including
- its source code directly into your project, or build the component
- as a dynamic shared library (DLL) that is loaded into the
- application at run-time. The latter may be preferable for
- technical or licensing (LGPL) reasons. If you want to build a DLL,
- run the configure script with the argument "-library". Also see
- the note about usage below.
-
- (Components that are Qt plugins, e.g. styles and image formats,
- are by default built as a plugin DLL.)
-
- The configure script will prompt you in some cases for further
- information. Answer these questions and carefully read the license text
- before accepting the license conditions. The package cannot be used if
- you do not accept the license conditions.
-
-3. Building the component and examples (when required).
-
- If a DLL is to be built, or if you would like to build the
- examples, next give the commands
-
- qmake
- make [or nmake if your are using Microsoft Visual C++]
-
- The example program(s) can be found in the directory called
- "examples" or "example".
-
- Components that are Qt plugins, e.g. styles and image formats, are
- ready to be used as soon as they are built, so the rest of this
- installation instruction can be skipped.
-
-4. Building the Qt Designer plugin (optional).
-
- Some of the widget components are provided with plugins for Qt
- Designer. To build and install the plugin, cd into the
- some-package/plugin directory and give the commands
-
- qmake
- make [or nmake if your are using Microsoft Visual C++]
-
- Restart Qt Designer to make it load the new widget plugin.
-
- Note: If you are using the built-in Qt Designer from the Qt Visual
- Studio Integration, you will need to manually copy the plugin DLL
- file, i.e. copy
- %QTDIR%\plugins\designer\some-component.dll
- to the Qt Visual Studio Integration plugin path, typically:
- C:\Program Files\Trolltech\Qt VS Integration\plugins
-
- Note: If you for some reason are using a Qt Designer that is built
- in debug mode, you will need to build the plugin in debug mode
- also. Edit the file plugin.pro in the plugin directory, changing
- 'release' to 'debug' in the CONFIG line, before running qmake.
-
-
-
-Solutions components are intended to be used directly from the package
-directory during development, so there is no 'make install' procedure.
-
-
-Using a component in your project
----------------------------------
-
-To use this component in your project, add the following line to the
-project's .pro file (or do the equivalent in your IDE):
-
- include(your-install-dir/some-package/src/some-package.pri)
-
-This adds the package's sources and headers to the SOURCES and HEADERS
-project variables respectively (or, if the component has been
-configured as a DLL, it adds that library to the LIBS variable), and
-updates INCLUDEPATH to contain the package's src
-directory. Additionally, the .pri file may include some dependencies
-needed by the package.
-
-To include a header file from the package in your sources, you can now
-simply use:
-
- #include
-
-or alternatively, in pre-Qt 4 style:
-
- #include
-
-Refer to the documentation to see the classes and headers this
-components provides.
-
-
-
-Install documentation (optional)
---------------------------------
-
-The HTML documentation for the package's classes is located in the
-your-install-dir/some-package/doc/html/index.html. You can open this
-file and read the documentation with any web browser.
-
-To install the documentation into Qt Assistant (for Qt version 4.4 and
-later):
-
-1. In Assistant, open the Edit->Preferences dialog and choose the
- Documentation tab. Click the Add... button and select the file
- your-install-dir/some-package/doc/html/some-package.qch
-
-For Qt versions prior to 4.4, do instead the following:
-
-1. The directory your-install-dir/some-package/doc/html contains a
- file called some-package.dcf. Execute the following commands in a
- shell, command prompt or terminal window:
-
- cd your-install-dir/some-package/doc/html/
- assistant -addContentFile some-package.dcf
-
-The next time you start Qt Assistant, you can access the package's
-documentation.
-
-
-Removing the documentation from assistant
------------------------------------------
-
-If you have installed the documentation into Qt Assistant, and want to uninstall it, do as follows, for Qt version 4.4 and later:
-
-1. In Assistant, open the Edit->Preferences dialog and choose the
- Documentation tab. In the list of Registered Documentation, select
- the item com.trolltech.qtsolutions.some-package_version, and click
- the Remove button.
-
-For Qt versions prior to 4.4, do instead the following:
-
-1. The directory your-install-dir/some-package/doc/html contains a
- file called some-package.dcf. Execute the following commands in a
- shell, command prompt or terminal window:
-
- cd your-install-dir/some-package/doc/html/
- assistant -removeContentFile some-package.dcf
-
-
-
-Using the component as a DLL
-----------------------------
-
-1. Normal components
-
- The shared library (DLL) is built and placed in the
- some-package/lib directory. It is intended to be used directly
- from there during development. When appropriate, both debug and
- release versions are built, since the run-time linker will in some
- cases refuse to load a debug-built DLL into a release-built
- application or vice versa.
-
- The following steps are taken by default to help the dynamic
- linker to locate the DLL at run-time (during development):
-
- Unix: The some-package.pri file will add linker instructions to
- add the some-package/lib directory to the rpath of the
- executable. (When distributing, or if your system does not support
- rpath, you can copy the shared library to another place that is
- searched by the dynamic linker, e.g. the "lib" directory of your
- Qt installation.)
-
- Mac: The full path to the library is hardcoded into the library
- itself, from where it is copied into the executable at link time,
- and ready by the dynamic linker at run-time. (When distributing,
- you will want to edit these hardcoded paths in the same way as for
- the Qt DLLs. Refer to the document "Deploying an Application on
- Mac OS X" in the Qt Reference Documentation.)
-
- Windows: the .dll file(s) are copied into the "bin" directory of
- your Qt installation. The Qt installation will already have set up
- that directory to be searched by the dynamic linker.
-
-
-2. Plugins
-
- For Qt Solutions plugins (e.g. image formats), both debug and
- release versions of the plugin are built by default when
- appropriate, since in some cases the release Qt library will not
- load a debug plugin, and vice versa. The plugins are automatically
- copied into the plugins directory of your Qt installation when
- built, so no further setup is required.
-
- Plugins may also be built statically, i.e. as a library that will be
- linked into your application executable, and so will not need to
- be redistributed as a separate plugin DLL to end users. Static
- building is required if Qt itself is built statically. To do it,
- just add "static" to the CONFIG variable in the plugin/plugin.pro
- file before building. Refer to the "Static Plugins" section in the
- chapter "How to Create Qt Plugins" for explanation of how to use a
- static plugin in your application. The source code of the example
- program(s) will also typically contain the relevant instructions
- as comments.
-
-
-
-Uninstalling
-------------
-
- The following command will remove any fils that have been
- automatically placed outside the package directory itself during
- installation and building
-
- make distclean [or nmake if your are using Microsoft Visual C++]
-
- If Qt Assistant documentation or Qt Designer plugins have been
- installed, they can be uninstalled manually, ref. above.
-
-
-Enjoy! :)
-
-- The Qt Solutions Team.
diff --git a/lib/qtstatemachine/LGPL_EXCEPTION.txt b/lib/qtstatemachine/LGPL_EXCEPTION.txt
deleted file mode 100644
index 0b56ff1..0000000
--- a/lib/qtstatemachine/LGPL_EXCEPTION.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Nokia Qt LGPL Exception version 1.0
-
-As a special exception to the GNU Lesser General Public License
-version 2.1, the object code form of a "work that uses the Library"
-may incorporate material from a header file that is part of the
-Library. You may distribute such object code under terms of your
-choice, provided that the incorporated material (i) does not exceed
-more than 5% of the total size of the Library; and (ii) is limited to
-numerical parameters, data structure layouts, accessors, macros,
-inline functions and templates.
diff --git a/lib/qtstatemachine/LICENSE.GPL3 b/lib/qtstatemachine/LICENSE.GPL3
deleted file mode 100644
index 94a9ed0..0000000
--- a/lib/qtstatemachine/LICENSE.GPL3
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/lib/qtstatemachine/LICENSE.LGPL b/lib/qtstatemachine/LICENSE.LGPL
deleted file mode 100644
index 5ab7695..0000000
--- a/lib/qtstatemachine/LICENSE.LGPL
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- , 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/lib/qtstatemachine/README.TXT b/lib/qtstatemachine/README.TXT
deleted file mode 100644
index 091571b..0000000
--- a/lib/qtstatemachine/README.TXT
+++ /dev/null
@@ -1,10 +0,0 @@
-Qt State Machine Framework v1.1
-
-This component adds an API for creating hierarchical finite state
-machines. Note that this solution is experimental and work in
-progress: No backwards compatibility (source nor binary) is
-provided.
-
-The State Machine Framework lets you define and run state
-machines. It also includes tools to load or compile SCXML files.
-
diff --git a/lib/qtstatemachine/buildlib/buildlib.pro b/lib/qtstatemachine/buildlib/buildlib.pro
deleted file mode 100644
index d9e2758..0000000
--- a/lib/qtstatemachine/buildlib/buildlib.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE=lib
-CONFIG += qt dll qtstatemachine-buildlib
-mac:CONFIG += absolute_library_soname
-win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all
-include(../src/qtstatemachine.pri)
-TARGET = $$QTSTATEMACHINE_LIBNAME
-DESTDIR = $$QTSTATEMACHINE_LIBDIR
-win32 {
- DLLDESTDIR = $$[QT_INSTALL_BINS]
- QMAKE_DISTCLEAN += $$[QT_INSTALL_BINS]\\$${QTSTATEMACHINE_LIBNAME}.dll
-}
-target.path = $$DESTDIR
-INSTALLS += target
diff --git a/lib/qtstatemachine/common.pri b/lib/qtstatemachine/common.pri
deleted file mode 100644
index e0b2a6e..0000000
--- a/lib/qtstatemachine/common.pri
+++ /dev/null
@@ -1,6 +0,0 @@
-infile(config.pri, SOLUTIONS_LIBRARY, yes): CONFIG += qtstatemachine-uselib
-TEMPLATE += fakelib
-QTSTATEMACHINE_LIBNAME = $$qtLibraryTarget(QtSolutions_StateMachineFramework-1.1)
-TEMPLATE -= fakelib
-QTSTATEMACHINE_LIBDIR = $$PWD/lib
-unix:qtstatemachine-uselib:!qtstatemachine-buildlib:QMAKE_RPATHDIR += $$QTSTATEMACHINE_LIBDIR
diff --git a/lib/qtstatemachine/config.pri b/lib/qtstatemachine/config.pri
deleted file mode 100644
index 8d70e45..0000000
--- a/lib/qtstatemachine/config.pri
+++ /dev/null
@@ -1 +0,0 @@
-SOLUTIONS_LIBRARY = no
diff --git a/lib/qtstatemachine/configure.bat b/lib/qtstatemachine/configure.bat
deleted file mode 100644
index 7ce1985..0000000
--- a/lib/qtstatemachine/configure.bat
+++ /dev/null
@@ -1,134 +0,0 @@
-@echo off
-
-rem
-rem "Main"
-rem
-
-if not "%1"=="" (
- if not "%1"=="-library" (
- call :PrintUsage
- goto EOF
- )
-)
-
-rem only ask to accept the license text once
-if exist .licenseAccepted goto HandleArgs
-
-rem determine if free or commercial package
-set edition=commercial
-if exist LICENSE.LGPL. set edition=free
-
-if %edition%==free (
- call :HandleFree
-) else (
- call :RegionLoop
- call :Comm
-)
-echo .
-
-if not exist .licenseAccepted (
- echo You are not licensed to use this software.
- goto EOF
-)
-
-:HandleArgs
-if exist config.pri. del config.pri
-if "%1"=="-library" (
- echo Configuring to build this component as a dynamic library.
- echo SOLUTIONS_LIBRARY = yes > config.pri
-)
-
-echo .
-echo This component is now configured.
-echo .
-echo To build the component library (if requested) and example(s),
-echo run qmake and your make or nmake command.
-echo .
-echo To remove or reconfigure, run make (nmake) distclean.
-echo .
-
-goto EOF
-
-rem
-rem "License acceptance loops"
-rem
-
-:RegionLoop
- echo .
- echo Please choose your region.
- echo .
- echo Type 1 for North or South America.
- echo Type 2 for anywhere outside North and South America.
- echo .
- set /p region=Select:
- if %region%==1 (
- set licenseFile=LICENSE.US
- goto EOF
- )
- if %region%==2 (
- set licenseFile=LICENSE.NO
- goto EOF
- )
-goto RegionLoop
-
-:HandleFree
- echo .
- echo You are licensed to use this software under the terms of
- echo the GNU General Public License (GPL) version 3, or
- echo the GNU Lesser General Public License (LGPL) version 2.1
- echo with certain additional extra rights as specified in the
- echo Nokia Qt LGPL Exception version 1.0.
- echo .
- echo Type 'G' to view the GNU General Public License (GPL) version 3
- echo Type 'L' to view the GNU Lesser General Public License (LGPL) version 2.1
- echo Type 'E' to view the Nokia Qt LGPL Exception version 1.0.
- echo Type 'yes' to accept this license offer.
- echo Type 'no' to decline this license offer.
- echo .
- set /p answer=Do you accept the terms of this license?
-
- if %answer%==no goto EOF
- if %answer%==yes (
- echo license accepted > .licenseAccepted
- goto EOF
- )
- if %answer%==g more LICENSE.GPL3
- if %answer%==G more LICENSE.GPL3
- if %answer%==l more LICENSE.LGPL
- if %answer%==L more LICENSE.LGPL
- if %answer%==e more LGPL_EXCEPTION.txt
- if %answer%==E more LGPL_EXCEPTION.txt
-goto HandleFree
-
-:Comm
- echo .
- echo License Agreement
- echo .
- echo Type '?' to view the Qt Solutions Commercial License.
- echo Type 'yes' to accept this license offer.
- echo Type 'no' to decline this license offer.
- echo .
- set /p answer=Do you accept the terms of this license?
-
- if %answer%==no goto EOF
- if %answer%==yes (
- echo license accepted > .licenseAccepted
- copy %licenseFile% LICENSE
- del LICENSE.US
- del LICENSE.NO
- goto EOF
- )
- if %answer%==? more %licenseFile%
-goto Comm
-
-:PrintUsage
-echo Usage: configure.bat [-library]
-echo .
-echo -library: Build the component as a dynamic library (DLL). Default is to
-echo include the component source directly in the application.
-echo A DLL may be preferable for technical or licensing (LGPL) reasons.
-echo .
-goto EOF
-
-
-:EOF
diff --git a/lib/qtstatemachine/doc/external-resources.qdoc b/lib/qtstatemachine/doc/external-resources.qdoc
deleted file mode 100644
index bd75435..0000000
--- a/lib/qtstatemachine/doc/external-resources.qdoc
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-/*!
- \externalpage http://www.w3.org/TR/scxml/
- \title State Chart XML: State Machine Notation for Control Abstraction
-*/
-
-/*!
- \externalpage http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf
- \title Statecharts: A visual formalism for complex systems
-*/
diff --git a/lib/qtstatemachine/doc/groups.qdoc b/lib/qtstatemachine/doc/groups.qdoc
deleted file mode 100644
index 6ca1f57..0000000
--- a/lib/qtstatemachine/doc/groups.qdoc
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-/*!
- \group statemachine
-
- \title State Machine Classes
- \brief Classes for constructing and executing state graphs.
-
- These classes are provided by \l{The State Machine Framework} for creating
- event-driven state machines.
-*/
-
-/*!
- \group sctools
-
- \title Statechart Tools (SCXML) Classes
- \brief Classes for loading SCXML files and running state-machines with script
-
- These classes allow loading of state-machines in runtime or compile time
- from SCXML, and provides a scripting environment for the loaded state machine.
-
- See \l {scxml.html}{Using SCXML files with the Qt State Machine} for more info.
-
-*/
\ No newline at end of file
diff --git a/lib/qtstatemachine/doc/html/classic.css b/lib/qtstatemachine/doc/html/classic.css
deleted file mode 100644
index 0ff9e7d..0000000
--- a/lib/qtstatemachine/doc/html/classic.css
+++ /dev/null
@@ -1,131 +0,0 @@
-h3.fn,span.fn
-{
- margin-left: 1cm;
- text-indent: -1cm;
-}
-
-a:link
-{
- color: #004faf;
- text-decoration: none
-}
-
-a:visited
-{
- color: #672967;
- text-decoration: none
-}
-
-a.obsolete
-{
- color: #661100;
- text-decoration: none
-}
-
-a.compat
-{
- color: #661100;
- text-decoration: none
-}
-
-a.obsolete:visited
-{
- color: #995500;
- text-decoration: none
-}
-
-a.compat:visited
-{
- color: #995500;
- text-decoration: none
-}
-
-td.postheader
-{
- font-family: sans-serif
-}
-
-tr.address
-{
- font-family: sans-serif
-}
-
-body
-{
- background: #ffffff;
- color: black
-}
-
-table tr.odd {
- background: #f0f0f0;
- color: black;
-}
-
-table tr.even {
- background: #e4e4e4;
- color: black;
-}
-
-table.annotated th {
- padding: 3px;
- text-align: left
-}
-
-table.annotated td {
- padding: 3px;
-}
-
-table tr pre
-{
- padding-top: none;
- padding-bottom: none;
- padding-left: none;
- padding-right: none;
- border: none;
- background: none
-}
-
-tr.qt-style
-{
- background: #a2c511;
- color: black
-}
-
-body pre
-{
- padding: 0.2em;
- border: #e7e7e7 1px solid;
- background: #f1f1f1;
- color: black
-}
-
-span.preprocessor, span.preprocessor a
-{
- color: darkblue;
-}
-
-span.comment
-{
- color: darkred;
- font-style: italic
-}
-
-span.string,span.char
-{
- color: darkgreen;
-}
-
-.title
-{
- text-align: center
-}
-
-.subtitle
-{
- font-size: 0.8em
-}
-
-.small-subtitle
-{
- font-size: 0.65em
-}
diff --git a/lib/qtstatemachine/doc/html/images/qt-logo.png b/lib/qtstatemachine/doc/html/images/qt-logo.png
deleted file mode 100644
index 794162f..0000000
Binary files a/lib/qtstatemachine/doc/html/images/qt-logo.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/html/images/statemachine-button-history.png b/lib/qtstatemachine/doc/html/images/statemachine-button-history.png
deleted file mode 100644
index cd66478..0000000
Binary files a/lib/qtstatemachine/doc/html/images/statemachine-button-history.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/html/images/statemachine-button-nested.png b/lib/qtstatemachine/doc/html/images/statemachine-button-nested.png
deleted file mode 100644
index 60360d1..0000000
Binary files a/lib/qtstatemachine/doc/html/images/statemachine-button-nested.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/html/images/statemachine-button.png b/lib/qtstatemachine/doc/html/images/statemachine-button.png
deleted file mode 100644
index 75d9e53..0000000
Binary files a/lib/qtstatemachine/doc/html/images/statemachine-button.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/html/images/statemachine-finished.png b/lib/qtstatemachine/doc/html/images/statemachine-finished.png
deleted file mode 100644
index 802621e..0000000
Binary files a/lib/qtstatemachine/doc/html/images/statemachine-finished.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/html/images/statemachine-nonparallel.png b/lib/qtstatemachine/doc/html/images/statemachine-nonparallel.png
deleted file mode 100644
index 1fe60d8..0000000
Binary files a/lib/qtstatemachine/doc/html/images/statemachine-nonparallel.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/html/images/statemachine-parallel.png b/lib/qtstatemachine/doc/html/images/statemachine-parallel.png
deleted file mode 100644
index 1868792..0000000
Binary files a/lib/qtstatemachine/doc/html/images/statemachine-parallel.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/html/index.html b/lib/qtstatemachine/doc/html/index.html
deleted file mode 100644
index 1120592..0000000
--- a/lib/qtstatemachine/doc/html/index.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
- Qt State Machine Framework
-
-
-
-
This component adds an API for creating hierarchical finite state machines. Note that this solution is experimental and work in progress: No backwards compatibility (source nor binary) is provided.
-
The State Machine Framework lets you define and run state machines. It also includes tools to load or compile SCXML files.
The QtAbstractState class is the base class of states of a QtStateMachine.
-
The QtAbstractState class is the abstract base class of states that are part of a QtStateMachine. It defines the interface that all state objects have in common. QtAbstractState is part of The State Machine Framework.
-
The assignProperty() function is used for defining property assignments that should be performed when a state is entered.
-
The parentState() function returns the state's parent state.
-
-
Subclassing
-
The onEntry() function is called when the state is entered; reimplement this function to perform custom processing when the state is entered.
-
The onExit() function is called when the state is exited; reimplement this function to perform custom processing when the state is exited.
-
-
Member Type Documentation
-
enum QtAbstractState::RestorePolicy
-
This enum specifies the restore policy type for a state. The restore policy takes effect when the machine enters a state which sets one or more properties. If the restore policy of the state is set to RestoreProperties, the state machine will save the original value of the property before the new value is set.
-
Later, when the machine either enters a state which has its restore policy set to DoNotRestoreProperties or when it enters a state which does not set a value for the given property, the property will automatically be restored to its initial value.
-
Only one initial value will be saved for any given property. If a value for a property has already been saved by the state machine, it will not be overwritten until the property has been successfully restored. Once the property has been restored, the state machine will clear the initial value until it enters a new state which sets the property and which has RestoreProperties as its restore policy.
The QtTransition class provides a default (action-based) implementation of the QtAbstractTransition interface.
-
The sourceState() function returns the source of the transition. The targetStates() function returns the targets of the transition.
-
Transitions can cause animations to be played. Use the addAnimation() function to add an animation to the transition.
-
-
Subclassing
-
The eventTest() function is called by the state machine to determine whether an event should trigger the transition. In your reimplementation you typically check the event type and cast the event object to the proper type, and check that one or more properties of the event meet your criteria.
-
The onTransition() function is called when the transition is triggered; reimplement this function to perform custom processing for the transition.
This function is called to determine whether the given event should cause this transition to trigger. Reimplement this function and return true if the event should trigger the transition, otherwise return false.
You can add actions to a state with the addEntryAction() and addExitAction() functions. The state executes the actions when the state is entered and exited, respectively.
-
The invokeMethodOnEntry() and invokeMethodOnExit() functions are used for defining method invocations that should be performed when a state is entered and exited, respectively.
-
QtState *s2 = new QtState();
- s2->invokeMethodOnEntry(&label, "showMaximized");
- machine.addState(s2);
Instructs this state to invoke the given method of the given object with the given arguments when the state is entered. This function will create a QtStateInvokeMethodAction object and add it to the entry actions of the state.
Instructs this state to invoke the given method of the given object with the given arguments when the state is exited. This function will create a QtStateInvokeMethodAction object and add it to the exit actions of the state.
QPushButton *button = ...;
- QtState *s1 = ...;
- QtState *s2 = ...;
- // If in s1 and the button receives an Enter event, transition to s2
- QtEventTransition *enterTransition = new QtEventTransition(button, QEvent::Enter);
- enterTransition->setTargetState(s2);
- s1->addTransition(enterTransition);
- // If in s2 and the button receives an Exit event, transition back to s1
- QtEventTransition *leaveTransition = new QtEventTransition(button, QEvent::Leave);
- leaveTransition->setTargetState(s1);
- s2->addTransition(leaveTransition);
-
-
Subclassing
-
Many event classes have attributes in addition to the event type itself. The testEventCondition() function can be reimplemented to check attributes of an event instance in order to determine whether the transition should be triggered or not.
Constructs a new QtEventTransition object associated with events of the given type for the given object. The transition has the given targets and sourceState.
Tests an instance of an event associated with this event transition and returns true if the transition should be taken, otherwise returns false. The type of the given event will be eventType().
-
Reimplement this function if you have custom conditions associated with the transition. The default implementation always returns true.
A final state is used to communicate that (part of) a QtStateMachine has finished its work. When a final top-level state is entered, the state machine's finished() signal is emitted. In general, when a final substate (a child of a QtState) is entered, a QtStateFinishedEvent is generated for the final state's parent state. QtFinalState is part of The State Machine Framework.
-
To use a final state, you create a QtFinalState object and add a transition to it from another state. Example:
The QtHistoryState class provides a means of returning to a previously active substate.
-
A history state is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited. A transition with a history state as its target is in fact a transition to one of the other child states of the parent state. QtHistoryState is part of The State Machine Framework.
-
Use QtState::addHistoryState() to construct a history state. Use the setDefaultState() function to set the state that should be entered if the parent state has never been entered. Example:
-
QtStateMachine machine;
-
- QtState *s1 = new QtState();
- QtState *s11 = new QtState(s1);
- QtState *s12 = new QtState(s1);
-
- QtState *s1h = s1->addHistoryState();
- s1h->setDefaultState(s11);
-
- machine.addState(s1);
-
- QtState *s2 = new QtState();
- machine.addState(s2);
-
- QPushButton *button = new QPushButton();
- // Clicking the button will cause the state machine to enter the child state
- // that s1 was in the last time s1 was exited, or the history state's default
- // state if s1 has never been entered.
- s1->addTransition(button, SIGNAL(clicked()), s1h);
Creates a QtScriptedEvent named name, with parameter names paramNames, parameter values paramValues, and a QtScript object content as an additional parameter.
void QtScriptedStateMachine::registerInvokerFactory ( QtSsmInvokerFactory * f )
-
Enabled invoker factory f to be called from <invoke /> tags.
-
void QtScriptedStateMachine::registerObject ( QObject * o, const QString & name = QString(), bool recursive = false )
-
Registers object o to the script engine attached to the state machine. The object can be accessible from global variable name. If name is not provided, the object's name is used. If recursive is true, all the object's decendants are registered as global objects, with their respective object names as variable names.
The QtScriptedTransition class stands for a transition that responds to QtScriptedEvent, and can be made conditional with a conditionExpression. Equivalent to the SCXML transition tag. More...
The QtScriptedTransition class stands for a transition that responds to QtScriptedEvent, and can be made conditional with a conditionExpression. Equivalent to the SCXML transition tag.
The sender() function returns the object that generated the signal. The signalIndex() function returns the index of the signal. The arguments() function returns the arguments of the signal.
The QtSignalTransition class provides a transition based on a Qt signal.
-
Typically you would use the overload of QtState::addTransition() that takes a sender and signal as arguments, rather than creating QtSignalTransition objects directly. QtSignalTransition is part of The State Machine Framework.
-
You can subclass QtSignalTransition and reimplement eventTest() to make a signal transition conditional; the event object passed to eventTest() will be a QtSignalEvent object. Example:
The QtSsmInvoker class an invoker, which the state-machine context can activate or cancel with an <invoke> tag.
-
An invoker is a object that represents an external component that the state machine can activate when the encompassing state is entered, or cancel when the encompassing state is exited from.
This function is called when the encompassing state is entered. The call to this function from the state-machine context is asynchronous, to make sure that the state is not exited during the same step in which it's entered.
-
void QtSsmInvoker::cancel () [virtual slot]
-
Reimplement this function to allow for asynchronous cancellation of the invoker. It's the invoker's responsibility to delete itself after this function has been called. The default implementation deletes the invoker.
For non-parallel state groups, the setInitialState() function must be called to set the initial state. The child states are mutually exclusive states, and the state machine needs to know which child state to enter when the parent state is the target of a transition.
The addFinishedTransition() function creates and adds a transition that's triggered when a final child state is entered.
-
The setErrorState() sets the state's error state. The error state is the state that the state machine will transition to if an error is detected when attempting to enter the state (e.g. because no initial state has been set).
-
-
Member Type Documentation
-
enum QtState::HistoryType
-
This enum specifies the type of history that a QtHistoryState records.
-
-
Constant
Value
Description
-
QtState::ShallowHistory
0
Only the immediate child states of the parent state are recorded. In this case a transition with the history state as its target will end up in the immediate child state that the parent was in the last time it was exited. This is the default.
-
QtState::DeepHistory
1
Nested states are recorded. In this case a transition with the history state as its target will end up in the most deeply nested descendant state the parent was in the last time it was exited.
-
-
enum QtState::Type
-
This enum specifies the type of a state.
-
-
Constant
Value
Description
-
QtState::Normal
0
A normal state. If the state has no child states, it is an atomic state; otherwise, the child states are mutually exclusive and an initial state must be set by calling QtState::setInitialState().
-
QtState::ParallelGroup
1
The state is a parallel group state. When a parallel group state is entered, all its child states are entered in parallel.
-
-
-
Member Function Documentation
-
QtState::QtState ( QtState * parent = 0 )
-
Constructs a new state with the given parent state.
Adds a transition that's triggered by the finished event of this state, and returns the new QtStateFinishedTransition object. The transition has the given target state.
This is an overloaded member function, provided for convenience.
-
Adds a transition associated with the given signal of the given sender object, and returns the new QtSignalTransition object. The transition has this state as the source, and the given target as the target state.
Sets this state's error state to be the given state. If the error state is not set, or if it is set to 0, the state will inherit its parent's error state recursively.
The QtStateFinishedEvent class contains parameters that describe a state that has finished.
-
A state is finished when one of its final child states (a QtFinalState) is entered; this will cause a QtStateFinishedEvent to be generated by the state machine. QtStateFinishedEvent is part of The State Machine Framework.
-
Typically you do not create QtStateFinishedEvent objects yourself, but rather use QtStateFinishedTransition to create a transition that's triggered by a state's finished event.
The QtStateFinishedTransition class provides a transition that triggers when a state is finished.
-
A state is finished when one of its final child states (a QtFinalState) is entered; this will cause a QtStateFinishedEvent to be generated. The QtStateFinishedTransition class provides a way of associating a transition with such an event. QtStateFinishedTransition is part of The State Machine Framework.
-
QtStateMachine machine;
- QtState *s1 = new QtState(machine.rootState());
- QtState *s11 = new QtState(s1);
- QtFinalState *s12 = new QtFinalState(s1);
- s11->addTransition(s12);
-
- QtState *s2 = new QtState(machine.rootState());
- QtStateFinishedTransition *finishedTransition = new QtStateFinishedTransition(s1);
- finishedTransition->setTargetState(s2);
- s1->addTransition(finishedTransition);
The QtStateInvokeMethodAction class provides an invoke method action for QObjects.
-
The QtStateInvokeMethodAction class provides an action that calls a method of a QObject when a QtState is entered or exited. QtStateInvokeMethodAction is part of The State Machine Framework.
Constructs a new QtStateInvokeMethodAction object for the method named methodName of the given target object, with the given arguments, args, and with the given parent.
The QtStateMachine class provides a hierarchical finite state machine.
-
The QtStateMachine class provides a hierarchical finite state machine based on Statecharts concepts and notation. QtStateMachine is part of The State Machine Framework.
-
A state machine manages a set of states (QtAbstractState objects) and transitions (QtAbstractTransition objects) between those states; the states and the transitions collectively define a state graph. Once a state graph has been defined, the state machine can execute it. QtStateMachine's execution algorithm is based on the State Chart XML (SCXML) algorithm.
-
The QtState class provides a state that you can use to set properties and invoke methods on QObjects when the state is entered or exited. This is typically used in conjunction with signals; the signals determine the flow of the state graph, whereas the states' property assignments and method invocations are the actions.
-
Use the addState() function to add a state to the state machine; alternatively, pass the machine's rootState() to the state constructor. Use the removeState() function to remove a state from the state machine.
-
The following snippet shows a state machine that will finish when a button is clicked:
The setInitialState() function sets the state machine's initial state; this state is entered when the state machine is started.
-
The start() function starts the state machine. The state machine executes asynchronously, i.e. you need to run an event loop in order for it to make progress. The started() signal is emitted when the state machine has entered the initial state.
-
The state machine processes events and takes transitions until a top-level final state is entered; the state machine then emits the finished() signal.
-
The stop() function stops the state machine. The stopped() signal is emitted when the state machine has stopped.
-
The postEvent() function posts an event to the state machine. This is useful when you are using custom events to trigger transitions.
-
The rootState() function returns the state machine's root state. All top-level states have the root state as their parent.
This enum type defines errors that can occur in the state machine at run time. When the state machine encounters an unrecoverable error at run time, it will set the error code returned by error(), the error message returned by errorString(), and enter an error state based on the context of the error.
-
-
Constant
Value
Description
-
QtStateMachine::NoError
0
No error has occurred.
-
QtStateMachine::NoInitialStateError
1
The machine has entered a QtState with children which does not have an initial state set. The context of this error is the state which is missing an initial state.
-
QtStateMachine::NoDefaultStateInHistoryState
2
The machine has entered a QtHistoryState which does not have a default state set. The context of this error is the QtHistoryState which is missing a default state.
This signal is emitted when the state machine has finished playing all animations associated with the latest transition (i.e., all properties have reached their target values).
-
void QtStateMachine::clearError ()
-
Clears the error string and error code of the state machine.
Posts the given event for processing by this state machine, with a delay of delay milliseconds.
-
This function returns immediately. The event is added to the state machine's event queue. Events are processed in the order posted. The state machine takes ownership of the event and deletes it once it has been processed.
-
You can only post events when the state machine is running.
-
void QtStateMachine::removeState ( QtAbstractState * state )
-
Removes the given state from this state machine. The state machine releases ownership of the state.
Starts this state machine. The machine will reset its configuration and transition to the initial state. When a final top-level state is entered, the machine will emit the finished() signal.
The QtTransition class provides an action-based transition.
-
QtTransition provides an action-based transition; you add actions with the addAction() function. The transition executes the actions when the transition is triggered. QtTransition is part of The State Machine Framework.
-
The invokeMethodOnTransition() function is used for defining method invocations that should be performed when a transition is taken.
Instructs this QtTransition to invoke the given method of the given object with the given arguments when the transition is taken. This function will create a QtStateInvokeMethodAction object and add it to the actions of the transition.
These classes allow loading of state-machines in runtime or compile time from SCXML, and provides a scripting environment for the loaded state machine.
Most of the interaction with QtScriptedStateMachine occurs after the state-machine is loaded, and before it's started. The interesting functionalities of QtScriptedStateMachine are:
-
-
Working with the script engine
-
The main feature of QtScriptedStateMachine is that it includes a single QScriptEngine object that's shared between all state actions and transitions. That's what allows the states to rely on a single data context for evaluating conditions and executing the entry/exit/transition actions.
-
A very useful function is QtScriptedStateMachine::registerObject(), which allows you to add an object (and optionally all its descendants) to the scripting context. QtScriptedStateMachine::scriptEngine() allows you to manipulate the scripting context directly. Use the mediaplayer example as a reference for using the registerObject function.
-
-
Connecting the state-machine to signals/slots
-
A simpler way to interact with the state machine is through signals and slots. The slot QtScriptedStateMachine::postNamedEvent() and the signal QtScriptedStateMachine::eventTriggered() allow for a simple interaction with the state machine, as you can connect signals to postNamedEvent and eventTriggered to and signal/slot.
-
There are no entered/exited signals from states, as that would make the state-machines less deterministic and would create results that are difficult to manage and predict (does the signal get emitted before, after or during the normal execution list?)
The initEvent protected member can be used to access the parameters given to the invoker by the calling state machine. QtSsmInvoker::postParentEvent() allows sending events back to the calling state machine.
#include "qscriptedstatemachine.h"
-
- // some code
- QtScriptedStateMachine* stateMachine = QtScriptedStateMachine::load ("path-to-some-file.scxml");
- // ... register some objects, handle some stuff in the script engine...
- stateMachine->start ();
-
-
Supported SCXML tags and features
-
Though most of the SCXML features are supported in this implementation, the support is incomplete, partially because the spec itself is still evolving. This documentation tries to capture most of the gaps and differences.
The q-binding invoker can be used to setup properties on entry, that are restored on exit. Note that if the properties are changed externally while the state is active, the properties would still be restored.
-
The binding invoke element accepts a content tag with a JSON array, of which each element is a 3-item array: [object, property-name, property-value].
A custom invoker added to the solution is the "q-menu" invoker. This invoker allows you to display a QMenu and listen to its events. The q-menu invoker should a content tag, which includes an expression evaluating to an ecmascript object defining the menu. Note that support for menus is currently experimental, and the mediaplayer example demonstrates its use.
-
-
Message Boxes
-
Similar to q-menus, the "q-messagebox" invoker lets you show a QMessageBox and react to the user interactions with it.
-
The q-messagebox invoker accepts an ecmascript object that contains name/value pairs for the QMessageBox properties.
-
Example:
-
<invoke type="q-messagebox">
- <content>
- {
- "parent" : myParentWidget,
- "icon" : QMessageBox.Question,
- "windowTitle" : "Would you like to exit?",
- "text" : "Are you sure?",
- "standardButtons" : QMessageBox.Yes|QMessageBox.No
- }
- </content>
- </invoke>
The State Machine framework provides classes for creating and executing state graphs. The concepts and notation are based on those from Harel's Statecharts, which is also the basis of UML state diagrams. The semantics of state machine execution are based on State Chart XML (SCXML).
-
Statecharts provide a graphical way of modeling how a system reacts to stimuli. This is done by defining the possible states that the system can be in, and how the system can move from one state to another (transitions between states). A key characteristic of event-driven systems (such as Qt applications) is that behavior often depends not only on the last or current event, but also the events that preceded it. With statecharts, this information is easy to express.
-
The State Machine framework provides an API and execution model that can be used to effectively embed the elements and semantics of statecharts in Qt applications. The framework integrates tightly with Qt's existing event system and meta-object system; for example, transitions between states can be triggered by signals, and states can be configured to set properties and invoke methods on QObjects.
-
-
A Simple State Machine
-
To demonstrate the core functionality of the State Machine API, let's look at a small example: A state machine with three states, s1, s2 and s3. The state machine is controlled by a single QPushButton; when the button is clicked, the machine transitions to another state. Initially, the state machine is in state s1. The statechart for this machine is as follows:
-
The following snippet shows the code needed to create such a state machine.
Once the state machine has been set up, you need to start it by calling QtStateMachine::start(). The state machine executes asynchronously, i.e. it becomes part of your application's event loop.
-
The above state machine is perfectly fine, but it doesn't do anything; it merely transitions from one state to another. The QtAbstractState::assignProperty() function can be used to have a state set a property of a QObject when the state is entered. In the following snippet, the value that should be assigned to a QLabel's text property is specified for each state:
-
s1->assignProperty(label, "text", "In state s1");
- s2->assignProperty(label, "text", "In state s2");
- s3->assignProperty(label, "text", "In state s3");
-
When any of the states is entered, the label's text will be changed accordingly.
-
The QtActionState::invokeMethodOnEntry() function can be used to have a state invoke a method (a slot) of a QObject when the state is entered. In the following snippet, the button's showMaximized() slot will be called when state s3 is entered:
-
s2->invokeMethodOnEntry(button, "showMaximized");
-
-
Sharing Transitions By Grouping States
-
The state machine defined in the previous section never finishes. In order for a state machine to be able to finish, it needs to have a top-level final state. When the state machine enters a top-level final state, the machine will emit the finished() signal and halt.
-
Assume we wanted the user to be able to quit the application at any time by clicking a Quit button. In order to achieve this, we need to create a final state and make it the target of a transition associated with the Quit button's clicked() signal. We could add a transition from each of s1, s2 and s3; however, this seems redundant, and one would also have to remember to add such a transition from every new state that is added in the future.
-
We can achieve the same behavior (namely that clicking the Quit button quits the state machine, regardless of which state the state machine is in) by grouping states s1, s2 and s3. This is done by creating a new top-level state and making the three original states children of the new state. The following diagram shows the new state machine.
-
The three original states have been renamed s11, s12 and s13 to reflect that they are now children of the new top-level state, s1. Child states implicitly inherit the transitions of their parent state. This means it is now sufficient to add a single transition from s1 to the final state s2. New states added to s1 will also automatically inherit this transition.
-
All that's needed to group states is to specify the proper parent when the state is created. You also need to specify which of the child states is the initial one (i.e. which child state the state machine should enter when the parent state is the target of a transition).
-
QtState *s1 = new QtState();
- QtState *s11 = new QtState(s1);
- QtState *s12 = new QtState(s1);
- QtState *s13 = new QtState(s1);
- s1->setInitialState(s11);
- machine.addState(s1);
In this case we want the application to quit when the state machine is finished, so the machine's finished() signal is connected to the application's quit() slot.
-
A child state can override an inherited transition. For example, the following code adds a transition that effectively causes the Quit button to be ignored when the state machine is in state s12.
Using History States to Save and Restore the Current State
-
Imagine that we wanted to add an "interrupt" mechanism to the example discussed in the previous section; the user should be able to click a button to have the state machine perform some non-related task, after which the state machine should resume whatever it was doing before (i.e. return to the old state, which is one of s11, s12 and s13 in this case).
-
Such behavior can easily be modeled using history states. A history state (QtHistoryState object) is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited.
-
A history state is created as a child of the state for which we wish to record the current child state; when the state machine detects the presence of such a state at runtime, it automatically records the current (real) child state when the parent state is exited. A transition to the history state is in fact a transition to the child state that the state machine had previously saved; the state machine automatically "forwards" the transition to the real child state.
-
The following diagram shows the state machine after the interrupt mechanism has been added.
-
The following code shows how it can be implemented; in this example we simply display a message box when s3 is entered, then immediately return to the previous child state of s1 via the history state.
Using Parallel States to Avoid a Combinatorial Explosion of States
-
Assume that you wanted to model a set of mutually exclusive properties of a car in a single state machine. Let's say the properties we are interested in are Clean vs Dirty, and Moving vs Not moving. It would take four mutually exclusive states and eight transitions to be able to represent and freely move between all possible combinations.
-
If we added a third property (say, Red vs Blue), the total number of states would double, to eight; and if we added a fourth property (say, Enclosed vs Convertible), the total number of states would double again, to 16.
-
Using parallel states, the total number of states and transitions grows linearly as we add more properties, instead of exponentially. Furthermore, states can be added to or removed from the parallel state without affecting any of their sibling states.
-
To create a parallel state group, pass QtState::ParallelStateGroup to the QtState constructor.
-
QtState *s1 = new QtState(QtState::ParallelStateGroup);
- // s11 and s12 will be entered in parallel
- QtState *s11 = new QtState(s1);
- QtState *s12 = new QtState(s1);
-
-
Detecting that a Composite State has Finished
-
A child state can be final; when a final child state is entered, a QtStateFinishedEvent is generated for the parent state. You can use the QtStateFinishedTransition class to trigger a transition based on this event.
-
This is useful when you want to hide the internal details of a state; i.e. the only thing the outside world should be able to do is enter the state, and get a notification when the state has finished (i.e. when a final child state has been entered).
-
diff --git a/lib/qtstatemachine/doc/images/qt-logo.png b/lib/qtstatemachine/doc/images/qt-logo.png
deleted file mode 100644
index 794162f..0000000
Binary files a/lib/qtstatemachine/doc/images/qt-logo.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/images/statemachine-button-history.png b/lib/qtstatemachine/doc/images/statemachine-button-history.png
deleted file mode 100644
index cd66478..0000000
Binary files a/lib/qtstatemachine/doc/images/statemachine-button-history.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/images/statemachine-button-nested.png b/lib/qtstatemachine/doc/images/statemachine-button-nested.png
deleted file mode 100644
index 60360d1..0000000
Binary files a/lib/qtstatemachine/doc/images/statemachine-button-nested.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/images/statemachine-button.png b/lib/qtstatemachine/doc/images/statemachine-button.png
deleted file mode 100644
index 75d9e53..0000000
Binary files a/lib/qtstatemachine/doc/images/statemachine-button.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/images/statemachine-finished.png b/lib/qtstatemachine/doc/images/statemachine-finished.png
deleted file mode 100644
index 802621e..0000000
Binary files a/lib/qtstatemachine/doc/images/statemachine-finished.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/images/statemachine-nonparallel.png b/lib/qtstatemachine/doc/images/statemachine-nonparallel.png
deleted file mode 100644
index 1fe60d8..0000000
Binary files a/lib/qtstatemachine/doc/images/statemachine-nonparallel.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/images/statemachine-parallel.png b/lib/qtstatemachine/doc/images/statemachine-parallel.png
deleted file mode 100644
index 1868792..0000000
Binary files a/lib/qtstatemachine/doc/images/statemachine-parallel.png and /dev/null differ
diff --git a/lib/qtstatemachine/doc/index.qdoc b/lib/qtstatemachine/doc/index.qdoc
deleted file mode 100644
index ea81808..0000000
--- a/lib/qtstatemachine/doc/index.qdoc
+++ /dev/null
@@ -1,41 +0,0 @@
-/*!
- \page index.html
- \title Qt State Machine Framework
-
- \section1 Description
-
- This component adds an API for creating hierarchical finite state machines.
- Note that this solution is experimental and work in progress:
- No backwards compatibility (source nor binary) is provided.
-
-
-
- The State Machine Framework lets you define and run state machines.
- It also includes tools to load or compile SCXML files.
-
-
-
- \section1 Overview
- \list
- \i \link statemachine-api.html The State Machine Framework \endlink \i \link scxml.html Using SCXML Files With The State Machine Framework \endlink \endlist
-
- \section1 Classes
- \list
- \i QtAbstractState \i QtAbstractTransition \i QtActionState \i QtEventTransition \i QtFinalState \i QtHistoryState \i QtSignalTransition \i QtState \i QtStateAction \i QtStateFinishedEvent \i QtStateFinishedTransition \i QtStateInvokeMethodAction \i QtStateMachine \i QtTransition \i QtScriptedStateMachine \i QtScriptedEvent \i QtScriptedTransition \i QtSsmInvoker\endlist
-
-
-
-
-
-
- \section1 Tested platforms
- \list
- \i Qt 4.4, 4.5 / Windows XP / MSVC.NET 2005
- \i Qt 4.4, 4.5 / Linux / gcc
- \i Qt 4.4, 4.5 / MacOS X 10.5 / gcc
- \endlist
-
-
-
-
- */
\ No newline at end of file
diff --git a/lib/qtstatemachine/doc/scxml.qdoc b/lib/qtstatemachine/doc/scxml.qdoc
deleted file mode 100644
index 8020432..0000000
--- a/lib/qtstatemachine/doc/scxml.qdoc
+++ /dev/null
@@ -1,254 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-/*!
- \page scxml.html
- \title Using SCXML files in Qt
- \ingroup sctools
- \brief An overview of the sctools module, which allows loading scripted state charts with SCXML
-
- \tableofcontents
-
- The sctools module allows loading SCXML files into a QtScriptedStateMachine object.
-
- The files that the tool can load conform to the \l{State Chart XML: State Machine Notation for Control Abstraction}{State Chart XML (SCXML)} standard.
-
- \section1 Getting Started with Qt & SCXML
- \list
- \i First of all, make yourself familiar with the \l{State Chart XML: State Machine Notation for Control Abstraction}{SCXML specification}.
- \i Read this document to understand how to enable SCXML files in your project, and how to load SCXML files in runtime/build-time.
- \i Go over the blackjack, calc and mediaplayer examples for usage demonstration.
- \endlist
-
- \section1 Enabling the QtScriptedStateMachine class
-
- The \l QtScriptedStateMachine class is enabled automatically when the script module is enabled.
-
- \section1 Using the QtScriptedStateMachine class
-
- QtScriptedStateMachine is a subclass of QtStateMachine. QtStateMachine actually includes most of the
- "interesting" API, while QtScriptedStateMachine adds the missing parts to support SCXML.
-
- Most of the interaction with QtScriptedStateMachine occurs after the state-machine is loaded,
- and before it's started.
- The interesting functionalities of QtScriptedStateMachine are:
- \section2 Working with the script engine
-
- The main feature of \l QtScriptedStateMachine is that it includes a single \a QScriptEngine object that's
- shared between all state actions and transitions. That's what allows the states to rely on a single
- data context for evaluating conditions and executing the entry/exit/transition actions.
-
- A very useful function is \l QtScriptedStateMachine::registerObject(), which allows you to add an object
- (and optionally all its descendants) to the scripting context.
- \l QtScriptedStateMachine::scriptEngine() allows you to manipulate the scripting context directly.
- Use the mediaplayer example as a reference for using the registerObject function.
-
-
- \section2 Connecting the state-machine to signals/slots
-
- A simpler way to interact with the state machine is through signals and slots.
- The slot \l QtScriptedStateMachine::postNamedEvent() and the signal \l QtScriptedStateMachine::eventTriggered()
- allow for a simple interaction with the state machine, as you can connect signals to postNamedEvent
- and eventTriggered to and signal/slot.
-
- There are no entered/exited signals from states, as that would make the state-machines less deterministic
- and would create results that are difficult to manage and predict (does the signal get emitted before,
- after or during the normal execution list?)
-
- The calc example shows the usage of \l QtScriptedStateMachine::postNamedEvent().
-
- \section2 Extending the state-machine with custom invokers
-
- A custom invoker allows you to write your own \l{http://www.w3.org/TR/scxml/#Invoke}{invoke} tags, and implement specific invoke types,
- as described in the SCXML standard.
-
- To create a custom invoker, you must subclass from \l QtSsmInvoker, and implement at least:
- \list
- \i A constructor with \l QtScriptedEvent and \l QtStateMachine arguments
- \i The \l QtSsmInvoker::activate() function
- \i A static bool isTypeSupportedString(QString) function, conforms to the \l {http://www.w3.org/TR/scxml/#Invoke}{invoke} element's type attribute
- \i A static void initInvokerFactory(QtScriptedStateMachine*) function, allows some initialization (like adding properties to the script engine)
- \endlist
-
-
- When these terms are met, you can create an invoke-factory, and register it to the state machine.
- Example:
- \code
- #include
-
- class MyInvoker : public QtSsmInvoker
- {
- Q_OBJECT
- public:
- MyInvoker(QtScriptedEvent* ievent, QtScriptedStateMachine* p) : QtSsmInvoker(ievent,p),menu(0)
- {
- }
- static void initInvokerFactory(QtScriptedStateMachine* machine)
- {
- machine->scriptEngine()->globalObject().setProperty("some-name",someValue);
- }
- static bool isTypeSupported (const QString & s) { return s== "my-type"; }
- public Q_SLOTS:
- void activate ()
- {
- doSomeStuff ();
- }
- };
- ...
- static QSsmAutoInvokerFactory _s_factory;
- myScriptedStateMachine->registerInvoker(&_s_factory);
-
- \endcode
-
- The initEvent protected member can be used to access the parameters
- given to the invoker by the calling state machine. \l QtSsmInvoker::postParentEvent()
- allows sending events back to the calling state machine.
-
-
-
-
-
- \section1 Loading SCXML files at runtime
-
- To load SCXML files in runtime, the static function \l QtScriptedStateMachine::load() must be used.
- Note that this function requires the xmlpatterns and xml modules to be enabled.
- \l QtScriptedStateMachine::load() it creates a new \l QtScriptedStateMachine object.
- An example code would be:
-
-\code
- #include "qscriptedstatemachine.h"
-
- // some code
- QtScriptedStateMachine* stateMachine = QtScriptedStateMachine::load ("path-to-some-file.scxml");
- // ... register some objects, handle some stuff in the script engine...
- stateMachine->start ();
-\endcode
-
-
- \section1 Supported SCXML tags and features
-
-Though most of the SCXML features are supported in this implementation, the support is incomplete,
-partially because the spec itself is still evolving. This documentation tries to capture most of the
-gaps and differences.
-
- \section2 Fully supported elements
- The tags \l {http://www.w3.org/TR/scxml/#state}{state}, \l {http://www.w3.org/TR/scxml/#parallel}{parallel}, \l {http://www.w3.org/TR/scxml/#final}{final}, \l {http://www.w3.org/TR/scxml/#onentry}{onentry}, \l {http://www.w3.org/TR/scxml/#onexit}{onexit}, \l {http://www.w3.org/TR/scxml/#raise}{raise}, \l {http://www.w3.org/TR/scxml/#if}{if}, \l {http://www.w3.org/TR/scxml/#elseif}{elseif}, \l {http://www.w3.org/TR/scxml/#else}{else}, \l {http://www.w3.org/TR/scxml/#log}{log}, \l {http://www.w3.org/TR/scxml/#cancel}{cancel}, \l {http://www.w3.org/TR/scxml/#datamodel}{datamodel},\l {http://www.w3.org/TR/scxml/#data}{data}, \l {http://www.w3.org/TR/scxml/#assign}{assign}, \l {http://www.w3.org/TR/scxml/#param}{param}, ands \l {http://www.w3.org/TR/scxml/#anchor}{anchor} are fully supported according to the scxml spec.
-
- \section2 Partially supported elements
- \list
- \i \l {http://www.w3.org/TR/scxml/#scxml}{scxml}: The attributes version, profile and exmode are ignored.
- \i \l {http://www.w3.org/TR/scxml/#initial}{initial}: Treated as a regular state that's marked as initial for the parent state.
- \i \l {http://www.w3.org/TR/scxml/#history}{history}: Actions in the history's default transition are ignored.
- \i \l {http://www.w3.org/TR/scxml/#content}{content}: Supports only JSON data, not XML.
- \i \l {http://www.w3.org/TR/scxml/#send}{send}: only the scxml target type is supported. The id attribute is ignored.
- \i \l {http://www.w3.org/TR/scxml/#invoke}{invoke}: the autoforward and id tags are ignored.
- \endlist
-
- \section2 Unsupported elements
- The elements \l {http://www.w3.org/TR/scxml/#Donedata}{donedata}, \l {http://www.w3.org/TR/scxml/#Finalize}{finalize} and \l {http://www.w3.org/TR/scxml/#Validate}{validate} are not supported.
- Also, the local/global script scoping functionality is not implemented.
-
- \section2 Extras
- \section3 Signal transitions
- To declare a signal transition, use a transition tag with a q-signal uri scheme.
- Example:
- \code
-
- \endcode
-
- \section3 Property binding
- The q-binding invoker can be used to setup properties on entry, that are restored on exit.
- Note that if the properties are changed externally while the state is active, the properties
- would still be restored.
-
- The binding invoke element accepts a content tag with a JSON array, of which each element is a 3-item
- array: [object, property-name, property-value].
-
- Example:
-
- \code
-
- [[myObject,"someProperty",someValue1 + someValue2],
- [myObject,"text","hello"]]
-
- \endcode
-
- \section3 Menus
- A custom invoker added to the solution is the "q-menu" invoker. This invoker allows you to display a
- QMenu and listen to its events.
- The q-menu invoker should a content tag, which includes an expression evaluating to an ecmascript
- object defining the menu.
- Note that support for menus is currently experimental, and the mediaplayer example demonstrates its use.
-
- \section3 Message Boxes
- Similar to q-menus, the "q-messagebox" invoker lets you show a QMessageBox and react to
- the user interactions with it.
-
- The q-messagebox invoker accepts an ecmascript object that contains name/value pairs for the QMessageBox
- properties.
-
- Example:
- \code
-
-
- {
- "parent" : myParentWidget,
- "icon" : QMessageBox.Question,
- "windowTitle" : "Would you like to exit?",
- "text" : "Are you sure?",
- "standardButtons" : QMessageBox.Yes|QMessageBox.No
- }
-
-
- \endcode
-
- See the blackjack example for reference.
-
-
-
-
-
- */
diff --git a/lib/qtstatemachine/doc/statemachine.qdoc b/lib/qtstatemachine/doc/statemachine.qdoc
deleted file mode 100644
index 9f329d0..0000000
--- a/lib/qtstatemachine/doc/statemachine.qdoc
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-/*!
- \page statemachine-api.html
- \title The State Machine Framework
- \brief An overview of the State Machine framework for constructing and executing state graphs.
-
- \tableofcontents
-
- The State Machine framework provides classes for creating and executing
- state graphs. The concepts and notation are based on those from Harel's
- \l{Statecharts: A visual formalism for complex systems}{Statecharts}, which
- is also the basis of UML state diagrams. The semantics of state machine
- execution are based on \l{State Chart XML: State Machine Notation for
- Control Abstraction}{State Chart XML (SCXML)}.
-
- Statecharts provide a graphical way of modeling how a system reacts to
- stimuli. This is done by defining the possible \e states that the system can
- be in, and how the system can move from one state to another (\e transitions
- between states). A key characteristic of event-driven systems (such as Qt
- applications) is that behavior often depends not only on the last or current
- event, but also the events that preceded it. With statecharts, this
- information is easy to express.
-
- The State Machine framework provides an API and execution model that can be
- used to effectively embed the elements and semantics of statecharts in Qt
- applications. The framework integrates tightly with Qt's existing event
- system and meta-object system; for example, transitions between states can
- be triggered by signals, and states can be configured to set properties and
- invoke methods on QObjects.
-
- \section1 A Simple State Machine
-
- To demonstrate the core functionality of the State Machine API, let's look
- at a small example: A state machine with three states, \c s1, \c s2 and \c
- s3. The state machine is controlled by a single QPushButton; when the button
- is clicked, the machine transitions to another state. Initially, the state
- machine is in state \c s1. The statechart for this machine is as follows:
-
- \img statemachine-button.png
- \omit
- \caption This is a caption
- \endomit
-
- The following snippet shows the code needed to create such a state machine.
-
- \code
- QtStateMachine machine;
- QtState *s1 = new QtState();
- QtState *s2 = new QtState();
- QtState *s3 = new QtState();
-
- s1->addTransition(button, SIGNAL(clicked()), s2);
- s2->addTransition(button, SIGNAL(clicked()), s3);
- s3->addTransition(button, SIGNAL(clicked()), s1);
-
- machine.addState(s1);
- machine.addState(s2);
- machine.addState(s3);
- machine.setInitialState(s1);
-
- machine.start();
- \endcode
-
- Once the state machine has been set up, you need to start it by calling
- QtStateMachine::start(). The state machine executes asynchronously, i.e. it
- becomes part of your application's event loop.
-
- The above state machine is perfectly fine, but it doesn't \e do anything; it
- merely transitions from one state to another. The
- QtAbstractState::assignProperty() function can be used to have a state set a
- property of a QObject when the state is entered. In the following snippet,
- the value that should be assigned to a QLabel's text property is specified
- for each state:
-
- \code
- s1->assignProperty(label, "text", "In state s1");
- s2->assignProperty(label, "text", "In state s2");
- s3->assignProperty(label, "text", "In state s3");
- \endcode
-
- When any of the states is entered, the label's text will be changed
- accordingly.
-
- The QtActionState::invokeMethodOnEntry() function can be used to have a state
- invoke a method (a slot) of a QObject when the state is entered. In the
- following snippet, the button's showMaximized() slot will be called when
- state \c s3 is entered:
-
- \code
- s2->invokeMethodOnEntry(button, "showMaximized");
- \endcode
-
- \section1 Sharing Transitions By Grouping States
-
- The state machine defined in the previous section never finishes. In order
- for a state machine to be able to finish, it needs to have a top-level \e
- final state. When the state machine enters a top-level final state, the
- machine will emit the finished() signal and halt.
-
- Assume we wanted the user to be able to quit the application at any time by
- clicking a Quit button. In order to achieve this, we need to create a final
- state and make it the target of a transition associated with the Quit
- button's clicked() signal. We could add a transition from each of \c s1, \c
- s2 and \c s3; however, this seems redundant, and one would also have to
- remember to add such a transition from every new state that is added in the
- future.
-
- We can achieve the same behavior (namely that clicking the Quit button quits
- the state machine, regardless of which state the state machine is in) by
- grouping states \c s1, \c s2 and \c s3. This is done by creating a new
- top-level state and making the three original states children of the new
- state. The following diagram shows the new state machine.
-
- \img statemachine-button-nested.png
- \omit
- \caption This is a caption
- \endomit
-
- The three original states have been renamed \c s11, \c s12 and \c s13 to
- reflect that they are now children of the new top-level state, \c s1. Child
- states implicitly inherit the transitions of their parent state. This means
- it is now sufficient to add a single transition from \c s1 to the final
- state \c s2. New states added to \c s1 will also automatically inherit this
- transition.
-
- All that's needed to group states is to specify the proper parent when the
- state is created. You also need to specify which of the child states is the
- initial one (i.e. which child state the state machine should enter when the
- parent state is the target of a transition).
-
- \code
- QtState *s1 = new QtState();
- QtState *s11 = new QtState(s1);
- QtState *s12 = new QtState(s1);
- QtState *s13 = new QtState(s1);
- s1->setInitialState(s11);
- machine.addState(s1);
- \endcode
-
- \code
- QtFinalState *s2 = new QtFinalState();
- s1->addTransition(quitButton, SIGNAL(clicked()), s2);
- machine.addState(s2);
-
- QObject::connect(&machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit()));
- \endcode
-
- In this case we want the application to quit when the state machine is
- finished, so the machine's finished() signal is connected to the
- application's quit() slot.
-
- A child state can override an inherited transition. For example, the
- following code adds a transition that effectively causes the Quit button to
- be ignored when the state machine is in state \c s12.
-
- \code
- s12>addTransition(quitButton, SIGNAL(clicked()), s12);
- \endcode
-
- \section1 Using History States to Save and Restore the Current State
-
- Imagine that we wanted to add an "interrupt" mechanism to the example
- discussed in the previous section; the user should be able to click a button
- to have the state machine perform some non-related task, after which the
- state machine should resume whatever it was doing before (i.e. return to the
- old state, which is one of \c s11, \c s12 and \c s13 in this case).
-
- Such behavior can easily be modeled using \e{history states}. A history
- state (QtHistoryState object) is a pseudo-state that represents the child
- state that the parent state was in the last time the parent state was
- exited.
-
- A history state is created as a child of the state for which we wish to
- record the current child state; when the state machine detects the presence
- of such a state at runtime, it automatically records the current (real)
- child state when the parent state is exited. A transition to the history
- state is in fact a transition to the child state that the state machine had
- previously saved; the state machine automatically "forwards" the transition
- to the real child state.
-
- The following diagram shows the state machine after the interrupt mechanism
- has been added.
-
- \img statemachine-button-history.png
- \omit
- \caption This is a caption
- \endomit
-
- The following code shows how it can be implemented; in this example we
- simply display a message box when \c s3 is entered, then immediately return
- to the previous child state of \c s1 via the history state.
-
- \code
- QtHistoryState *s1h = s1->addHistoryState();
-
- QtState *s3 = new QtState();
- s3->assignProperty(label, "text", "In s3");
- QMessageBox mbox;
- mbox.addButton(QMessageBox::Ok);
- mbox.setText("Interrupted!");
- mbox.setIcon(QMessageBox::Information);
- s3->invokeMethodOnEntry(&mbox, "exec");
- s3->addTransition(s1h);
- machine.addState(s3);
-
- s1->addTransition(interruptButton, SIGNAL(clicked()), s3);
- \endcode
-
- \section1 Using Parallel States to Avoid a Combinatorial Explosion of States
-
- Assume that you wanted to model a set of mutually exclusive properties of a
- car in a single state machine. Let's say the properties we are interested in
- are Clean vs Dirty, and Moving vs Not moving. It would take four mutually
- exclusive states and eight transitions to be able to represent and freely
- move between all possible combinations.
-
- \img statemachine-nonparallel.png
- \omit
- \caption This is a caption
- \endomit
-
- If we added a third property (say, Red vs Blue), the total number of states
- would double, to eight; and if we added a fourth property (say, Enclosed vs
- Convertible), the total number of states would double again, to 16.
-
- Using parallel states, the total number of states and transitions grows
- linearly as we add more properties, instead of exponentially. Furthermore,
- states can be added to or removed from the parallel state without affecting
- any of their sibling states.
-
- \img statemachine-parallel.png
- \omit
- \caption This is a caption
- \endomit
-
- To create a parallel state group, pass QtState::ParallelStateGroup to the
- QtState constructor.
-
- \code
- QtState *s1 = new QtState(QtState::ParallelStateGroup);
- // s11 and s12 will be entered in parallel
- QtState *s11 = new QtState(s1);
- QtState *s12 = new QtState(s1);
- \endcode
-
- \section1 Detecting that a Composite State has Finished
-
- A child state can be final; when a final child state is entered, a
- QtStateFinishedEvent is generated for the parent state. You can use the
- QtStateFinishedTransition class to trigger a transition based on this event.
-
- \img statemachine-finished.png
- \omit
- \caption This is a caption
- \endomit
-
- This is useful when you want to hide the internal details of a state;
- i.e. the only thing the outside world should be able to do is enter the
- state, and get a notification when the state has finished (i.e. when a final
- child state has been entered).
-
- */
diff --git a/lib/qtstatemachine/examples/blackjack/bj.qrc b/lib/qtstatemachine/examples/blackjack/bj.qrc
deleted file mode 100644
index 6e39934..0000000
--- a/lib/qtstatemachine/examples/blackjack/bj.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- blackjack.scxml
-
-
diff --git a/lib/qtstatemachine/examples/blackjack/blackjack.pro b/lib/qtstatemachine/examples/blackjack/blackjack.pro
deleted file mode 100644
index 29c7351..0000000
--- a/lib/qtstatemachine/examples/blackjack/blackjack.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-# -------------------------------------------------
-# Project created by QtCreator 2008-12-16T16:32:05
-# -------------------------------------------------
-QT += script
-DEPENDPATH += .
-INCLUDEPATH += .
-TARGET = blackjack
-CONFIG += console
-CONFIG -= app_bundle
-TEMPLATE = app
-SOURCES += main.cpp
-include($$PWD/../../src/qtstatemachine.pri)
-FORMS += blackjack.ui
-RESOURCES += bj.qrc
diff --git a/lib/qtstatemachine/examples/blackjack/blackjack.scxml b/lib/qtstatemachine/examples/blackjack/blackjack.scxml
deleted file mode 100644
index 6c98eb5..0000000
--- a/lib/qtstatemachine/examples/blackjack/blackjack.scxml
+++ /dev/null
@@ -1,305 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- [[welcomeLabel,"text","Welcome to Blackjack"]]
-
-
-
-
-
-
-
-
-
-
-
-
- {
- "parent" : gameWidget,
- "icon" : QMessageBox.Question,
- "windowTitle" : "Exit Blackjack",
- "text" : "Are you sure?",
- "standardButtons" :
- QMessageBox.Yes|QMessageBox.No
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [
- [betEdit,"enabled",true],
- [betButton,"enabled",true],
- [surrenderButton,"enabled",true],
- [welcomeLabel,"text","Please place your bet"]
- ]
-
-
-
-
-
-
-
-
-
-
-
- {
- "parent" : betEdit,
- "icon" : QMessageBox.Warning,
- "windowTitle" : "Bet is Too High",
- "text" : "Please Place Another Bet",
- "standardButtons" :
- QMessageBox.Ok
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [
- [welcomeLabel,"text","Hit/Stand?"],
- [hitButton,"enabled",true],
- [standButton,"enabled",true]
- ]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[welcomeLabel,"text","Game Over"]]
-
-
-
-
-
-
- [[newRoundButton,"enabled",true]]
-
-
-
-
-
-
-
-
-
-
- [[welcomeLabel,"text","You Won!"]]
-
-
- [[welcomeLabel,"text","You Lost..."]]
-
-
-
- [[welcomeLabel,"text","You It's a draw."]]
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/qtstatemachine/examples/blackjack/blackjack.ui b/lib/qtstatemachine/examples/blackjack/blackjack.ui
deleted file mode 100644
index 187ec62..0000000
--- a/lib/qtstatemachine/examples/blackjack/blackjack.ui
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
- gameWidget
-
-
-
- 0
- 0
- 520
- 173
-
-
-
- SCXML Blackjack Example
-
-
-
-
-
-
- 6
-
-
- 9
-
-
-
-
-
- 18
-
-
-
-
-
-
-
-
-
-
-
- 16
-
-
-
- color:#660033
-
-
-
-
-
-
-
-
-
- 6
-
-
- 0
-
-
-
-
- Points:
-
-
-
-
-
-
- color:#339999
-
-
-
-
-
-
-
-
-
- false
-
-
- 10
-
-
- false
-
-
-
-
-
-
- false
-
-
- Bet
-
-
-
-
-
-
-
-
- 6
-
-
- 0
-
-
-
-
- true
-
-
- New Game
-
-
-
-
-
-
- false
-
-
- New Round
-
-
-
-
-
-
- false
-
-
- Surrender
-
-
-
-
-
-
- false
-
-
- Hit
-
-
-
-
-
-
- false
-
-
- Stand
-
-
-
-
-
-
- Exit
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/qtstatemachine/examples/blackjack/main.cpp b/lib/qtstatemachine/examples/blackjack/main.cpp
deleted file mode 100644
index e8ea625..0000000
--- a/lib/qtstatemachine/examples/blackjack/main.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#include
-#include "ui_blackjack.h"
-#include
-#include
-#include
-#include
-#include "qscriptedstatemachine.h"
-#include "time.h"
-
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
- srand(clock());
- QtScriptedStateMachine *sm = QtScriptedStateMachine::load(":/blackjack.scxml");
- QObject::connect (sm, SIGNAL(finished()), &a, SLOT(quit()));
- QMessageBox b;
- QWidget* wdg = new QWidget();
- Ui::gameWidget gw;
- gw.setupUi(wdg);
- sm->registerObject(wdg,"gameWidget",true);
- wdg->show();
- sm->start();
- return a.exec();
-}
diff --git a/lib/qtstatemachine/examples/calc/calc.cpp b/lib/qtstatemachine/examples/calc/calc.cpp
deleted file mode 100644
index 2c676c3..0000000
--- a/lib/qtstatemachine/examples/calc/calc.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "calc.h"
-#include "ui_calc.h"
-#include
-CalcWidget::CalcWidget(QWidget *parent)
- : QWidget(parent)
-{
- setupUi(this);
- QSignalMapper* mapper = new QSignalMapper(this);
- connect (mapper, SIGNAL(mapped(QString)), this, SIGNAL(command(QString)));
- QList buttons = findChildren();
- foreach (QAbstractButton* b, buttons) {
- connect (b, SIGNAL(clicked()), mapper, SLOT(map()));
- }
- mapper->setMapping(button0,"DIGIT.0");
- mapper->setMapping(button1,"DIGIT.1");
- mapper->setMapping(button2,"DIGIT.2");
- mapper->setMapping(button3,"DIGIT.3");
- mapper->setMapping(button4,"DIGIT.4");
- mapper->setMapping(button5,"DIGIT.5");
- mapper->setMapping(button6,"DIGIT.6");
- mapper->setMapping(button7,"DIGIT.7");
- mapper->setMapping(button8,"DIGIT.8");
- mapper->setMapping(button9,"DIGIT.9");
- mapper->setMapping(buttonEq,"EQUALS");
- mapper->setMapping(buttonCE,"CE");
- mapper->setMapping(buttonC,"C");
- mapper->setMapping(buttonPoint,"POINT");
- mapper->setMapping(buttonPlus,"OPER.PLUS");
- mapper->setMapping(buttonStar,"OPER.STAR");
- mapper->setMapping(buttonMinus,"OPER.MINUS");
- mapper->setMapping(buttonDiv,"OPER.DIV");
-}
-CalcWidget::~CalcWidget()
-{
-}
diff --git a/lib/qtstatemachine/examples/calc/calc.h b/lib/qtstatemachine/examples/calc/calc.h
deleted file mode 100644
index db50ce8..0000000
--- a/lib/qtstatemachine/examples/calc/calc.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef CALC_H
-#define CALC_H
-
-#include
-#include "ui_calc.h"
-
-class CalcWidget : public QWidget, public Ui::CalcClass
-{
- Q_OBJECT
-
-public:
- CalcWidget(QWidget *parent = 0);
- ~CalcWidget();
-
-Q_SIGNALS:
- void command(const QString &);
-};
-
-#endif // CALC_H
diff --git a/lib/qtstatemachine/examples/calc/calc.pro b/lib/qtstatemachine/examples/calc/calc.pro
deleted file mode 100644
index ff274c2..0000000
--- a/lib/qtstatemachine/examples/calc/calc.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-# -------------------------------------------------
-# Project created by QtCreator 2008-12-25T19:50:44
-# -------------------------------------------------
-
-TARGET = calc
-TEMPLATE = app
-win32: CONFIG += console
-mac:CONFIG -= app_bundle
-QT = core gui script
-include($$PWD/../../src/qtstatemachine.pri)
-
-# Input
-SOURCES += main.cpp calc.cpp
-HEADERS += calc.h
-FORMS += calc.ui
-RESOURCES += calc.qrc
diff --git a/lib/qtstatemachine/examples/calc/calc.qrc b/lib/qtstatemachine/examples/calc/calc.qrc
deleted file mode 100644
index 04b1be3..0000000
--- a/lib/qtstatemachine/examples/calc/calc.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- calc.scxml
-
-
diff --git a/lib/qtstatemachine/examples/calc/calc.scxml b/lib/qtstatemachine/examples/calc/calc.scxml
deleted file mode 100644
index 35a9b9e..0000000
--- a/lib/qtstatemachine/examples/calc/calc.scxml
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
-
-
-
-
-
- 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/qtstatemachine/examples/calc/calc.ui b/lib/qtstatemachine/examples/calc/calc.ui
deleted file mode 100644
index 0e2a651..0000000
--- a/lib/qtstatemachine/examples/calc/calc.ui
+++ /dev/null
@@ -1,187 +0,0 @@
-
-
- CalcClass
-
-
-
- 0
- 0
- 419
- 156
-
-
-
-
- 419
- 400
-
-
-
- SCXML Calculator
-
-
- * {background-color:black;color:white}
-button {border-width:3; }
-
-
-
-
-
-
-background-color: #CCCCCC;
-color: black;
-font: 12pt "Courier New";
-
-
-
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
-
-
-
- 6
-
-
-
-
- 4
-
-
-
-
-
-
- 1
-
-
-
-
-
-
- color:red;font-weight:bold
-
-
- CE
-
-
-
-
-
-
- 9
-
-
-
-
-
-
- 5
-
-
-
-
-
-
- 7
-
-
-
-
-
-
- 2
-
-
-
-
-
-
- 0
-
-
-
-
-
-
- 6
-
-
-
-
-
-
- 3
-
-
-
-
-
-
- .
-
-
-
-
-
-
- +
-
-
-
-
-
-
- -
-
-
-
-
-
-
- *
-
-
-
-
-
-
- /
-
-
-
-
-
-
- =
-
-
-
-
-
-
- 8
-
-
-
-
-
-
- color: red; font-weight:bold
-
-
- C
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/qtstatemachine/examples/calc/main.cpp b/lib/qtstatemachine/examples/calc/main.cpp
deleted file mode 100644
index 0cdab14..0000000
--- a/lib/qtstatemachine/examples/calc/main.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-
-#include
-#include "calc.h"
-#include "qscriptedstatemachine.h"
-int main(int argc, char *argv[])
-{
- QApplication a(argc, argv);
- QtScriptedStateMachine *sm = QtScriptedStateMachine::load(":/calc.scxml");
- CalcWidget w;
- sm->registerObject(&w,"",true);
- QObject::connect (&w, SIGNAL(command(QString)), sm, SLOT(postNamedEvent(QString)));
- w.show();
- sm->start();
- return a.exec();
-}
diff --git a/lib/qtstatemachine/examples/clockticking/clockticking.pro b/lib/qtstatemachine/examples/clockticking/clockticking.pro
deleted file mode 100644
index 6d5f8aa..0000000
--- a/lib/qtstatemachine/examples/clockticking/clockticking.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-QT = core
-TEMPLATE = app
-TARGET =
-win32: CONFIG += console
-mac:CONFIG -= app_bundle
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/clockticking/main.cpp b/lib/qtstatemachine/examples/clockticking/main.cpp
deleted file mode 100644
index f34674a..0000000
--- a/lib/qtstatemachine/examples/clockticking/main.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#endif
-
-class ClockEvent : public QEvent
-{
-public:
- ClockEvent() : QEvent(QEvent::Type(QEvent::User+2))
- {}
-};
-
-class ClockState : public QtState
-{
-public:
- ClockState(QtStateMachine *machine, QtState *parent)
- : QtState(parent), m_machine(machine) {}
-
-protected:
- virtual void onEntry()
- {
- fprintf(stdout, "ClockState entered; posting the initial tick\n");
- m_machine->postEvent(new ClockEvent());
- }
-
-private:
- QtStateMachine *m_machine;
-};
-
-class ClockTransition : public QtAbstractTransition
-{
-public:
- ClockTransition(QtStateMachine *machine)
- : QtAbstractTransition(), m_machine(machine) { }
-
-protected:
- virtual bool eventTest(QEvent *e) const {
- return (e->type() == QEvent::User+2);
- }
- virtual void onTransition()
- {
- fprintf(stdout, "ClockTransition triggered; posting another tick with a delay of 1 second\n");
- m_machine->postEvent(new ClockEvent(), 1000);
- }
-
-private:
- QtStateMachine *m_machine;
-};
-
-class ClockListener : public QtAbstractTransition
-{
-public:
- ClockListener()
- : QtAbstractTransition() {}
-
-protected:
- virtual bool eventTest(QEvent *e) const {
- return (e->type() == QEvent::User+2);
- }
- virtual void onTransition()
- {
- fprintf(stdout, "ClockListener heard a tick!\n");
- }
-};
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- QtStateMachine machine;
- QtState *group = new QtState(QtState::ParallelGroup);
- group->setObjectName("group");
-
- ClockState *clock = new ClockState(&machine, group);
- clock->setObjectName("clock");
- clock->addTransition(new ClockTransition(&machine));
-
- QtState *listener = new QtState(group);
- listener->setObjectName("listener");
- listener->addTransition(new ClockListener());
-
- machine.addState(group);
- machine.setInitialState(group);
- machine.start();
-
- return app.exec();
-}
diff --git a/lib/qtstatemachine/examples/composition/composition.pro b/lib/qtstatemachine/examples/composition/composition.pro
deleted file mode 100644
index c5d5a5f..0000000
--- a/lib/qtstatemachine/examples/composition/composition.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/composition/main.cpp b/lib/qtstatemachine/examples/composition/main.cpp
deleted file mode 100644
index a251a48..0000000
--- a/lib/qtstatemachine/examples/composition/main.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#endif
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
- QLabel label;
- label.setAlignment(Qt::AlignCenter);
-
- QtStateMachine machine;
-
- QtState *s1 = new QtState();
- s1->setObjectName("s1");
- s1->assignProperty(&label, "text", "In S1, hang on...");
- s1->assignProperty(&label, "geometry", QRect(100, 100, 200, 100));
-
- QtState *s1_timer = new QtState(s1);
- s1_timer->setObjectName("s1_timer");
- QTimer t1;
- t1.setInterval(2000);
- s1_timer->invokeMethodOnEntry(&t1, "start");
- QtFinalState *s1_done = new QtFinalState(s1);
- s1_done->setObjectName("s1_done");
- s1_timer->addTransition(&t1, SIGNAL(timeout()), s1_done);
- s1->setInitialState(s1_timer);
-
- QtState *s2 = new QtState();
- s2->setObjectName("s2");
- s2->assignProperty(&label, "text", "In S2, I'm gonna quit on you...");
- s2->assignProperty(&label, "geometry", QRect(300, 300, 300, 100));
-// s2->invokeMethodOnEntry(&label, "setNum", QList() << 123);
-// s2->invokeMethodOnEntry(&label, "showMaximized");
-
- QtState *s2_timer = new QtState(s2);
- s2_timer->setObjectName("s2_timer");
- QTimer t2;
- t2.setInterval(2000);
- s2_timer->invokeMethodOnEntry(&t2, "start");
- QtFinalState *s2_done = new QtFinalState(s2);
- s2_done->setObjectName("s2_done");
- s2_timer->addTransition(&t2, SIGNAL(timeout()), s2_done);
- s2->setInitialState(s2_timer);
-
- s1->addFinishedTransition(s2);
-
- QtFinalState *s3 = new QtFinalState();
- s3->setObjectName("s3");
- s2->addFinishedTransition(s3);
-
- machine.addState(s1);
- machine.addState(s2);
- machine.addState(s3);
- machine.setInitialState(s1);
- QObject::connect(&machine, SIGNAL(finished()), &app, SLOT(quit()));
- machine.start();
-
- label.show();
- return app.exec();
-}
diff --git a/lib/qtstatemachine/examples/eventtransitions/eventtransitions.pro b/lib/qtstatemachine/examples/eventtransitions/eventtransitions.pro
deleted file mode 100644
index c5d5a5f..0000000
--- a/lib/qtstatemachine/examples/eventtransitions/eventtransitions.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/eventtransitions/main.cpp b/lib/qtstatemachine/examples/eventtransitions/main.cpp
deleted file mode 100644
index 238cca8..0000000
--- a/lib/qtstatemachine/examples/eventtransitions/main.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#endif
-
-class Window : public QWidget
-{
-public:
- Window(QWidget *parent = 0)
- : QWidget(parent)
- {
- QPushButton *button = new QPushButton(this);
- button->setGeometry(QRect(100, 100, 100, 100));
-
- QtStateMachine *machine = new QtStateMachine(this);
-
- QtState *s1 = new QtState();
- s1->assignProperty(button, "text", "Outside");
-
- QtState *s2 = new QtState();
- s2->assignProperty(button, "text", "Inside");
-
- QtEventTransition *enterTransition = new QtEventTransition(button, QEvent::Enter);
- enterTransition->setTargetState(s2);
- s1->addTransition(enterTransition);
-
- QtEventTransition *leaveTransition = new QtEventTransition(button, QEvent::Leave);
- leaveTransition->setTargetState(s1);
- s2->addTransition(leaveTransition);
-
- QtState *s3 = new QtState();
- s3->assignProperty(button, "text", "Pressing...");
-
- QtEventTransition *pressTransition = new QtEventTransition(button, QEvent::MouseButtonPress);
- pressTransition->setTargetState(s3);
- s2->addTransition(pressTransition);
-
- QtEventTransition *releaseTransition = new QtEventTransition(button, QEvent::MouseButtonRelease);
- releaseTransition->setTargetState(s2);
- s3->addTransition(releaseTransition);
-
- machine->addState(s1);
- machine->addState(s2);
- machine->addState(s3);
- machine->setInitialState(s1);
- QObject::connect(machine, SIGNAL(finished()), qApp, SLOT(quit()));
- machine->start();
- }
-};
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
- extern int qRegisterGuiStateMachine();
- qRegisterGuiStateMachine();
- Window window;
- window.resize(300, 300);
- window.show();
-
- return app.exec();
-}
diff --git a/lib/qtstatemachine/examples/examples.pro b/lib/qtstatemachine/examples/examples.pro
deleted file mode 100644
index 5380a55..0000000
--- a/lib/qtstatemachine/examples/examples.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- clockticking \
- composition \
- eventtransitions \
- factorial \
- helloworld \
- pauseandresume \
- pingpong \
- trafficlight \
- twowaybutton \
- calc \
- blackjack
-
-contains(QT_CONFIG,phonon) {
- SUBDIRS += mediaplayer
-}
diff --git a/lib/qtstatemachine/examples/factorial/factorial.pro b/lib/qtstatemachine/examples/factorial/factorial.pro
deleted file mode 100644
index 9b941c0..0000000
--- a/lib/qtstatemachine/examples/factorial/factorial.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = app
-TARGET =
-QT = core
-win32: CONFIG += console
-mac:CONFIG -= app_bundle
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/factorial/main.cpp b/lib/qtstatemachine/examples/factorial/main.cpp
deleted file mode 100644
index bd1fb0d..0000000
--- a/lib/qtstatemachine/examples/factorial/main.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#include
-#endif
-
-class Factorial : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int x READ x WRITE setX)
- Q_PROPERTY(int fac READ fac WRITE setFac)
-public:
- Factorial(QObject *parent = 0)
- : QObject(parent)
- {
- m_fac = 1;
- m_x = -1;
- }
-
- int x() const
- {
- return m_x;
- }
-
- void setX(int x)
- {
- if (x == m_x)
- return;
- m_x = x;
- emit xChanged();
- }
-
- int fac() const
- {
- return m_fac;
- }
-
- void setFac(int fac)
- {
- m_fac = fac;
- }
-
-Q_SIGNALS:
- void xChanged();
-
-private:
- int m_x;
- int m_fac;
-};
-
-class FactorialLoopTransition : public QtSignalTransition
-{
-public:
- FactorialLoopTransition(Factorial *fact)
- : QtSignalTransition(fact, SIGNAL(xChanged())), m_fact(fact)
- {}
-
- virtual bool eventTest(QEvent *) const
- {
- return m_fact->property("x").toInt() > 1;
- }
-
- virtual void onTransition()
- {
- int x = m_fact->property("x").toInt();
- int fac = m_fact->property("fac").toInt();
- m_fact->setProperty("fac", x * fac);
- m_fact->setProperty("x", x - 1);
- }
-
-private:
- Factorial *m_fact;
-};
-
-class FactorialDoneTransition : public QtSignalTransition
-{
-public:
- FactorialDoneTransition(Factorial *fact)
- : QtSignalTransition(fact, SIGNAL(xChanged())), m_fact(fact)
- {}
-
- virtual bool eventTest(QEvent *) const
- {
- return m_fact->property("x").toInt() <= 1;
- }
-
- virtual void onTransition()
- {
- fprintf(stdout, "%d\n", m_fact->property("fac").toInt());
- }
-
-private:
- Factorial *m_fact;
-};
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- Factorial factorial;
-
- QtStateMachine machine;
-
- QtState *computing = new QtState(machine.rootState());
- computing->addTransition(new FactorialLoopTransition(&factorial));
-
- QtFinalState *done = new QtFinalState(machine.rootState());
- FactorialDoneTransition *doneTransition = new FactorialDoneTransition(&factorial);
- doneTransition->setTargetState(done);
- computing->addTransition(doneTransition);
-
- QtState *initialize = new QtState(machine.rootState());
- initialize->assignProperty(&factorial, "x", 6);
- FactorialLoopTransition *enterLoopTransition = new FactorialLoopTransition(&factorial);
- enterLoopTransition->setTargetState(computing);
- initialize->addTransition(enterLoopTransition);
-
- QObject::connect(&machine, SIGNAL(finished()), &app, SLOT(quit()));
-
- machine.setInitialState(initialize);
- machine.start();
-
- return app.exec();
-}
-
-#include "main.moc"
diff --git a/lib/qtstatemachine/examples/helloworld/helloworld.pro b/lib/qtstatemachine/examples/helloworld/helloworld.pro
deleted file mode 100644
index 9b941c0..0000000
--- a/lib/qtstatemachine/examples/helloworld/helloworld.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = app
-TARGET =
-QT = core
-win32: CONFIG += console
-mac:CONFIG -= app_bundle
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/helloworld/main.cpp b/lib/qtstatemachine/examples/helloworld/main.cpp
deleted file mode 100644
index 3765338..0000000
--- a/lib/qtstatemachine/examples/helloworld/main.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#endif
-
-class S0 : public QtState
-{
-public:
- S0(QtState *parent = 0)
- : QtState(parent) {}
-
- virtual void onEntry()
- {
- fprintf(stdout, "Hello world!\n");
- }
-};
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- QtStateMachine machine;
- QtState *s0 = new S0();
- QtFinalState *s1 = new QtFinalState();
- s0->addTransition(s1);
-
- machine.addState(s0);
- machine.addState(s1);
- machine.setInitialState(s0);
-
- QObject::connect(&machine, SIGNAL(finished()), QCoreApplication::instance(), SLOT(quit()));
- machine.start();
-
- return app.exec();
-}
diff --git a/lib/qtstatemachine/examples/mediaplayer/main.cpp b/lib/qtstatemachine/examples/mediaplayer/main.cpp
deleted file mode 100644
index edac5f2..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/main.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "qscriptedstatemachine.h"
-#include "spview.h"
-#include "spmodel.h"
-#include "spengine.h"
-#include "spharvester.h"
-#include "math.h"
-#include "time.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-int main( int argc, char **argv)
-{
- QApplication app(argc, argv);
- QString dir;
- bool recurse;
- if (argc > 1) {
- dir = QString(argv[1]);
- if (argc > 2)
- {
- recurse = !strcmp(argv[2],"-recurse");
- }
- } else {
- printf("Usage: stateplayer directory [-recurse]");
- return 0;
- }
-
- app.setApplicationName("SCXML-mediaplayer");
-
- SPView* view = new SPView(NULL);
- QtScriptedStateMachine *sm = QtScriptedStateMachine::load(":/mediaplayer.scxml");
- QObject::connect (sm, SIGNAL(finished()), &app, SLOT(quit()));
- SPModel* model= new SPModel(NULL);
- view->setModel(model);
- model->setObjectName("model");
- SPEngine* engine = new SPEngine(sm);
- engine->setObjectName("engine");
- SPHarvester* harvester = new SPHarvester (view);
- QObject::connect (harvester, SIGNAL(foundTrack(SongData)), model, SLOT(addSong(SongData)));
- harvester->harvest(dir,recurse);
- view->setObjectName("view");
- sm->registerObject(model);
- sm->registerObject(engine);
- sm->registerObject(view,"",true);
- view->show ();
- sm->start ();
- return app.exec ();
-}
diff --git a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.pro b/lib/qtstatemachine/examples/mediaplayer/mediaplayer.pro
deleted file mode 100644
index 355da25..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-TEMPLATE = app
-TARGET = scxmlplayer
-QT += script \
- sql \
- phonon
-include($$PWD/../../src/qtstatemachine.pri)
-
-HEADERS += spmodel.h \
- spengine.h \
- spview.h \
- spharvester.h \
- songdata.h
-SOURCES += main.cpp \
- spmodel.cpp \
- spengine.cpp \
- spview.cpp \
- spharvester.cpp
-FORMS += mediaplayer.ui
-RESOURCES += mediaplayer.qrc
-win32:CONFIG += console
-mac:CONFIG -= app_bundle
-INCLUDEPATH += .
-DEPENDPATH += .
diff --git a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.qrc b/lib/qtstatemachine/examples/mediaplayer/mediaplayer.qrc
deleted file mode 100644
index ff8226f..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- mediaplayer.scxml
-
-
diff --git a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.scxml b/lib/qtstatemachine/examples/mediaplayer/mediaplayer.scxml
deleted file mode 100644
index 323d9c9..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.scxml
+++ /dev/null
@@ -1,240 +0,0 @@
-
-
-
-
- [[listView,'styleSheet','QListView {font-size:20px}']]
-
-
-
-
-
- [[stackedWidget,"currentIndex",0]]
-
-
-
-
-
-
- { "parent" : listView, "windowTitle" :
- "Music Player", "styleSheet" : "QMenu {font-size:24px; width: 505;height:1000;}" +
- "QMenu::item:hover {background-color: blue;color: black;}",
- "children": function() { var c = [
- {"type" : "action","id" : "artists", "text" : "Artists" },
- {"type" : "action", "id" : "albums", "text" : "Albums" },
- {"type" : "action", "id" : "genres", "text" : "Genres" },
- {"type" : "action", "id" : "allsongs", "text" : "All Songs" }];
- if (model.currentSongTitle != '')
- c[c.length] = {type: "action", id: "curplaying", text: model.currentSongTitle};
- return c; }()
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [
- [selectButton,"enabled",false],
- [playingLabel,"text",model.currentSongTitle],
- [midLabel,"text",model.currentSongArtist],
- [posSlider,"minimum",0],
- [posSlider,"maximum",engine.totalTime],
- [stackedWidget,"currentIndex",1]
- ]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[stopButton,"enabled",false]]
-
-
-
-
- [[stopButton,"enabled",true]]
-
-
-
-
-
-
- [[playButton,"text","Pause"]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[stopButton,"enabled",false],
- [playButton,"enabled",false],
- [prevButton,"enabled",false],
- [nextButton,"enabled",false]]
-
-
-
-
-
-
-
-
diff --git a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.ui b/lib/qtstatemachine/examples/mediaplayer/mediaplayer.ui
deleted file mode 100644
index dbbc6fd..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/mediaplayer.ui
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
- mediaPlayerWidget
-
-
-
- 0
- 0
- 394
- 287
-
-
-
- SCXML Media Player
-
-
-
-
-
- 0
-
-
-
-
-
-
-
-
-
-
-
-
- 0
- 50
- 291
- 61
-
-
-
- QLabel {font-size: 24px; color: #336699}
-
-
- TextLabel
-
-
-
-
-
- 0
- 120
- 291
- 21
-
-
-
- TextLabel
-
-
-
-
-
- 0
- 180
- 301
- 16
-
-
-
- 0
-
-
- Qt::Horizontal
-
-
-
-
-
-
-
-
-
-
-
- Home
-
-
-
-
-
-
- Play
-
-
-
-
-
-
- Prev
-
-
-
-
-
-
- Next
-
-
-
-
-
-
- Stop
-
-
-
-
-
-
- Qt::Vertical
-
-
-
-
-
-
- Select
-
-
-
-
-
-
- Back
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/qtstatemachine/examples/mediaplayer/songdata.h b/lib/qtstatemachine/examples/mediaplayer/songdata.h
deleted file mode 100644
index ad321d1..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/songdata.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef SONGDATA_H
-#define SONGDATA_H
-
-#include
-
-struct SongData
-{
- QString url;
- QString title;
- QString album;
- QString artist;
- QStringList genres;
- int trackNumber;
-};
-#endif
diff --git a/lib/qtstatemachine/examples/mediaplayer/spengine.cpp b/lib/qtstatemachine/examples/mediaplayer/spengine.cpp
deleted file mode 100644
index 092c5c9..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spengine.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "spengine.h"
-#include
-
-using namespace Phonon;
-
-class SPEnginePvt
-{
- public:
- MediaObject* mediaObject;
- AudioOutput* audioOutput;
-};
-void SPEngine::clearQueue()
-{
- pvt->mediaObject->clearQueue();
-}
-
-int SPEngine::currentTime() const
-{
- return pvt->mediaObject->currentTime ();
-}
-int SPEngine::totalTime() const
-{
- return pvt->mediaObject->totalTime();
-}
-
-void SPEngine::enqueue (const QUrl & u)
-{
- pvt->mediaObject->enqueue(MediaSource(u));
-}
-void SPEngine::setTrack(const QUrl & u)
-{
- pvt->mediaObject->setCurrentSource(MediaSource(u));
-}
-void SPEngine::play()
-{
- pvt->mediaObject->play ();
-}
-
-void SPEngine::pause()
-{
- pvt->mediaObject->pause ();
-}
-
-void SPEngine::stop()
-{
- pvt->mediaObject->stop();
-}
-
-void SPEngine::seek(qint64 pos)
-{
- pvt->mediaObject->seek(pos);
-}
-
-void SPEngine::setVolume(int v)
-{
- pvt->audioOutput->setVolume((qreal)v/100);
-}
-
-void SPEngine::onVolumeChanged(qreal r)
-{
- emit volumeChanged(r*100);
-}
-int SPEngine::volume() const
-{
- return pvt->audioOutput->volume()*100;
-}
-
-SPEngine::SPEngine(QObject* p) : QObject(p)
-{
- pvt = new SPEnginePvt;
- pvt->mediaObject = new Phonon::MediaObject(this);
- pvt->audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
- createPath (pvt->mediaObject, pvt->audioOutput);
- pvt->mediaObject->setTickInterval(500);
- connect (pvt->mediaObject, SIGNAL(aboutToFinish()), this, SIGNAL(aboutToFinish()));
- connect (pvt->mediaObject, SIGNAL(tick(qint64)), this, SIGNAL(tick(qint64)));
- connect (pvt->mediaObject, SIGNAL(totalTimeChanged(qint64)), this, SIGNAL(totalTimeChanged(qint64)));
- connect (pvt->audioOutput, SIGNAL(volumeChanged(qreal)), this, SLOT(onVolumeChanged(qreal)));
-}
-
-SPEngine::~SPEngine ()
-{
- delete pvt;
-}
diff --git a/lib/qtstatemachine/examples/mediaplayer/spengine.h b/lib/qtstatemachine/examples/mediaplayer/spengine.h
deleted file mode 100644
index 40db83f..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spengine.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef SPENGINE_H
-#define SPENGINE_H
-#include
-#include
-class SPEngine : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int totalTime READ totalTime)
- Q_PROPERTY(int currentTime READ currentTime)
- Q_PROPERTY(int volume READ volume WRITE setVolume)
-
- Q_SIGNALS:
- void aboutToFinish();
- void tick(qint64);
- void totalTimeChanged(qint64);
- void volumeChanged(int);
-
- public Q_SLOTS:
- void clearQueue();
- void enqueue (const QUrl &);
- void setTrack(const QUrl &);
- void play();
- void pause();
- void seek(qint64);
- void stop ();
-
- protected Q_SLOTS:
- void onVolumeChanged(qreal);
-
- public:
- SPEngine(QObject*);
- virtual ~SPEngine ();
- int currentTime () const;
- int totalTime () const;
- void setVolume(int);
- int volume () const;
-
- private:
- class SPEnginePvt* pvt;
-};
-#endif
diff --git a/lib/qtstatemachine/examples/mediaplayer/spharvester.cpp b/lib/qtstatemachine/examples/mediaplayer/spharvester.cpp
deleted file mode 100644
index f52e5ef..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spharvester.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "spharvester.h"
-#include
-#include
-#include
-#include
-#include
-
-using namespace Phonon;
-
-struct SPHarvesterPvt
-{
- MediaObject* mediaObject;
- QQueue pathQueue;
-};
-
-SPHarvester::SPHarvester(QObject* o) : QObject(o)
-{
- pvt = new SPHarvesterPvt;
- pvt->mediaObject = new MediaObject(this);
- connect (pvt->mediaObject, SIGNAL(metaDataChanged()), this, SLOT(readMetaData ()));
-}
-
-SPHarvester::~SPHarvester()
-{
- delete pvt;
-}
-
-void SPHarvester::harvest (const QString & directory, bool recurse)
-{
- QDir d (directory);
- QFileInfoList l = d.entryInfoList(QStringList() << "*.mp3",recurse ? QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Files : QDir::Files);
- foreach (QFileInfo fi, l) {
- if (fi.isDir()) {
- harvest (fi.absoluteFilePath(), recurse);
- } else {
- pvt->pathQueue.enqueue(fi.absoluteFilePath());
- }
- }
- harvestNext ();
-}
-
-void SPHarvester::harvestNext ()
-{
- if (pvt->pathQueue.empty())
- emit done();
- else {
- QString s = pvt->pathQueue.dequeue();
- pvt->mediaObject->setCurrentSource(MediaSource(s));
- }
-}
-
-void SPHarvester::readMetaData ()
-{
- QStringList albums = pvt->mediaObject->metaData("ALBUM");
- QStringList titles = pvt->mediaObject->metaData("TITLE");
- QStringList artists = pvt->mediaObject->metaData("ARTIST");
- QStringList trackNums = pvt->mediaObject->metaData("TRACKNUMBER");
- SongData sd;
- sd.url = pvt->mediaObject->currentSource().url().toString();
- sd.album = albums.count() ? albums[0] : "Unknown Album";
- sd.artist = artists.count() ? artists[0] : "Unknown Artist";
- sd.trackNumber = trackNums.count() ? trackNums[0].toInt() : 0;
- sd.genres = pvt->mediaObject->metaData("GENRE");
- sd.title = titles.count() ? titles[0] : QFileInfo(sd.url).baseName();
-
- emit foundTrack(sd);
- harvestNext ();
-}
diff --git a/lib/qtstatemachine/examples/mediaplayer/spharvester.h b/lib/qtstatemachine/examples/mediaplayer/spharvester.h
deleted file mode 100644
index a75d535..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spharvester.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef SPHARVESTER_H
-#define SPHARVESTER_H
-
-#include "songdata.h"
-class SPHarvester : public QObject
-{
- Q_OBJECT
-public:
- SPHarvester(QObject* o = NULL);
- virtual ~SPHarvester ();
-public slots:
- void harvest (const QString & directory, bool recurse = true);
-
-private slots:
- void harvestNext ();
- void readMetaData();
-signals:
- void foundTrack (const SongData & d);
- void done ();
-
-private:
- class SPHarvesterPvt* pvt;
-};
-
-#endif // _H
diff --git a/lib/qtstatemachine/examples/mediaplayer/spmodel.cpp b/lib/qtstatemachine/examples/mediaplayer/spmodel.cpp
deleted file mode 100644
index bdfd5ec..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spmodel.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "spmodel.h"
-#include
-#include
-#include
-#include
-// an SQL query model that always as column (0) as uid and column (1) as display
-class SPSqlQueryModel : public QSqlQueryModel
-{
- Q_OBJECT
- public:
- SPSqlQueryModel (QObject* o = NULL): QSqlQueryModel (o) {}
- virtual QVariant data(const QModelIndex & index, int role) const
- {
- QModelIndex idx(index);
- if (role == Qt::DisplayRole && query().record().count() > 1) {
- idx = idx.sibling(idx.row(),1);
- } else if (role == Qt::UserRole)
- role = Qt::DisplayRole;
- return QSqlQueryModel::data(idx,role);
- }
-};
-
-
-class SPModelPvt
-{
- public:
- SPSqlQueryModel
- artistModel,
- albumModel,
- songModel,
- playlistModel, genreModel;
-
- QSqlQuery artistQuery, albumQuery, songQuery, playlistQuery, genreQuery, playingQuery;
-
-};
-
-SPModel::SPModel(QObject* o)
- :QObject(o)
-{
- QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
- db.setDatabaseName("sqlite.db");
- if (!db.open()) {
- QMessageBox::critical(0, qApp->tr("Cannot open database"),
- qApp->tr("Unable to establish a database connection.\n"
- "This example needs SQLite support. Please read "
- "the Qt SQL driver documentation for information how "
- "to build it.\n\n"
- "Click Cancel to exit."), QMessageBox::Cancel);
- }
-
- db.exec("CREATE TABLE IF NOT EXISTS songs (song_url VARCHAR(1024) PRIMARY KEY, song_title VARCHAR(1024), song_artist VARCHAR(1024), song_album VARCHAR(1024), song_track_index SMALLINT)");
- db.exec("DROP TABLE genres");
- db.exec("CREATE TABLE IF NOT EXISTS genres (genre_title VARCHAR(64), genre_song_url VARCHAR(1024))");
-// db.exec("CREATE TABLE IF NOT EXISTS playlists (playlist_id VARACHAR(256) PRIMARY KEY, playlist_title VARCHAR(1024))");
-// db.exec("CREATE TABLE IF NOT EXISTS playlist_songs (playlist_song_id BIGINT PRIMARY KEY, playlist_song_playlist
-
- pvt = new SPModelPvt;
- pvt->artistQuery = QSqlQuery("SELECT DISTINCT song_artist FROM songs");
- pvt->albumQuery = QSqlQuery("SELECT DISTINCT song_album FROM songs");
- pvt->playlistQuery = QSqlQuery("SELECT playlist_url, playlist_title FROM playlists");
- pvt->songQuery = QSqlQuery("SELECT song_url, song_title from songs");
- pvt->genreQuery = QSqlQuery("SELECT DISTINCT genre_title from genres");
- QSqlQuery q;
-// q.exec("SELECT DISTINCT song_url,song_title FROM songs, genres WHERE genre_song_url=song_url AND genre_title='All'");
- q.exec("SELECT * from genres");
- while (q.next()) {
- qDebug () << q.value(0);
- }
-}
-
-void SPModel::addSong ( const SongData & data)
-{
-
- QSqlQuery q;
- q.prepare("SELECT count(*) FROM songs WHERE song_url=:url");
- q.bindValue(":url",data.url);
- bool inserting = true;
- if (q.exec()) {
- q.next();
- inserting = q.value(0).toInt() == 0;
- }
- if (inserting) {
- q.prepare ("INSERT INTO songs (song_url, song_title, song_artist, song_album, song_track_index) VALUES (:url, :title, :artist, :album, :track)");
- } else {
- q.prepare("UPDATE songs SET song_title=:title, song_album=:album, song_track_index=:track WHERE song_url=:url ");
- }
- q.bindValue(":url",data.url);
- q.bindValue(":title",data.title);
- q.bindValue(":artist",data.artist);
- q.bindValue(":album",data.album);
- q.bindValue(":track",data.trackNumber);
- q.exec();
-
- q.prepare ("DELETE FROM genres WHERE genre_song_url=:url");
- q.bindValue(":url",data.url);
- q.exec();
-
- q.prepare ("INSERT INTO genres (genre_song_url, genre_title) VALUES(:url, :genre)");
- q.bindValue(":url",data.url);
- QStringList gn = data.genres;
- gn << "All";
- foreach (QString g, gn) {
- q.bindValue(":genre",g);
- q.exec ();
- }
-
- if (inserting) {
- emit albumChanged(data.album);
- emit songListChanged();
- emit artistChanged(data.artist);
- foreach (QString g, data.genres) {
- emit genreChanged(g);
- }
- }
-
-
-}
-
-
-SPModel::~SPModel()
-{
- delete pvt;
-}
-
-int SPModel::albumCount() const
-{
- return pvt->albumModel.rowCount();
-}
-
-void SPModel::clearAlbumFilter ()
-{
- pvt->albumQuery = QSqlQuery ("SELECT DISTINCT song_album FROM songs ");
-}
-void SPModel::clearSongFilter ()
-{
- pvt->songQuery = QSqlQuery ("SELECT song_url, song_title FROM songs");
-}
-void SPModel::loadArtists ()
-{
- pvt->artistQuery.exec ();
- pvt->artistModel.setQuery(pvt->artistQuery);
-}
-void SPModel::filterAlbumsByArtist(const QString & artist)
-{
- pvt->albumQuery.prepare("SELECT DISTINCT song_album FROM songs WHERE song_artist=:artist");
- pvt->albumQuery.bindValue(":artist",artist);
-}
-void SPModel::filterSongsByAlbum(const QString & album)
-{
- pvt->albumQuery.prepare("SELECT song_url,song_title, song_track_index FROM songs WHERE song_album=:album ORDER BY song_track_index");
- pvt->albumQuery.bindValue(":album",album);
-}
-void SPModel::loadGenres ()
-{
- pvt->genreQuery.exec();
- pvt->genreModel.setQuery(pvt->genreQuery);
-}
-
-void SPModel::filterSongsByGenre(const QString & genre)
-{
- pvt->songQuery.prepare ("SELECT DISTINCT song_url,song_title FROM songs, genres WHERE genre_song_url=song_url AND genre_title=:genre");
- pvt->songQuery.bindValue(":genre",genre);
-}
-void SPModel::loadPlaylists()
-{
- pvt->playlistQuery.exec ();
- pvt->playlistModel.setQuery(pvt->playlistQuery);
-}
-void SPModel::loadAlbums()
-{
- pvt->albumQuery.exec ();
- pvt->albumModel.setQuery(pvt->albumQuery);
-}
-void SPModel::filterSongsByPlaylist(const QString & uid)
-{
- pvt->songQuery.prepare("SELECT DISTINCT song_url, song_title, playlist_song_index FROM playlist_songs INNER JOIN songs ON playlist_song_url=song_url WHERE playlist_id=:playlist ORDER BY playlist_song_index");
- pvt->songQuery.bindValue(":playlist",uid);
-}
-void SPModel::loadSongs ()
-{
- pvt->songQuery.exec ();
- pvt->songModel.setQuery(pvt->songQuery);
-}
-QUrl SPModel::currentSong()
-{
- if (pvt->playingQuery.isValid())
- return QUrl(pvt->playingQuery.value(0).toString());
- else
- return QUrl();
-}
-QString SPModel::currentSongTitle()
-{
- if (pvt->playingQuery.isValid())
- return pvt->playingQuery.value(1).toString();
- else
- return QString();
-}
-QString SPModel::currentSongArtist()
-{
- QSqlQuery q;
- q.prepare("SELECT song_artist FROM songs WHERE song_url=:url");
- q.bindValue(":url",currentSong().toString());
- q.exec();
- q.next();
- return q.value(0).toString();
-}
-QString SPModel::currentSongAlbum()
-{
- QSqlQuery q;
- q.prepare("SELECT song_album FROM songs WHERE song_url=:url");
- q.bindValue(":url",currentSong().toString());
- q.exec();
- q.next();
- return q.value(0).toString();
-}
-
-void SPModel::selectSong (const QString & s)
-{
- pvt->playingQuery = QSqlQuery(pvt->songQuery.executedQuery ());
-
- while (pvt->playingQuery.next()) {
- if (pvt->playingQuery.value(0).toString() == s) {
- emit songChanged ();
- return;
- }
- }
- emit endOfList ();
-}
-
-void SPModel::reset ()
-{
- pvt->playingQuery = QSqlQuery(pvt->songQuery.executedQuery ());
- pvt->playingQuery.exec();
-}
-
-void SPModel::gotoNext()
-{
- if (pvt->playingQuery.next()) {
- emit songChanged ();
- }else
- emit endOfList ();
-}
-void SPModel::gotoPrev()
-{
- if (pvt->playingQuery.previous())
- emit songChanged ();
- else
- emit endOfList ();
-}
-
-
-
-QAbstractItemModel* SPModel::albumsItemModel() const
-{
- return &pvt->albumModel;
-}
-QAbstractItemModel* SPModel::genresItemModel() const
-{
- return &pvt->genreModel;
-}
-QAbstractItemModel* SPModel::songsItemModel() const
-{
- return &pvt->songModel;
-}
-QAbstractItemModel* SPModel::playlistsItemModel() const
-{
- return &pvt->playlistModel;
-}
-QAbstractItemModel* SPModel::artistsItemModel() const
-{
- return &pvt->artistModel;
-}
-
-#include
diff --git a/lib/qtstatemachine/examples/mediaplayer/spmodel.h b/lib/qtstatemachine/examples/mediaplayer/spmodel.h
deleted file mode 100644
index 83035b1..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spmodel.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef SPMODEL_H
-#define SPMODEL_H
-#include
-#include
-#include
-#include "songdata.h"
-
-class SPModel : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(QUrl currentSong READ currentSong)
- Q_PROPERTY(QString currentSongTitle READ currentSongTitle)
- Q_PROPERTY(QString currentSongArtist READ currentSongArtist)
- Q_PROPERTY(QString currentSongAlbum READ currentSongAlbum)
- Q_PROPERTY(int albumCount READ albumCount)
-
-
- public slots:
- void clearAlbumFilter ();
- void clearSongFilter ();
- void loadArtists ();
- void filterAlbumsByArtist(const QString & name);
- void loadGenres ();
- void filterSongsByGenre(const QString & genre);
- void loadPlaylists();
- void loadAlbums();
- void filterSongsByPlaylist(const QString & uid);
- void filterSongsByAlbum(const QString & name);
- void loadSongs ();
- void selectSong (const QString &);
- void gotoNext();
- void gotoPrev();
- void addSong (const SongData &);
- void reset ();
-
- signals:
- void albumChanged(const QString &);
- void artistChanged(const QString &);
- void genreChanged(const QString &);
- void songListChanged();
- void songChanged ();
- void endOfList ();
-
- public:
- SPModel(QObject*);
- virtual ~SPModel ();
-
- QUrl currentSong();
- QString currentSongTitle ();
- QString currentSongArtist();
- QString currentSongAlbum();
- QAbstractItemModel* albumsItemModel() const;
- QAbstractItemModel* genresItemModel() const;
- QAbstractItemModel* songsItemModel() const;
- QAbstractItemModel* playlistsItemModel() const;
- QAbstractItemModel* artistsItemModel() const;
- int albumCount() const;
-
- private:
- class SPModelPvt* pvt;
-};
-
-#endif
diff --git a/lib/qtstatemachine/examples/mediaplayer/spview.cpp b/lib/qtstatemachine/examples/mediaplayer/spview.cpp
deleted file mode 100644
index 415d31d..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spview.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "spview.h"
-#include "spmodel.h"
-#include
-#include
-
-class SPViewPvt
-{
- public:
- SPModel* model;
-};
-
-
-class SPItemDelegate : public QItemDelegate
-{
- Q_OBJECT
-
-public:
- SPItemDelegate(QObject* o) : QItemDelegate(o) {}
-
- virtual void paint (QPainter* p, QStyleOptionViewItem & option, const QModelIndex & index) const
- {
- QString disp = index.data(Qt::DisplayRole).toString();
- drawBackground(p,option,index);
- drawDisplay(p,option,option.rect,disp);
- }
-};
-
-void SPView::setModel (SPModel* m)
-{
- pvt->model = m;
-}
-
-void SPView::showAlbums ()
-{
- listView->setModel (pvt->model->albumsItemModel());
-}
-
-void SPView::showArtists ()
-{
- listView->setModel (pvt->model->artistsItemModel());
-}
-
-void SPView::showGenres ()
-{
- QAbstractItemModel* model = pvt->model->genresItemModel();
- listView->setModel (model);
-}
-
-void SPView::showSongs ()
-{
- listView->setModel (pvt->model->songsItemModel());
-}
-
-void SPView::showPlaylists()
-{
- listView->setModel (pvt->model->playlistsItemModel());
-}
-
-
-SPView::SPView(QWidget* w) : QWidget (w)
-{
- pvt = new SPViewPvt;
- setupUi(this);
- listView->setItemDelegate(new SPItemDelegate(this));
-}
-
-QString SPView::currentItem() const
-{
- QVariant v = listView->model()->data(listView->currentIndex(),Qt::UserRole);
- if (v.isNull())
- v = listView->currentIndex().data(Qt::DisplayRole);
- return v.toString ();
-}
-
-int SPView::itemCount () const
-{
- return listView->model()->rowCount ();
-}
-int SPView::currentIndex() const
-{
- return listView->currentIndex().row();
-}
-
-void SPView::setTotalTime (int t)
-{
- posSlider->setMaximum(t);
-}
-void SPView::setCurrentTime (int t)
-{
- posSlider->setValue (t);
-}
-
-SPView::~SPView ()
-{
- delete pvt;
-}
-#include "spview.moc"
diff --git a/lib/qtstatemachine/examples/mediaplayer/spview.h b/lib/qtstatemachine/examples/mediaplayer/spview.h
deleted file mode 100644
index 53bc298..0000000
--- a/lib/qtstatemachine/examples/mediaplayer/spview.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef SPVIEW_H
-#define SPVIEW_H
-#include
-#include
-#include "spmodel.h"
-#include "ui_mediaplayer.h"
-
-class SPView : public QWidget, public virtual Ui::mediaPlayerWidget
-{
- Q_OBJECT
- Q_PROPERTY(QString currentItem READ currentItem)
- Q_PROPERTY(int itemCount READ itemCount)
- Q_PROPERTY(int currentIndex READ currentIndex)
- public slots:
- void setModel (SPModel*);
- void showAlbums ();
- void showArtists ();
- void showGenres ();
- void showSongs ();
- void showPlaylists();
- void setTotalTime (int);
- void setCurrentTime (int);
-
-
- public:
- SPView(QWidget*);
- virtual ~SPView ();
- QString currentItem () const;
- int itemCount () const;
- int currentIndex() const;
-
- private:
- class SPViewPvt* pvt;
-};
-
-#endif
diff --git a/lib/qtstatemachine/examples/pauseandresume/main.cpp b/lib/qtstatemachine/examples/pauseandresume/main.cpp
deleted file mode 100644
index f75a93c..0000000
--- a/lib/qtstatemachine/examples/pauseandresume/main.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#include
-#endif
-
-class Window : public QWidget
-{
-public:
- Window(QWidget *parent = 0)
- : QWidget(parent)
- {
- QPushButton *pb = new QPushButton("Go");
- QPushButton *pauseButton = new QPushButton("Pause");
- QPushButton *quitButton = new QPushButton("Quit");
- QVBoxLayout *vbox = new QVBoxLayout(this);
- vbox->addWidget(pb);
- vbox->addWidget(pauseButton);
- vbox->addWidget(quitButton);
-
- QtStateMachine *machine = new QtStateMachine(this);
-
- QtState *process = new QtState(machine->rootState());
- process->setObjectName("process");
-
- QtState *s1 = new QtState(process);
- s1->setObjectName("s1");
- QtState *s2 = new QtState(process);
- s2->setObjectName("s2");
- s1->addTransition(pb, SIGNAL(clicked()), s2);
- s2->addTransition(pb, SIGNAL(clicked()), s1);
-
- QtHistoryState *h = process->addHistoryState();
- h->setDefaultState(s1);
-
- QtState *interrupted = new QtState(machine->rootState());
- interrupted->setObjectName("interrupted");
- QtFinalState *terminated = new QtFinalState(machine->rootState());
- terminated->setObjectName("terminated");
- interrupted->addTransition(pauseButton, SIGNAL(clicked()), h);
- interrupted->addTransition(quitButton, SIGNAL(clicked()), terminated);
-
- process->addTransition(pauseButton, SIGNAL(clicked()), interrupted);
- process->addTransition(quitButton, SIGNAL(clicked()), terminated);
-
- process->setInitialState(s1);
- machine->setInitialState(process);
- QObject::connect(machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit()));
- machine->start();
- }
-};
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
- Window win;
- win.show();
- return app.exec();
-}
diff --git a/lib/qtstatemachine/examples/pauseandresume/pauseandresume.pro b/lib/qtstatemachine/examples/pauseandresume/pauseandresume.pro
deleted file mode 100644
index c5d5a5f..0000000
--- a/lib/qtstatemachine/examples/pauseandresume/pauseandresume.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/pingpong/main.cpp b/lib/qtstatemachine/examples/pingpong/main.cpp
deleted file mode 100644
index 82cd172..0000000
--- a/lib/qtstatemachine/examples/pingpong/main.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#endif
-
-class PingEvent : public QEvent
-{
-public:
- PingEvent() : QEvent(QEvent::Type(QEvent::User+2))
- {}
-};
-
-class PongEvent : public QEvent
-{
-public:
- PongEvent() : QEvent(QEvent::Type(QEvent::User+3))
- {}
-};
-
-class Pinger : public QtState
-{
-public:
- Pinger(QtStateMachine *machine, QtState *parent)
- : QtState(parent), m_machine(machine) {}
-
-protected:
- virtual void onEntry()
- {
- m_machine->postEvent(new PingEvent());
- fprintf(stdout, "ping?\n");
- }
-
-private:
- QtStateMachine *m_machine;
-};
-
-class PongTransition : public QtAbstractTransition
-{
-public:
- PongTransition(QtStateMachine *machine)
- : QtAbstractTransition(), m_machine(machine) {}
-
-protected:
- virtual bool eventTest(QEvent *e) const {
- return (e->type() == QEvent::User+3);
- }
- virtual void onTransition()
- {
- m_machine->postEvent(new PingEvent(), 500);
- fprintf(stdout, "ping?\n");
- }
-
-private:
- QtStateMachine *m_machine;
-};
-
-class PingTransition : public QtAbstractTransition
-{
-public:
- PingTransition(QtStateMachine *machine)
- : QtAbstractTransition(), m_machine(machine) {}
-
-protected:
- virtual bool eventTest(QEvent *e) const {
- return (e->type() == QEvent::User+2);
- }
- virtual void onTransition()
- {
- m_machine->postEvent(new PongEvent(), 500);
- fprintf(stdout, "pong!\n");
- }
-
-private:
- QtStateMachine *m_machine;
-};
-
-int main(int argc, char **argv)
-{
- QCoreApplication app(argc, argv);
-
- QtStateMachine machine;
- QtState *group = new QtState(QtState::ParallelGroup);
- group->setObjectName("group");
-
- Pinger *pinger = new Pinger(&machine, group);
- pinger->setObjectName("pinger");
- pinger->addTransition(new PongTransition(&machine));
-
- QtState *ponger = new QtState(group);
- ponger->setObjectName("ponger");
- ponger->addTransition(new PingTransition(&machine));
-
- machine.addState(group);
- machine.setInitialState(group);
- machine.start();
-
- return app.exec();
-}
diff --git a/lib/qtstatemachine/examples/pingpong/pingpong.pro b/lib/qtstatemachine/examples/pingpong/pingpong.pro
deleted file mode 100644
index 6d5f8aa..0000000
--- a/lib/qtstatemachine/examples/pingpong/pingpong.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-QT = core
-TEMPLATE = app
-TARGET =
-win32: CONFIG += console
-mac:CONFIG -= app_bundle
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/trafficlight/main.cpp b/lib/qtstatemachine/examples/trafficlight/main.cpp
deleted file mode 100644
index 7749854..0000000
--- a/lib/qtstatemachine/examples/trafficlight/main.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#include
-#endif
-
-//! [0]
-class LightWidget : public QWidget
-{
- Q_OBJECT
- Q_PROPERTY(bool on READ isOn WRITE setOn)
-public:
- LightWidget(const QColor &color, QWidget *parent = 0)
- : QWidget(parent), m_color(color), m_on(false) {}
-
- bool isOn() const
- { return m_on; }
- void setOn(bool on)
- {
- if (on == m_on)
- return;
- m_on = on;
- update();
- }
-
-public slots:
- void turnOff() { setOn(false); }
- void turnOn() { setOn(true); }
-
-protected:
- virtual void paintEvent(QPaintEvent *)
- {
- if (!m_on)
- return;
- QPainter painter(this);
- painter.setRenderHint(QPainter::Antialiasing);
- painter.setBrush(m_color);
- painter.drawEllipse(0, 0, width(), height());
- }
-
-private:
- QColor m_color;
- bool m_on;
-};
-//! [0]
-
-//! [1]
-class LightState : public QtState
-{
-public:
- LightState(LightWidget *light, int duration, QtState *parent = 0)
- : QtState(parent)
- {
- QTimer *timer = new QTimer(this);
- timer->setInterval(duration);
- timer->setSingleShot(true);
- QtState *timing = new QtState(this);
- timing->invokeMethodOnEntry(light, "turnOn");
- timing->invokeMethodOnEntry(timer, "start");
- timing->invokeMethodOnExit(light, "turnOff");
- QtFinalState *done = new QtFinalState(this);
- timing->addTransition(timer, SIGNAL(timeout()), done);
- setInitialState(timing);
- }
-};
-//! [1]
-
-//! [2]
-class TrafficLightWidget : public QWidget
-{
-public:
- TrafficLightWidget(QWidget *parent = 0)
- : QWidget(parent)
- {
- QVBoxLayout *vbox = new QVBoxLayout(this);
- m_red = new LightWidget(Qt::red);
- vbox->addWidget(m_red);
- m_yellow = new LightWidget(Qt::yellow);
- vbox->addWidget(m_yellow);
- m_green = new LightWidget(Qt::green);
- vbox->addWidget(m_green);
- QPalette pal = palette();
- pal.setColor(QPalette::Background, Qt::black);
- setPalette(pal);
- setAutoFillBackground(true);
- }
-
- LightWidget *redLight() const
- { return m_red; }
- LightWidget *yellowLight() const
- { return m_yellow; }
- LightWidget *greenLight() const
- { return m_green; }
-
-private:
- LightWidget *m_red;
- LightWidget *m_yellow;
- LightWidget *m_green;
-};
-//! [2]
-
-//! [3]
-class TrafficLight : public QWidget
-{
-public:
- TrafficLight(QWidget *parent = 0)
- : QWidget(parent)
- {
- QVBoxLayout *vbox = new QVBoxLayout(this);
- TrafficLightWidget *widget = new TrafficLightWidget();
- vbox->addWidget(widget);
-
- QtStateMachine *machine = new QtStateMachine(this);
- LightState *redGoingYellow = new LightState(widget->redLight(), 3000);
- redGoingYellow->setObjectName("redGoingYellow");
- LightState *yellowGoingGreen = new LightState(widget->yellowLight(), 1000);
- yellowGoingGreen->setObjectName("yellowGoingGreen");
- redGoingYellow->addFinishedTransition(yellowGoingGreen);
- LightState *greenGoingYellow = new LightState(widget->greenLight(), 3000);
- greenGoingYellow->setObjectName("greenGoingYellow");
- yellowGoingGreen->addFinishedTransition(greenGoingYellow);
- LightState *yellowGoingRed = new LightState(widget->yellowLight(), 1000);
- yellowGoingRed->setObjectName("yellowGoingRed");
- greenGoingYellow->addFinishedTransition(yellowGoingRed);
- yellowGoingRed->addFinishedTransition(redGoingYellow);
-
- machine->addState(redGoingYellow);
- machine->addState(yellowGoingGreen);
- machine->addState(greenGoingYellow);
- machine->addState(yellowGoingRed);
- machine->setInitialState(redGoingYellow);
- machine->start();
- }
-};
-//! [3]
-
-//! [4]
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- TrafficLight widget;
- widget.resize(120, 300);
- widget.show();
-
- return app.exec();
-}
-//! [4]
-
-#include "main.moc"
diff --git a/lib/qtstatemachine/examples/trafficlight/trafficlight.pro b/lib/qtstatemachine/examples/trafficlight/trafficlight.pro
deleted file mode 100644
index a60bd22..0000000
--- a/lib/qtstatemachine/examples/trafficlight/trafficlight.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-SOURCES += main.cpp
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/statemachine/trafficlight
-sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS trafficlight.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/statemachine/trafficlight
-INSTALLS += target sources
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/examples/twowaybutton/main.cpp b/lib/qtstatemachine/examples/twowaybutton/main.cpp
deleted file mode 100644
index 23f19c3..0000000
--- a/lib/qtstatemachine/examples/twowaybutton/main.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include
-#ifdef QT_STATEMACHINE_SOLUTION
-#include
-#include
-#endif
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- QPushButton button;
-
- QtStateMachine machine;
- QtState *first = new QtState();
- first->setObjectName("first");
-
- QtState *off = new QtState();
- off->assignProperty(&button, "text", "Off");
- off->setObjectName("off");
- first->addTransition(off);
-
- QtState *on = new QtState();
- on->setObjectName("on");
- on->assignProperty(&button, "text", "On");
- off->addTransition(&button, SIGNAL(clicked()), on);
- on->addTransition(&button, SIGNAL(clicked()), off);
-
- machine.addState(first);
- machine.addState(off);
- machine.addState(on);
- machine.setInitialState(first);
- machine.start();
-
- button.resize(100, 50);
- button.show();
- return app.exec();
-}
diff --git a/lib/qtstatemachine/examples/twowaybutton/twowaybutton.pro b/lib/qtstatemachine/examples/twowaybutton/twowaybutton.pro
deleted file mode 100644
index c5d5a5f..0000000
--- a/lib/qtstatemachine/examples/twowaybutton/twowaybutton.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += .
-
-# Input
-SOURCES += main.cpp
-include(../../src/qtstatemachine.pri)
diff --git a/lib/qtstatemachine/lib/QtSolutions_StateMachineFramework-1.1.lib b/lib/qtstatemachine/lib/QtSolutions_StateMachineFramework-1.1.lib
deleted file mode 100644
index a0d744e..0000000
Binary files a/lib/qtstatemachine/lib/QtSolutions_StateMachineFramework-1.1.lib and /dev/null differ
diff --git a/lib/qtstatemachine/lib/QtSolutions_StateMachineFramework-1.1d.lib b/lib/qtstatemachine/lib/QtSolutions_StateMachineFramework-1.1d.lib
deleted file mode 100644
index 670cb75..0000000
Binary files a/lib/qtstatemachine/lib/QtSolutions_StateMachineFramework-1.1d.lib and /dev/null differ
diff --git a/lib/qtstatemachine/qtstatemachine.pro b/lib/qtstatemachine/qtstatemachine.pro
deleted file mode 100644
index c16c339..0000000
--- a/lib/qtstatemachine/qtstatemachine.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE=subdirs
-CONFIG += ordered
-include(common.pri)
-qtstatemachine-uselib: SUBDIRS=buildlib
-SUBDIRS+=examples
\ No newline at end of file
diff --git a/lib/qtstatemachine/src/QtAbstractState b/lib/qtstatemachine/src/QtAbstractState
deleted file mode 100644
index 547fdec..0000000
--- a/lib/qtstatemachine/src/QtAbstractState
+++ /dev/null
@@ -1 +0,0 @@
-#include "qabstractstate.h"
diff --git a/lib/qtstatemachine/src/QtAbstractTransition b/lib/qtstatemachine/src/QtAbstractTransition
deleted file mode 100644
index 63635d6..0000000
--- a/lib/qtstatemachine/src/QtAbstractTransition
+++ /dev/null
@@ -1 +0,0 @@
-#include "qabstracttransition.h"
diff --git a/lib/qtstatemachine/src/QtActionState b/lib/qtstatemachine/src/QtActionState
deleted file mode 100644
index 7d97612..0000000
--- a/lib/qtstatemachine/src/QtActionState
+++ /dev/null
@@ -1 +0,0 @@
-#include "qactionstate.h"
diff --git a/lib/qtstatemachine/src/QtEventTransition b/lib/qtstatemachine/src/QtEventTransition
deleted file mode 100644
index df9701d..0000000
--- a/lib/qtstatemachine/src/QtEventTransition
+++ /dev/null
@@ -1 +0,0 @@
-#include "qeventtransition.h"
diff --git a/lib/qtstatemachine/src/QtFinalState b/lib/qtstatemachine/src/QtFinalState
deleted file mode 100644
index ed5cae2..0000000
--- a/lib/qtstatemachine/src/QtFinalState
+++ /dev/null
@@ -1 +0,0 @@
-#include "qfinalstate.h"
diff --git a/lib/qtstatemachine/src/QtHistoryState b/lib/qtstatemachine/src/QtHistoryState
deleted file mode 100644
index a8b4d85..0000000
--- a/lib/qtstatemachine/src/QtHistoryState
+++ /dev/null
@@ -1 +0,0 @@
-#include "qhistorystate.h"
diff --git a/lib/qtstatemachine/src/QtScriptedEvent b/lib/qtstatemachine/src/QtScriptedEvent
deleted file mode 100644
index 499c608..0000000
--- a/lib/qtstatemachine/src/QtScriptedEvent
+++ /dev/null
@@ -1 +0,0 @@
-#include "qscriptedstatemachine.h"
diff --git a/lib/qtstatemachine/src/QtScriptedStateMachine b/lib/qtstatemachine/src/QtScriptedStateMachine
deleted file mode 100644
index 499c608..0000000
--- a/lib/qtstatemachine/src/QtScriptedStateMachine
+++ /dev/null
@@ -1 +0,0 @@
-#include "qscriptedstatemachine.h"
diff --git a/lib/qtstatemachine/src/QtScriptedTransition b/lib/qtstatemachine/src/QtScriptedTransition
deleted file mode 100644
index 499c608..0000000
--- a/lib/qtstatemachine/src/QtScriptedTransition
+++ /dev/null
@@ -1 +0,0 @@
-#include "qscriptedstatemachine.h"
diff --git a/lib/qtstatemachine/src/QtSignalEvent b/lib/qtstatemachine/src/QtSignalEvent
deleted file mode 100644
index c6a13c3..0000000
--- a/lib/qtstatemachine/src/QtSignalEvent
+++ /dev/null
@@ -1 +0,0 @@
-#include "qsignalevent.h"
diff --git a/lib/qtstatemachine/src/QtSignalTransition b/lib/qtstatemachine/src/QtSignalTransition
deleted file mode 100644
index 314d6a2..0000000
--- a/lib/qtstatemachine/src/QtSignalTransition
+++ /dev/null
@@ -1 +0,0 @@
-#include "qsignaltransition.h"
diff --git a/lib/qtstatemachine/src/QtSsmAutoInvokerFactory b/lib/qtstatemachine/src/QtSsmAutoInvokerFactory
deleted file mode 100644
index 499c608..0000000
--- a/lib/qtstatemachine/src/QtSsmAutoInvokerFactory
+++ /dev/null
@@ -1 +0,0 @@
-#include "qscriptedstatemachine.h"
diff --git a/lib/qtstatemachine/src/QtSsmInvoker b/lib/qtstatemachine/src/QtSsmInvoker
deleted file mode 100644
index 499c608..0000000
--- a/lib/qtstatemachine/src/QtSsmInvoker
+++ /dev/null
@@ -1 +0,0 @@
-#include "qscriptedstatemachine.h"
diff --git a/lib/qtstatemachine/src/QtState b/lib/qtstatemachine/src/QtState
deleted file mode 100644
index 79e85e6..0000000
--- a/lib/qtstatemachine/src/QtState
+++ /dev/null
@@ -1 +0,0 @@
-#include "qstate.h"
diff --git a/lib/qtstatemachine/src/QtStateAction b/lib/qtstatemachine/src/QtStateAction
deleted file mode 100644
index 1236ac4..0000000
--- a/lib/qtstatemachine/src/QtStateAction
+++ /dev/null
@@ -1 +0,0 @@
-#include "qstateaction.h"
diff --git a/lib/qtstatemachine/src/QtStateFinishedEvent b/lib/qtstatemachine/src/QtStateFinishedEvent
deleted file mode 100644
index 8e0e154..0000000
--- a/lib/qtstatemachine/src/QtStateFinishedEvent
+++ /dev/null
@@ -1 +0,0 @@
-#include "qstatefinishedevent.h"
diff --git a/lib/qtstatemachine/src/QtStateFinishedTransition b/lib/qtstatemachine/src/QtStateFinishedTransition
deleted file mode 100644
index 734b842..0000000
--- a/lib/qtstatemachine/src/QtStateFinishedTransition
+++ /dev/null
@@ -1 +0,0 @@
-#include "qstatefinishedtransition.h"
diff --git a/lib/qtstatemachine/src/QtStateInvokeMethodAction b/lib/qtstatemachine/src/QtStateInvokeMethodAction
deleted file mode 100644
index 1236ac4..0000000
--- a/lib/qtstatemachine/src/QtStateInvokeMethodAction
+++ /dev/null
@@ -1 +0,0 @@
-#include "qstateaction.h"
diff --git a/lib/qtstatemachine/src/QtStateMachine b/lib/qtstatemachine/src/QtStateMachine
deleted file mode 100644
index e749184..0000000
--- a/lib/qtstatemachine/src/QtStateMachine
+++ /dev/null
@@ -1 +0,0 @@
-#include "qstatemachine.h"
diff --git a/lib/qtstatemachine/src/QtTransition b/lib/qtstatemachine/src/QtTransition
deleted file mode 100644
index aae48c9..0000000
--- a/lib/qtstatemachine/src/QtTransition
+++ /dev/null
@@ -1 +0,0 @@
-#include "qtransition.h"
diff --git a/lib/qtstatemachine/src/qabstractstate.cpp b/lib/qtstatemachine/src/qabstractstate.cpp
deleted file mode 100644
index 6e9ec8a..0000000
--- a/lib/qtstatemachine/src/qabstractstate.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "qabstractstate.h"
-#include "qabstractstate_p.h"
-#include "qstatemachine.h"
-#include "qstatemachine_p.h"
-#include "qstate.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QtAbstractState
-
- \brief The QtAbstractState class is the base class of states of a QtStateMachine.
-
- \since 4.6
- \ingroup statemachine
-
- The QtAbstractState class is the abstract base class of states that are part
- of a QtStateMachine. It defines the interface that all state objects have in
- common. QtAbstractState is part of \l{The State Machine Framework}.
-
- The assignProperty() function is used for defining property assignments that
- should be performed when a state is entered.
-
- The parentState() function returns the state's parent state.
-
- \section1 Subclassing
-
- The onEntry() function is called when the state is entered; reimplement this
- function to perform custom processing when the state is entered.
-
- The onExit() function is called when the state is exited; reimplement this
- function to perform custom processing when the state is exited.
-*/
-
-/*!
- \enum QtAbstractState::RestorePolicy
-
- This enum specifies the restore policy type for a state. The restore policy
- takes effect when the machine enters a state which sets one or more
- properties. If the restore policy of the state is set to RestoreProperties,
- the state machine will save the original value of the property before the
- new value is set.
-
- Later, when the machine either enters a state which has its restore policy
- set to DoNotRestoreProperties or when it enters a state which does not set
- a value for the given property, the property will automatically be restored
- to its initial value.
-
- Only one initial value will be saved for any given property. If a value for a property has
- already been saved by the state machine, it will not be overwritten until the property has been
- successfully restored. Once the property has been restored, the state machine will clear the
- initial value until it enters a new state which sets the property and which has RestoreProperties
- as its restore policy.
-
- \value GlobalRestorePolicy The restore policy for the state should be retrieved using
- QtStateMachine::globalRestorePolicy()
- \value DoNotRestoreProperties The state machine should not save the initial values of properties
- set in the state and restore them later.
- \value RestoreProperties The state machine should save the initial values of properties
- set in the state and restore them later.
-
-
- \sa setRestorePolicy(), restorePolicy(), QtAbstractState::assignProperty()
-*/
-
-/*!
- \property QtAbstractState::restorePolicy
-
- \brief the restore policy of this state
-*/
-
-QtAbstractStatePrivate::QtAbstractStatePrivate()
- : restorePolicy(QtAbstractState::GlobalRestorePolicy)
-{
-}
-
-QtAbstractStatePrivate *QtAbstractStatePrivate::get(QtAbstractState *q)
-{
- return q->d_func();
-}
-
-const QtAbstractStatePrivate *QtAbstractStatePrivate::get(const QtAbstractState *q)
-{
- return q->d_func();
-}
-
-QtStateMachine *QtAbstractStatePrivate::machine() const
-{
- Q_Q(const QtAbstractState);
- QObject *par = q->parent();
- while (par != 0) {
- if (QtStateMachine *mach = qobject_cast(par))
- return mach;
- par = par->parent();
- }
- return 0;
-}
-
-void QtAbstractStatePrivate::callOnEntry()
-{
- Q_Q(QtAbstractState);
- q->onEntry();
-}
-
-void QtAbstractStatePrivate::callOnExit()
-{
- Q_Q(QtAbstractState);
- q->onExit();
-}
-
-/*!
- Constructs a new state with the given \a parent state.
-*/
-QtAbstractState::QtAbstractState(QtState *parent)
- : QObject(
-#ifndef QT_STATEMACHINE_SOLUTION
- *new QtAbstractStatePrivate,
-#endif
- parent)
-#ifdef QT_STATEMACHINE_SOLUTION
- , d_ptr(new QtAbstractStatePrivate)
-#endif
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- d_ptr->q_ptr = this;
-#endif
-}
-
-/*!
- \internal
-*/
-QtAbstractState::QtAbstractState(QtAbstractStatePrivate &dd, QtState *parent)
- : QObject(
-#ifndef QT_STATEMACHINE_SOLUTION
- dd,
-#endif
- parent)
-#ifdef QT_STATEMACHINE_SOLUTION
- , d_ptr(&dd)
-#endif
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- d_ptr->q_ptr = this;
-#endif
-}
-
-/*!
- Destroys this state.
-*/
-QtAbstractState::~QtAbstractState()
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- delete d_ptr;
-#endif
-}
-
-/*!
- Returns this state's parent state, or 0 if the state has no parent state.
-*/
-QtState *QtAbstractState::parentState() const
-{
- return qobject_cast(parent());
-}
-
-/*!
- Instructs this state to set the property with the given \a name of the given
- \a object to the given \a value when the state is entered.
-*/
-void QtAbstractState::assignProperty(QObject *object, const char *name,
- const QVariant &value)
-{
- Q_D(QtAbstractState);
- for (int i = 0; i < d->propertyAssignments.size(); ++i) {
- QPropertyAssignment &assn = d->propertyAssignments[i];
- if ((assn.object == object) && (assn.propertyName == name)) {
- assn.value = value;
- return;
- }
- }
- d->propertyAssignments.append(QPropertyAssignment(object, name, value));
-}
-
-/*!
- Sets the restore policy of this state to \a restorePolicy.
-
- The default restore policy is QtAbstractState::GlobalRestorePolicy.
-*/
-void QtAbstractState::setRestorePolicy(RestorePolicy restorePolicy)
-{
- Q_D(QtAbstractState);
- d->restorePolicy = restorePolicy;
-}
-
-/*!
- Returns the restore policy for this state.
-*/
-QtAbstractState::RestorePolicy QtAbstractState::restorePolicy() const
-{
- Q_D(const QtAbstractState);
- return d->restorePolicy;
-}
-
-/*!
- \fn QtAbstractState::onExit()
-
- This function is called when the state is exited. Reimplement this function
- to perform custom processing when the state is exited.
-*/
-
-/*!
- \fn QtAbstractState::onEntry()
-
- This function is called when the state is entered. Reimplement this function
- to perform custom processing when the state is entered.
-*/
-
-/*!
- \reimp
-*/
-bool QtAbstractState::event(QEvent *e)
-{
- return QObject::event(e);
-}
-
-QT_END_NAMESPACE
diff --git a/lib/qtstatemachine/src/qabstractstate.h b/lib/qtstatemachine/src/qabstractstate.h
deleted file mode 100644
index dfc93e3..0000000
--- a/lib/qtstatemachine/src/qabstractstate.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QABSTRACTSTATE_H
-#define QABSTRACTSTATE_H
-
-#include "qtstatemachineglobal.h"
-#include
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-class QtState;
-
-class QtAbstractStatePrivate;
-class Q_STATEMACHINE_CORE_EXPORT QtAbstractState : public QObject
-{
- Q_OBJECT
- Q_ENUMS(RestorePolicy)
- Q_PROPERTY(RestorePolicy restorePolicy READ restorePolicy WRITE setRestorePolicy)
-public:
- enum RestorePolicy {
- GlobalRestorePolicy,
- DoNotRestoreProperties,
- RestoreProperties
- };
-
- ~QtAbstractState();
-
- QtState *parentState() const;
-
- void assignProperty(QObject *object, const char *name,
- const QVariant &value);
-
- void setRestorePolicy(RestorePolicy restorePolicy);
- RestorePolicy restorePolicy() const;
-
-protected:
- QtAbstractState(QtState *parent = 0);
-
- virtual void onEntry() = 0;
- virtual void onExit() = 0;
-
- bool event(QEvent *e);
-
-protected:
-#ifdef QT_STATEMACHINE_SOLUTION
- QtAbstractStatePrivate *d_ptr;
-#endif
- QtAbstractState(QtAbstractStatePrivate &dd, QtState *parent);
-
-private:
- Q_DISABLE_COPY(QtAbstractState)
- Q_DECLARE_PRIVATE(QtAbstractState)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/lib/qtstatemachine/src/qabstractstate_p.h b/lib/qtstatemachine/src/qabstractstate_p.h
deleted file mode 100644
index 90079ff..0000000
--- a/lib/qtstatemachine/src/qabstractstate_p.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QABSTRACTSTATE_P_H
-#define QABSTRACTSTATE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef QT_STATEMACHINE_SOLUTION
-#include
-#endif
-
-#include
-#include
-#include
-
-QT_BEGIN_NAMESPACE
-
-class QtAbstractTransition;
-class QtHistoryState;
-class QtStateMachine;
-
-struct QPropertyAssignment
-{
- QPropertyAssignment(QObject *o, const QByteArray &n,
- const QVariant &v, bool es = true)
- : object(o), propertyName(n), value(v), explicitlySet(es)
- {}
- QObject *object;
- QByteArray propertyName;
- QVariant value;
- bool explicitlySet;
-};
-
-class QtAbstractState;
-class Q_STATEMACHINE_CORE_EXPORT QtAbstractStatePrivate
-#ifndef QT_STATEMACHINE_SOLUTION
- : public QObjectPrivate
-#endif
-{
- Q_DECLARE_PUBLIC(QtAbstractState)
-
-public:
- QtAbstractStatePrivate();
-
- static QtAbstractStatePrivate *get(QtAbstractState *q);
- static const QtAbstractStatePrivate *get(const QtAbstractState *q);
-
- QtStateMachine *machine() const;
-
- void callOnEntry();
- void callOnExit();
-
- QtAbstractState::RestorePolicy restorePolicy;
- QList propertyAssignments;
-
-#ifdef QT_STATEMACHINE_SOLUTION
- QtAbstractState *q_ptr;
-#endif
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/lib/qtstatemachine/src/qabstracttransition.cpp b/lib/qtstatemachine/src/qabstracttransition.cpp
deleted file mode 100644
index e946f11..0000000
--- a/lib/qtstatemachine/src/qabstracttransition.cpp
+++ /dev/null
@@ -1,367 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "qabstracttransition.h"
-#include "qabstracttransition_p.h"
-#include "qabstractstate.h"
-#include "qstate.h"
-#include "qstatemachine.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QtAbstractTransition
-
- \brief The QtAbstractTransition class is the base class of transitions between QtAbstractState objects.
-
- \since 4.6
- \ingroup statemachine
-
- The QtAbstractTransition class is the abstract base class of transitions
- between states (QtAbstractState objects) of a
- QtStateMachine. QtAbstractTransition is part of \l{The State Machine
- Framework}.
-
- The QtTransition class provides a default (action-based) implementation of
- the QtAbstractTransition interface.
-
- The sourceState() function returns the source of the transition. The
- targetStates() function returns the targets of the transition.
-
- Transitions can cause animations to be played. Use the addAnimation()
- function to add an animation to the transition.
-
- \section1 Subclassing
-
- The eventTest() function is called by the state machine to determine whether
- an event should trigger the transition. In your reimplementation you
- typically check the event type and cast the event object to the proper type,
- and check that one or more properties of the event meet your criteria.
-
- The onTransition() function is called when the transition is triggered;
- reimplement this function to perform custom processing for the transition.
-*/
-
-/*!
- \property QtAbstractTransition::source
-
- \brief the source state (parent) of this transition
-*/
-
-/*!
- \property QtAbstractTransition::target
-
- \brief the target state of this transition
-*/
-
-/*!
- \property QtAbstractTransition::targets
-
- \brief the target states of this transition
-
- If multiple states are specified, all must be descendants of the same
- parallel group state.
-*/
-
-QtAbstractTransitionPrivate::QtAbstractTransitionPrivate()
-{
-}
-
-QtAbstractTransitionPrivate *QtAbstractTransitionPrivate::get(QtAbstractTransition *q)
-{
- return q->d_func();
-}
-
-const QtAbstractTransitionPrivate *QtAbstractTransitionPrivate::get(const QtAbstractTransition *q)
-{
- return q->d_func();
-}
-
-QtStateMachine *QtAbstractTransitionPrivate::machine() const
-{
- Q_Q(const QtAbstractTransition);
- QObject *par = q->parent();
- while (par != 0) {
- if (QtStateMachine *mach = qobject_cast(par))
- return mach;
- par = par->parent();
- }
- return 0;
-}
-
-bool QtAbstractTransitionPrivate::callEventTest(QEvent *e) const
-{
- Q_Q(const QtAbstractTransition);
- return q->eventTest(e);
-}
-
-void QtAbstractTransitionPrivate::callOnTransition()
-{
- Q_Q(QtAbstractTransition);
- q->onTransition();
-}
-
-QtState *QtAbstractTransitionPrivate::sourceState() const
-{
- Q_Q(const QtAbstractTransition);
- return qobject_cast(q->parent());
-}
-
-/*!
- Constructs a new QtAbstractTransition object with the given \a sourceState.
-*/
-QtAbstractTransition::QtAbstractTransition(QtState *sourceState)
- : QObject(
-#ifndef QT_STATEMACHINE_SOLUTION
- *new QtAbstractTransitionPrivate,
-#endif
- sourceState)
-#ifdef QT_STATEMACHINE_SOLUTION
- , d_ptr(new QtAbstractTransitionPrivate)
-#endif
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- d_ptr->q_ptr = this;
-#endif
-}
-
-/*!
- Constructs a new QtAbstractTransition object with the given \a targets and \a
- sourceState.
-*/
-QtAbstractTransition::QtAbstractTransition(const QList &targets,
- QtState *sourceState)
- : QObject(
-#ifndef QT_STATEMACHINE_SOLUTION
- *new QtAbstractTransitionPrivate,
-#endif
- sourceState)
-#ifdef QT_STATEMACHINE_SOLUTION
- , d_ptr(new QtAbstractTransitionPrivate)
-#endif
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- d_ptr->q_ptr = this;
-#endif
- Q_D(QtAbstractTransition);
- d->targetStates = targets;
-}
-
-/*!
- \internal
-*/
-QtAbstractTransition::QtAbstractTransition(QtAbstractTransitionPrivate &dd,
- QtState *parent)
- : QObject(
-#ifndef QT_STATEMACHINE_SOLUTION
- dd,
-#endif
- parent)
-#ifdef QT_STATEMACHINE_SOLUTION
- , d_ptr(&dd)
-#endif
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- d_ptr->q_ptr = this;
-#endif
-}
-
-/*!
- \internal
-*/
-QtAbstractTransition::QtAbstractTransition(QtAbstractTransitionPrivate &dd,
- const QList &targets,
- QtState *parent)
- : QObject(
-#ifndef QT_STATEMACHINE_SOLUTION
- dd,
-#endif
- parent)
-#ifdef QT_STATEMACHINE_SOLUTION
- , d_ptr(&dd)
-#endif
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- d_ptr->q_ptr = this;
-#endif
- Q_D(QtAbstractTransition);
- d->targetStates = targets;
-}
-
-/*!
- Destroys this transition.
-*/
-QtAbstractTransition::~QtAbstractTransition()
-{
-#ifdef QT_STATEMACHINE_SOLUTION
- delete d_ptr;
-#endif
-}
-
-/*!
- Returns the source state of this transition, or 0 if this transition has no
- source state.
-*/
-QtState *QtAbstractTransition::sourceState() const
-{
- Q_D(const QtAbstractTransition);
- return d->sourceState();
-}
-
-/*!
- Returns the target state of this transition, or 0 if the transition has no
- target.
-*/
-QtAbstractState *QtAbstractTransition::targetState() const
-{
- Q_D(const QtAbstractTransition);
- if (d->targetStates.isEmpty())
- return 0;
- return d->targetStates.first();
-}
-
-/*!
- Sets the \a target state of this transition.
-*/
-void QtAbstractTransition::setTargetState(QtAbstractState* target)
-{
- Q_D(QtAbstractTransition);
- if (!target)
- d->targetStates.clear();
- else
- d->targetStates = QList() << target;
-}
-
-/*!
- Returns the target states of this transition, or an empty list if this
- transition has no target states.
-*/
-QList QtAbstractTransition::targetStates() const
-{
- Q_D(const QtAbstractTransition);
- return d->targetStates;
-}
-
-/*!
- Sets the target states of this transition to be the given \a targets.
-*/
-void QtAbstractTransition::setTargetStates(const QList &targets)
-{
- Q_D(QtAbstractTransition);
- d->targetStates = targets;
-}
-
-#ifndef QT_NO_ANIMATION
-
-/*!
- Adds the given \a animation to this transition.
- The transition does not take ownership of the animation.
-
- \sa removeAnimation(), animations()
-*/
-void QtAbstractTransition::addAnimation(QAbstractAnimation *animation)
-{
- Q_D(QtAbstractTransition);
- if (!animation) {
- qWarning("QtAbstractTransition::addAnimation: cannot add null animation");
- return;
- }
- d->animations.append(animation);
-}
-
-/*!
- Removes the given \a animation from this transition.
-
- \sa addAnimation()
-*/
-void QtAbstractTransition::removeAnimation(QAbstractAnimation *animation)
-{
- Q_D(QtAbstractTransition);
- if (!animation) {
- qWarning("QtAbstractTransition::removeAnimation: cannot remove null animation");
- return;
- }
- d->animations.removeOne(animation);
-}
-
-/*!
- Returns the list of animations associated with this transition, or an empty
- list if it has no animations.
-
- \sa addAnimation()
-*/
-QList QtAbstractTransition::animations() const
-{
- Q_D(const QtAbstractTransition);
- return d->animations;
-}
-
-#endif
-
-/*!
- \fn QtAbstractTransition::eventTest(QEvent *event) const
-
- This function is called to determine whether the given \a event should cause
- this transition to trigger. Reimplement this function and return true if the
- event should trigger the transition, otherwise return false.
-*/
-
-/*!
- \fn QtAbstractTransition::onTransition()
-
- This function is called when the transition is triggered. Reimplement this
- function to perform custom processing when the transition is triggered.
-*/
-
-/*!
- \reimp
-*/
-bool QtAbstractTransition::event(QEvent *e)
-{
- return QObject::event(e);
-}
-
-QT_END_NAMESPACE
diff --git a/lib/qtstatemachine/src/qabstracttransition.h b/lib/qtstatemachine/src/qabstracttransition.h
deleted file mode 100644
index b920eaa..0000000
--- a/lib/qtstatemachine/src/qabstracttransition.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QABSTRACTTRANSITION_H
-#define QABSTRACTTRANSITION_H
-
-#include "qtstatemachineglobal.h"
-#include
-
-#include
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-class QEvent;
-class QtAbstractState;
-class QtState;
-
-#ifndef QT_NO_ANIMATION
-class QAbstractAnimation;
-#endif
-
-class QtAbstractTransitionPrivate;
-class Q_STATEMACHINE_CORE_EXPORT QtAbstractTransition : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QtState* source READ sourceState)
- Q_PROPERTY(QtAbstractState* target READ targetState WRITE setTargetState)
- Q_PROPERTY(QList targets READ targetStates WRITE setTargetStates)
-public:
- QtAbstractTransition(QtState *sourceState = 0);
- QtAbstractTransition(const QList &targets, QtState *sourceState = 0);
- virtual ~QtAbstractTransition();
-
- QtState *sourceState() const;
- QtAbstractState *targetState() const;
- void setTargetState(QtAbstractState* target);
- QList targetStates() const;
- void setTargetStates(const QList &targets);
-
-#ifndef QT_NO_ANIMATION
- void addAnimation(QAbstractAnimation *animation);
- void removeAnimation(QAbstractAnimation *animation);
- QList animations() const;
-#endif
-
-protected:
- virtual bool eventTest(QEvent *event) const = 0;
-
- virtual void onTransition() = 0;
-
- bool event(QEvent *e);
-
-protected:
-#ifdef QT_STATEMACHINE_SOLUTION
- QtAbstractTransitionPrivate *d_ptr;
-#endif
- QtAbstractTransition(QtAbstractTransitionPrivate &dd, QtState *parent);
- QtAbstractTransition(QtAbstractTransitionPrivate &dd,
- const QList &targets, QtState *parent);
-
-private:
- Q_DISABLE_COPY(QtAbstractTransition)
- Q_DECLARE_PRIVATE(QtAbstractTransition)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/lib/qtstatemachine/src/qabstracttransition_p.h b/lib/qtstatemachine/src/qabstracttransition_p.h
deleted file mode 100644
index 4e13ba6..0000000
--- a/lib/qtstatemachine/src/qabstracttransition_p.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QABSTRACTTRANSITION_P_H
-#define QABSTRACTTRANSITION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#ifndef QT_STATEMACHINE_SOLUTION
-#include
-#endif
-
-#include
-
-QT_BEGIN_NAMESPACE
-
-class QtAbstractState;
-class QtState;
-class QtStateMachine;
-
-class QtAbstractTransition;
-class Q_STATEMACHINE_CORE_EXPORT QtAbstractTransitionPrivate
-#ifndef QT_STATEMACHINE_SOLUTION
- : public QObjectPrivate
-#endif
-{
- Q_DECLARE_PUBLIC(QtAbstractTransition)
-public:
- QtAbstractTransitionPrivate();
-
- static QtAbstractTransitionPrivate *get(QtAbstractTransition *q);
- static const QtAbstractTransitionPrivate *get(const QtAbstractTransition *q);
-
- bool callEventTest(QEvent *e) const;
- void callOnTransition();
- QtState *sourceState() const;
- QtStateMachine *machine() const;
-
- QList targetStates;
-
-#ifndef QT_NO_ANIMATION
- QList animations;
-#endif
-
-#ifdef QT_STATEMACHINE_SOLUTION
- QtAbstractTransition *q_ptr;
-#endif
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/lib/qtstatemachine/src/qactionstate.cpp b/lib/qtstatemachine/src/qactionstate.cpp
deleted file mode 100644
index effd0fc..0000000
--- a/lib/qtstatemachine/src/qactionstate.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "qactionstate.h"
-#include "qactionstate_p.h"
-#include "qstateaction.h"
-#include "qstateaction_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QtActionState
-
- \brief The QtActionState class provides an action-based state.
-
- \since 4.6
- \ingroup statemachine
-
- QtActionState executes \l{QtStateAction}{state actions} when the state is
- entered and exited. QtActionState is part of \l{The State Machine Framework}.
-
- You can add actions to a state with the addEntryAction() and addExitAction()
- functions. The state executes the actions when the state is entered and
- exited, respectively.
-
- The invokeMethodOnEntry() and invokeMethodOnExit() functions are used for
- defining method invocations that should be performed when a state is entered
- and exited, respectively.
-
- \code
- QtState *s2 = new QtState();
- s2->invokeMethodOnEntry(&label, "showMaximized");
- machine.addState(s2);
- \endcode
-
- \sa QtStateAction
-*/
-
-QtActionStatePrivate::QtActionStatePrivate()
-{
-}
-
-QtActionStatePrivate::~QtActionStatePrivate()
-{
-}
-
-QtActionStatePrivate *QtActionStatePrivate::get(QtActionState *q)
-{
- return q->d_func();
-}
-
-const QtActionStatePrivate *QtActionStatePrivate::get(const QtActionState *q)
-{
- return q->d_func();
-}
-
-QList QtActionStatePrivate::entryActions() const
-{
- QList result;
- QList::const_iterator it;
-#ifdef QT_STATEMACHINE_SOLUTION
- const QObjectList &children = q_func()->children();
-#endif
- for (it = children.constBegin(); it != children.constEnd(); ++it) {
- QtStateAction *act = qobject_cast(*it);
- if (act && (QtStateActionPrivate::get(act)->when == QtStateActionPrivate::ExecuteOnEntry))
- result.append(act);
- }
- return result;
-}
-
-QList QtActionStatePrivate::exitActions() const
-{
- QList result;
- QList::const_iterator it;
-#ifdef QT_STATEMACHINE_SOLUTION
- const QObjectList &children = q_func()->children();
-#endif
- for (it = children.constBegin(); it != children.constEnd(); ++it) {
- QtStateAction *act = qobject_cast(*it);
- if (act && (QtStateActionPrivate::get(act)->when == QtStateActionPrivate::ExecuteOnExit))
- result.append(act);
- }
- return result;
-}
-
-/*!
- Constructs a new action state with the given \a parent state.
-*/
-QtActionState::QtActionState(QtState *parent)
- : QtAbstractState(*new QtActionStatePrivate, parent)
-{
-}
-
-/*!
- \internal
-*/
-QtActionState::QtActionState(QtActionStatePrivate &dd,
- QtState *parent)
- : QtAbstractState(dd, parent)
-{
-}
-
-/*!
- Destroys this action state.
-*/
-QtActionState::~QtActionState()
-{
-}
-
-/*!
- Instructs this state to invoke the given \a method of the given \a object
- with the given \a arguments when the state is entered. This function will
- create a QtStateInvokeMethodAction object and add it to the entry actions of
- the state.
-
- \sa invokeMethodOnExit(), addEntryAction()
-*/
-void QtActionState::invokeMethodOnEntry(QObject *object, const char *method,
- const QList &arguments)
-{
- addEntryAction(new QtStateInvokeMethodAction(object, method, arguments));
-}
-
-/*!
- Instructs this state to invoke the given \a method of the given \a object
- with the given \a arguments when the state is exited. This function will
- create a QtStateInvokeMethodAction object and add it to the exit actions of
- the state.
-
- \sa invokeMethodOnEntry(), addExitAction()
-*/
-void QtActionState::invokeMethodOnExit(QObject *object, const char *method,
- const QList &arguments)
-{
- addExitAction(new QtStateInvokeMethodAction(object, method, arguments));
-}
-
-/*!
- Adds the given \a action to this state. The action will be executed when
- this state is entered. The state takes ownership of the action.
-
- \sa addExitAction(), removeEntryAction()
-*/
-void QtActionState::addEntryAction(QtStateAction *action)
-{
- if (!action) {
- qWarning("QtActionState::addEntryAction: cannot add null action");
- return;
- }
- action->setParent(this);
- QtStateActionPrivate::get(action)->when = QtStateActionPrivate::ExecuteOnEntry;
-}
-
-/*!
- Adds the given \a action to this state. The action will be executed when
- this state is exited. The state takes ownership of the action.
-
- \sa addEntryAction(), removeExitAction()
-*/
-void QtActionState::addExitAction(QtStateAction *action)
-{
- if (!action) {
- qWarning("QtActionState::addExitAction: cannot add null action");
- return;
- }
- action->setParent(this);
- QtStateActionPrivate::get(action)->when = QtStateActionPrivate::ExecuteOnExit;
-}
-
-/*!
- Removes the given entry \a action from this state. The state releases
- ownership of the action.
-
- \sa addEntryAction()
-*/
-void QtActionState::removeEntryAction(QtStateAction *action)
-{
- if (!action) {
- qWarning("QtActionState::removeEntryAction: cannot remove null action");
- return;
- }
- if (action->parent() == this)
- action->setParent(0);
-}
-
-/*!
- Removes the given exit \a action from this state. The state releases
- ownership of the action.
-
- \sa addExitAction()
-*/
-void QtActionState::removeExitAction(QtStateAction *action)
-{
- if (!action) {
- qWarning("QtActionState::removeExitAction: cannot remove null action");
- return;
- }
- if (action->parent() == this)
- action->setParent(0);
-}
-
-/*!
- Returns this state's entry actions.
-
- \sa addEntryAction(), exitActions()
-*/
-QList QtActionState::entryActions() const
-{
- Q_D(const QtActionState);
- return d->entryActions();
-}
-
-/*!
- Returns this state's exit actions.
-
- \sa addExitAction(), entryActions()
-*/
-QList QtActionState::exitActions() const
-{
- Q_D(const QtActionState);
- return d->exitActions();
-}
-
-/*!
- \reimp
-*/
-void QtActionState::onEntry()
-{
- Q_D(QtActionState);
- QList actions = d->entryActions();
- for (int i = 0; i < actions.size(); ++i)
- QtStateActionPrivate::get(actions.at(i))->callExecute();
-}
-
-/*!
- \reimp
-*/
-void QtActionState::onExit()
-{
- Q_D(QtActionState);
- QList actions = d->exitActions();
- for (int i = 0; i < actions.size(); ++i)
- QtStateActionPrivate::get(actions.at(i))->callExecute();
-}
-
-/*!
- \reimp
-*/
-bool QtActionState::event(QEvent *e)
-{
- return QtAbstractState::event(e);
-}
-
-QT_END_NAMESPACE
diff --git a/lib/qtstatemachine/src/qactionstate.h b/lib/qtstatemachine/src/qactionstate.h
deleted file mode 100644
index 559cef9..0000000
--- a/lib/qtstatemachine/src/qactionstate.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QACTIONSTATE_H
-#define QACTIONSTATE_H
-
-#include "qtstatemachineglobal.h"
-#ifndef QT_STATEMACHINE_SOLUTION
-#include
-#else
-#include "qabstractstate.h"
-#endif
-
-#include
-#include
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-class QtStateAction;
-
-class QtActionStatePrivate;
-class Q_STATEMACHINE_CORE_EXPORT QtActionState : public QtAbstractState
-{
- Q_OBJECT
-public:
- QtActionState(QtState *parent = 0);
- ~QtActionState();
-
- void invokeMethodOnEntry(QObject *object, const char *method,
- const QList &args = QList());
- void invokeMethodOnExit(QObject *object, const char *method,
- const QList &args = QList());
-
- void addEntryAction(QtStateAction *action);
- void addExitAction(QtStateAction *action);
-
- void removeEntryAction(QtStateAction *action);
- void removeExitAction(QtStateAction *action);
-
- QList entryActions() const;
- QList exitActions() const;
-
-protected:
- void onEntry();
- void onExit();
-
- bool event(QEvent *e);
-
-protected:
- QtActionState(QtActionStatePrivate &dd, QtState *parent);
-
-private:
- Q_DISABLE_COPY(QtActionState)
- Q_DECLARE_PRIVATE(QtActionState)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/lib/qtstatemachine/src/qactionstate_p.h b/lib/qtstatemachine/src/qactionstate_p.h
deleted file mode 100644
index db85572..0000000
--- a/lib/qtstatemachine/src/qactionstate_p.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QACTIONSTATE_P_H
-#define QACTIONSTATE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qabstractstate_p.h"
-#include "qactionstate.h"
-
-#include
-
-QT_BEGIN_NAMESPACE
-
-class QtStateAction;
-
-class QtActionState;
-class Q_STATEMACHINE_CORE_EXPORT QtActionStatePrivate : public QtAbstractStatePrivate
-{
- Q_DECLARE_PUBLIC(QtActionState)
-
-public:
- QtActionStatePrivate();
- ~QtActionStatePrivate();
-
- static QtActionStatePrivate *get(QtActionState *q);
- static const QtActionStatePrivate *get(const QtActionState *q);
-
- QList entryActions() const;
- QList exitActions() const;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/lib/qtstatemachine/src/qboundevent_p.h b/lib/qtstatemachine/src/qboundevent_p.h
deleted file mode 100644
index 9bae01c..0000000
--- a/lib/qtstatemachine/src/qboundevent_p.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QBOUNDEVENT_P_H
-#define QBOUNDEVENT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include
-
-QT_BEGIN_NAMESPACE
-
-class QtBoundEvent : public QEvent
-{
-public:
- QtBoundEvent(QObject *object, QEvent *event)
-#ifdef QT_STATEMACHINE_SOLUTION
- : QEvent(QEvent::Type(QEvent::User-3)),
-#else
- : QEvent(QEvent::Bound),
-#endif
- m_object(object), m_event(event) {}
- ~QtBoundEvent() {}
-
- inline QObject *object() const { return m_object; }
- inline QEvent *event() const { return m_event; }
-
-private:
- QObject *m_object;
- QEvent *m_event;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/lib/qtstatemachine/src/qeventtransition.cpp b/lib/qtstatemachine/src/qeventtransition.cpp
deleted file mode 100644
index a84c1e4..0000000
--- a/lib/qtstatemachine/src/qeventtransition.cpp
+++ /dev/null
@@ -1,297 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "qeventtransition.h"
-#include "qeventtransition_p.h"
-#include "qboundevent_p.h"
-#include "qstate.h"
-#include "qstate_p.h"
-#include "qstatemachine.h"
-#include "qstatemachine_p.h"
-#include
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QtEventTransition
-
- \brief The QtEventTransition class provides a QObject-specific transition for Qt events.
-
- \since 4.6
- \ingroup statemachine
-
- A QtEventTransition object binds an event to a particular QObject.
- QtEventTransition is part of \l{The State Machine Framework}.
-
- Example:
-
- \code
- QPushButton *button = ...;
- QtState *s1 = ...;
- QtState *s2 = ...;
- // If in s1 and the button receives an Enter event, transition to s2
- QtEventTransition *enterTransition = new QtEventTransition(button, QEvent::Enter);
- enterTransition->setTargetState(s2);
- s1->addTransition(enterTransition);
- // If in s2 and the button receives an Exit event, transition back to s1
- QtEventTransition *leaveTransition = new QtEventTransition(button, QEvent::Leave);
- leaveTransition->setTargetState(s1);
- s2->addTransition(leaveTransition);
- \endcode
-
- \section1 Subclassing
-
- Many event classes have attributes in addition to the event type itself.
- The testEventCondition() function can be reimplemented to check attributes
- of an event instance in order to determine whether the transition should be
- triggered or not.
-
- \sa QtState::addTransition()
-*/
-
-/*!
- \property QtEventTransition::object
-
- \brief the event source that this event transition is associated with
-*/
-
-/*!
- \property QtEventTransition::eventType
-
- \brief the type of event that this event transition is associated with
-*/
-QtEventTransitionPrivate::QtEventTransitionPrivate()
-{
- object = 0;
- eventType = QEvent::None;
- registered = false;
-}
-
-QtEventTransitionPrivate *QtEventTransitionPrivate::get(QtEventTransition *q)
-{
- return q->d_func();
-}
-
-void QtEventTransitionPrivate::invalidate()
-{
- Q_Q(QtEventTransition);
- if (registered) {
- QtState *source = sourceState();
- QtStatePrivate *source_d = QtStatePrivate::get(source);
- QtStateMachinePrivate *mach = QtStateMachinePrivate::get(source_d->machine());
- if (mach) {
- mach->unregisterEventTransition(q);
- if (mach->configuration.contains(source))
- mach->registerEventTransition(q);
- }
- }
-}
-
-/*!
- Constructs a new QtEventTransition object with the given \a sourceState.
-*/
-QtEventTransition::QtEventTransition(QtState *sourceState)
- : QtTransition(*new QtEventTransitionPrivate, sourceState)
-{
-}
-
-/*!
- Constructs a new QtEventTransition object associated with events of the given
- \a type for the given \a object, and with the given \a sourceState.
-*/
-QtEventTransition::QtEventTransition(QObject *object, QEvent::Type type,
- QtState *sourceState)
- : QtTransition(*new QtEventTransitionPrivate, sourceState)
-{
- Q_D(QtEventTransition);
- d->registered = false;
- d->object = object;
- d->eventType = type;
-}
-
-/*!
- Constructs a new QtEventTransition object associated with events of the given
- \a type for the given \a object. The transition has the given \a targets and
- \a sourceState.
-*/
-QtEventTransition::QtEventTransition(QObject *object, QEvent::Type type,
- const QList &targets,
- QtState *sourceState)
- : QtTransition(*new QtEventTransitionPrivate, targets, sourceState)
-{
- Q_D(QtEventTransition);
- d->registered = false;
- d->object = object;
- d->eventType = type;
-}
-
-/*!
- \internal
-*/
-QtEventTransition::QtEventTransition(QtEventTransitionPrivate &dd, QtState *parent)
- : QtTransition(dd, parent)
-{
-}
-
-/*!
- \internal
-*/
-QtEventTransition::QtEventTransition(QtEventTransitionPrivate &dd, QObject *object,
- QEvent::Type type, QtState *parent)
- : QtTransition(dd, parent)
-{
- Q_D(QtEventTransition);
- d->registered = false;
- d->object = object;
- d->eventType = type;
-}
-
-/*!
- \internal
-*/
-QtEventTransition::QtEventTransition(QtEventTransitionPrivate &dd, QObject *object,
- QEvent::Type type, const QList &targets,
- QtState *parent)
- : QtTransition(dd, targets, parent)
-{
- Q_D(QtEventTransition);
- d->registered = false;
- d->object = object;
- d->eventType = type;
-}
-
-/*!
- Destroys this QObject event transition.
-*/
-QtEventTransition::~QtEventTransition()
-{
-}
-
-/*!
- Returns the event type that this event transition is associated with.
-*/
-QEvent::Type QtEventTransition::eventType() const
-{
- Q_D(const QtEventTransition);
- return d->eventType;
-}
-
-/*!
- Sets the event \a type that this event transition is associated with.
-*/
-void QtEventTransition::setEventType(QEvent::Type type)
-{
- Q_D(QtEventTransition);
- if (d->eventType == type)
- return;
- d->eventType = type;
- d->invalidate();
-}
-
-/*!
- Returns the event source associated with this event transition.
-*/
-QObject *QtEventTransition::eventSource() const
-{
- Q_D(const QtEventTransition);
- return d->object;
-}
-
-/*!
- Sets the event source associated with this event transition to be the given
- \a object.
-*/
-void QtEventTransition::setEventSource(QObject *object)
-{
- Q_D(QtEventTransition);
- if (d->object == object)
- return;
- d->object = object;
- d->invalidate();
-}
-
-/*!
- \reimp
-*/
-bool QtEventTransition::eventTest(QEvent *event) const
-{
- Q_D(const QtEventTransition);
-#ifdef QT_STATEMACHINE_SOLUTION
- if (event->type() == QEvent::Type(QEvent::User-3)) {
-#else
- if (event->type() == QEvent::Bound) {
-#endif
- QtBoundEvent *oe = static_cast(event);
- return (oe->object() == d->object)
- && (oe->event()->type() == d->eventType)
- && testEventCondition(oe->event());
- }
- return false;
-}
-
-/*!
- Tests an instance of an event associated with this event transition and
- returns true if the transition should be taken, otherwise returns false.
- The type of the given \a event will be eventType().
-
- Reimplement this function if you have custom conditions associated with
- the transition. The default implementation always returns true.
-*/
-bool QtEventTransition::testEventCondition(QEvent *event) const
-{
- Q_UNUSED(event);
- return true;
-}
-
-/*!
- \reimp
-*/
-bool QtEventTransition::event(QEvent *e)
-{
- return QtTransition::event(e);
-}
-
-QT_END_NAMESPACE
diff --git a/lib/qtstatemachine/src/qeventtransition.h b/lib/qtstatemachine/src/qeventtransition.h
deleted file mode 100644
index 3bc80cc..0000000
--- a/lib/qtstatemachine/src/qeventtransition.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QEVENTTRANSITION_H
-#define QEVENTTRANSITION_H
-
-#include "qtstatemachineglobal.h"
-#include "qtransition.h"
-#include
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-class QtEventTransitionPrivate;
-class Q_STATEMACHINE_CORE_EXPORT QtEventTransition : public QtTransition
-{
- Q_OBJECT
- Q_PROPERTY(QObject* object READ eventSource WRITE setEventSource)
-#ifndef QT_STATEMACHINE_SOLUTION
- Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType)
-#endif
-public:
- QtEventTransition(QtState *sourceState = 0);
- QtEventTransition(QObject *object, QEvent::Type type, QtState *sourceState = 0);
- QtEventTransition(QObject *object, QEvent::Type type,
- const QList &targets, QtState *sourceState = 0);
- ~QtEventTransition();
-
- QObject *eventSource() const;
- void setEventSource(QObject *object);
-
- QEvent::Type eventType() const;
- void setEventType(QEvent::Type type);
-
-protected:
- virtual bool testEventCondition(QEvent *event) const; // ### name
-
- bool eventTest(QEvent *event) const;
-
- bool event(QEvent *e);
-
-protected:
- QtEventTransition(QtEventTransitionPrivate &dd, QtState *parent);
- QtEventTransition(QtEventTransitionPrivate &dd, QObject *object,
- QEvent::Type type, QtState *parent);
- QtEventTransition(QtEventTransitionPrivate &dd, QObject *object,
- QEvent::Type type, const QList &targets,
- QtState *parent);
-
-private:
- Q_DISABLE_COPY(QtEventTransition)
- Q_DECLARE_PRIVATE(QtEventTransition)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/lib/qtstatemachine/src/qeventtransition_p.h b/lib/qtstatemachine/src/qeventtransition_p.h
deleted file mode 100644
index 34e4172..0000000
--- a/lib/qtstatemachine/src/qeventtransition_p.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QEVENTTRANSITION_P_H
-#define QEVENTTRANSITION_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qtransition_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QtEventTransition;
-class Q_STATEMACHINE_CORE_EXPORT QtEventTransitionPrivate : public QtTransitionPrivate
-{
- Q_DECLARE_PUBLIC(QtEventTransition)
-public:
- QtEventTransitionPrivate();
-
- static QtEventTransitionPrivate *get(QtEventTransition *q);
-
- void invalidate();
-
- bool registered;
- QObject *object;
- QEvent::Type eventType;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/lib/qtstatemachine/src/qfinalstate.cpp b/lib/qtstatemachine/src/qfinalstate.cpp
deleted file mode 100644
index 4c91ffa..0000000
--- a/lib/qtstatemachine/src/qfinalstate.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "qfinalstate.h"
-#include "qactionstate_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QtFinalState
-
- \brief The QtFinalState class provides a final state.
-
- \since 4.6
- \ingroup statemachine
-
- A final state is used to communicate that (part of) a QtStateMachine has
- finished its work. When a final top-level state is entered, the state
- machine's \l{QtStateMachine::finished()}{finished}() signal is emitted. In
- general, when a final substate (a child of a QtState) is entered, a
- QtStateFinishedEvent is generated for the final state's parent
- state. QtFinalState is part of \l{The State Machine Framework}.
-
- To use a final state, you create a QtFinalState object and add a transition
- to it from another state. Example:
-
- \code
- QPushButton button;
-
- QtStateMachine machine;
- QtState *s1 = new QtState();
- QtFinalState *s2 = new QtFinalState();
- s1->addTransition(&button, SIGNAL(clicked()), s2);
- machine.addState(s1);
- machine.addState(s2);
-
- QObject::connect(&machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit()));
- machine.setInitialState(s1);
- machine.start();
- \endcode
-
- \sa QtStateFinishedTransition
-*/
-
-class QtFinalStatePrivate : public QtActionStatePrivate
-{
- Q_DECLARE_PUBLIC(QtFinalState)
-
-public:
- QtFinalStatePrivate();
-};
-
-QtFinalStatePrivate::QtFinalStatePrivate()
-{
-}
-
-/*!
- Constructs a new QtFinalState object with the given \a parent state.
-*/
-QtFinalState::QtFinalState(QtState *parent)
- : QtActionState(*new QtFinalStatePrivate, parent)
-{
-}
-
-/*!
- Destroys this final state.
-*/
-QtFinalState::~QtFinalState()
-{
-}
-
-/*!
- \reimp
-*/
-void QtFinalState::onEntry()
-{
- QtActionState::onEntry();
-}
-
-/*!
- \reimp
-*/
-void QtFinalState::onExit()
-{
- QtActionState::onExit();
-}
-
-/*!
- \reimp
-*/
-bool QtFinalState::event(QEvent *e)
-{
- return QtActionState::event(e);
-}
-
-QT_END_NAMESPACE
diff --git a/lib/qtstatemachine/src/qfinalstate.h b/lib/qtstatemachine/src/qfinalstate.h
deleted file mode 100644
index c6ffe5f..0000000
--- a/lib/qtstatemachine/src/qfinalstate.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QFINALSTATE_H
-#define QFINALSTATE_H
-
-#include "qtstatemachineglobal.h"
-#ifndef QT_STATEMACHINE_SOLUTION
-#include
-#else
-#include "qactionstate.h"
-#endif
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-class QtFinalStatePrivate;
-class Q_STATEMACHINE_CORE_EXPORT QtFinalState : public QtActionState
-{
- Q_OBJECT
-public:
- QtFinalState(QtState *parent = 0);
- ~QtFinalState();
-
-protected:
- void onEntry();
- void onExit();
-
- bool event(QEvent *e);
-
-private:
- Q_DISABLE_COPY(QtFinalState)
- Q_DECLARE_PRIVATE(QtFinalState)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/lib/qtstatemachine/src/qguistatemachine.cpp b/lib/qtstatemachine/src/qguistatemachine.cpp
deleted file mode 100644
index f736339..0000000
--- a/lib/qtstatemachine/src/qguistatemachine.cpp
+++ /dev/null
@@ -1,569 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifdef QT_STATEMACHINE_SOLUTION
-#include "qstatemachine.h"
-#include "qstatemachine_p.h"
-#else
-#include
-#include
-#endif
-#include
-#include
-
-QT_BEGIN_NAMESPACE
-
-Q_STATEMACHINE_CORE_EXPORT const QtStateMachinePrivate::Handler *qcoreStateMachineHandler();
-
-static QEvent *cloneEvent(QEvent *e)
-{
- switch (e->type()) {
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- case QEvent::MouseButtonDblClick:
- case QEvent::MouseMove:
- return new QMouseEvent(*static_cast(e));
- case QEvent::KeyPress:
- case QEvent::KeyRelease:
- return new QKeyEvent(*static_cast(e));
- case QEvent::FocusIn:
- case QEvent::FocusOut:
- return new QFocusEvent(*static_cast(e));
- case QEvent::Enter:
- return new QEvent(*e);
- case QEvent::Leave:
- return new QEvent(*e);
- break;
- case QEvent::Paint:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Move:
- return new QMoveEvent(*static_cast(e));
- case QEvent::Resize:
- return new QResizeEvent(*static_cast(e));
- case QEvent::Create:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Destroy:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Show:
- return new QShowEvent(*static_cast(e));
- case QEvent::Hide:
- return new QHideEvent(*static_cast(e));
- case QEvent::Close:
- return new QCloseEvent(*static_cast(e));
- case QEvent::Quit:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ParentChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ParentAboutToChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ThreadChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::WindowActivate:
- case QEvent::WindowDeactivate:
- return new QEvent(*e);
-
- case QEvent::ShowToParent:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::HideToParent:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Wheel:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::WindowTitleChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::WindowIconChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ApplicationWindowIconChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ApplicationFontChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ApplicationLayoutDirectionChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ApplicationPaletteChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::PaletteChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Clipboard:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Speech:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::MetaCall:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::SockAct:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::WinEventAct:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::DeferredDelete:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::DragEnter:
- return new QDragEnterEvent(*static_cast(e));
- case QEvent::DragMove:
- return new QDragMoveEvent(*static_cast(e));
- case QEvent::DragLeave:
- return new QDragLeaveEvent(*static_cast(e));
- case QEvent::Drop:
- return new QDropEvent(*static_cast(e));
- case QEvent::DragResponse:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ChildAdded:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ChildPolished:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-#ifdef QT3_SUPPORT
- case QEvent::ChildInsertedRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ChildInserted:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::LayoutHint:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-#endif
- case QEvent::ChildRemoved:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ShowWindowRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::PolishRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Polish:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::LayoutRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::UpdateRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::UpdateLater:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::EmbeddingControl:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ActivateControl:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::DeactivateControl:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ContextMenu:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::InputMethod:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::AccessibilityPrepare:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::TabletMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::LocaleChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::LanguageChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::LayoutDirectionChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::Style:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::TabletPress:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::TabletRelease:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::OkRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::HelpRequest:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::IconDrag:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::FontChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::EnabledChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ActivationChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::StyleChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::IconTextChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ModifiedChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::MouseTrackingChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::WindowBlocked:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::WindowUnblocked:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::WindowStateChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::ToolTip:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::WhatsThis:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::StatusTip:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::ActionChanged:
- case QEvent::ActionAdded:
- case QEvent::ActionRemoved:
- return new QActionEvent(*static_cast(e));
-
- case QEvent::FileOpen:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::Shortcut:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ShortcutOverride:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
-#ifdef QT3_SUPPORT
- case QEvent::Accel:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::AccelAvailable:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-#endif
-
- case QEvent::WhatsThisClicked:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::ToolBarChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::ApplicationActivate:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ApplicationDeactivate:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::QueryWhatsThis:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::EnterWhatsThisMode:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::LeaveWhatsThisMode:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::ZOrderChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::HoverEnter:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::HoverLeave:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::HoverMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::AccessibilityHelp:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::AccessibilityDescription:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
-#ifdef QT_KEYPAD_NAVIGATION
- case QEvent::EnterEditFocus:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::LeaveEditFocus:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-#endif
- case QEvent::AcceptDropsChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::MenubarUpdated:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::ZeroTimerEvent:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::GraphicsSceneMouseMove:
- case QEvent::GraphicsSceneMousePress:
- case QEvent::GraphicsSceneMouseRelease:
- case QEvent::GraphicsSceneMouseDoubleClick: {
- QGraphicsSceneMouseEvent *me = static_cast(e);
- QGraphicsSceneMouseEvent *me2 = new QGraphicsSceneMouseEvent(me->type());
- me2->setWidget(me->widget());
- me2->setPos(me->pos());
- me2->setScenePos(me->scenePos());
- me2->setScreenPos(me->screenPos());
-// ### for all buttons
- me2->setButtonDownPos(Qt::LeftButton, me->buttonDownPos(Qt::LeftButton));
- me2->setButtonDownPos(Qt::RightButton, me->buttonDownPos(Qt::RightButton));
- me2->setButtonDownScreenPos(Qt::LeftButton, me->buttonDownScreenPos(Qt::LeftButton));
- me2->setButtonDownScreenPos(Qt::RightButton, me->buttonDownScreenPos(Qt::RightButton));
- me2->setLastPos(me->lastPos());
- me2->setLastScenePos(me->lastScenePos());
- me2->setLastScreenPos(me->lastScreenPos());
- me2->setButtons(me->buttons());
- me2->setButton(me->button());
- me2->setModifiers(me->modifiers());
- return me2;
- }
-
- case QEvent::GraphicsSceneContextMenu: {
- QGraphicsSceneContextMenuEvent *me = static_cast(e);
- QGraphicsSceneContextMenuEvent *me2 = new QGraphicsSceneContextMenuEvent(me->type());
- me2->setWidget(me->widget());
- me2->setPos(me->pos());
- me2->setScenePos(me->scenePos());
- me2->setScreenPos(me->screenPos());
- me2->setModifiers(me->modifiers());
- me2->setReason(me->reason());
- return me2;
- }
-
- case QEvent::GraphicsSceneHoverEnter:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneHoverMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneHoverLeave:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneHelp:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneDragEnter:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneDragMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneDragLeave:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneDrop:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneWheel:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::KeyboardLayoutChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::DynamicPropertyChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::TabletEnterProximity:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::TabletLeaveProximity:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::NonClientAreaMouseMove:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::NonClientAreaMouseButtonPress:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::NonClientAreaMouseButtonRelease:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::NonClientAreaMouseButtonDblClick:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::MacSizeChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::ContentsRectChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::MacGLWindowChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::FutureCallOut:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::GraphicsSceneResize:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::GraphicsSceneMove: {
- QGraphicsSceneMoveEvent *me = static_cast(e);
- QGraphicsSceneMoveEvent *me2 = new QGraphicsSceneMoveEvent();
- me2->setWidget(me->widget());
- me2->setNewPos(me->newPos());
- me2->setOldPos(me->oldPos());
- return me2;
- }
-
- case QEvent::CursorChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- case QEvent::ToolTipChange:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::NetworkReplyUpdated:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-
- case QEvent::GrabMouse:
- case QEvent::UngrabMouse:
- case QEvent::GrabKeyboard:
- case QEvent::UngrabKeyboard:
- return new QEvent(*e);
-
-#if defined(QT_MAC_USE_COCOA) && (QT_VERSION >= 0x040500)
- case QEvent::CocoaRequestModal:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
-#endif
- case QEvent::User:
- case QEvent::MaxUser:
- Q_ASSERT_X(false, "cloneEvent()", "not implemented");
- break;
- default:
- ;
- }
- return qcoreStateMachineHandler()->cloneEvent(e);
-}
-
-const QtStateMachinePrivate::Handler qt_gui_statemachine_handler = {
- cloneEvent
-};
-
-static const QtStateMachinePrivate::Handler *qt_guistatemachine_last_handler = 0;
-Q_STATEMACHINE_CORE_EXPORT int qRegisterGuiStateMachine()
-{
- qt_guistatemachine_last_handler = QtStateMachinePrivate::handler;
- QtStateMachinePrivate::handler = &qt_gui_statemachine_handler;
- return 1;
-}
-Q_CONSTRUCTOR_FUNCTION(qRegisterGuiStateMachine)
-
-Q_STATEMACHINE_CORE_EXPORT int qUnregisterGuiStateMachine()
-{
- QtStateMachinePrivate::handler = qt_guistatemachine_last_handler;
- return 1;
-}
-Q_DESTRUCTOR_FUNCTION(qUnregisterGuiStateMachine)
-
-QT_END_NAMESPACE
diff --git a/lib/qtstatemachine/src/qhistorystate.cpp b/lib/qtstatemachine/src/qhistorystate.cpp
deleted file mode 100644
index 2e8f760..0000000
--- a/lib/qtstatemachine/src/qhistorystate.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#include "qhistorystate.h"
-#include "qhistorystate_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QtHistoryState
-
- \brief The QtHistoryState class provides a means of returning to a previously active substate.
-
- \since 4.6
- \ingroup statemachine
-
- A history state is a pseudo-state that represents the child state that the
- parent state was in the last time the parent state was exited. A transition
- with a history state as its target is in fact a transition to one of the
- other child states of the parent state. QtHistoryState is part of \l{The
- State Machine Framework}.
-
- Use QtState::addHistoryState() to construct a history state. Use the
- setDefaultState() function to set the state that should be entered if the
- parent state has never been entered. Example:
-
- \code
- QtStateMachine machine;
-
- QtState *s1 = new QtState();
- QtState *s11 = new QtState(s1);
- QtState *s12 = new QtState(s1);
-
- QtState *s1h = s1->addHistoryState();
- s1h->setDefaultState(s11);
-
- machine.addState(s1);
-
- QtState *s2 = new QtState();
- machine.addState(s2);
-
- QPushButton *button = new QPushButton();
- // Clicking the button will cause the state machine to enter the child state
- // that s1 was in the last time s1 was exited, or the history state's default
- // state if s1 has never been entered.
- s1->addTransition(button, SIGNAL(clicked()), s1h);
- \endcode
-*/
-
-QtHistoryStatePrivate::QtHistoryStatePrivate()
- : defaultState(0)
-{
-}
-
-QtHistoryState *QtHistoryStatePrivate::create(QtState::HistoryType type,
- QtState *parent)
-{
- return new QtHistoryState(type, parent);
-}
-
-QtHistoryStatePrivate *QtHistoryStatePrivate::get(QtHistoryState *q)
-{
- return q->d_func();
-}
-
-const QtHistoryStatePrivate *QtHistoryStatePrivate::get(const QtHistoryState *q)
-{
- return q->d_func();
-}
-
-/*!
- \internal
-
- Constructs a new history state of the given \a type, with the given \a
- parent state.
-*/
-QtHistoryState::QtHistoryState(QtState::HistoryType type, QtState *parent)
- : QtAbstractState(*new QtHistoryStatePrivate, parent)
-{
- Q_D(QtHistoryState);
- d->historyType = type;
-}
-
-/*!
- Destroys this history state.
-*/
-QtHistoryState::~QtHistoryState()
-{
-}
-
-/*!
- Returns this history state's default state. The default state indicates the
- state to transition to if the parent state has never been entered before.
-*/
-QtAbstractState *QtHistoryState::defaultState() const
-{
- Q_D(const QtHistoryState);
- return d->defaultState;
-}
-
-/*!
- Sets this history state's default state to be the given \a state.
- \a state must be a sibling of this history state.
-*/
-void QtHistoryState::setDefaultState(QtAbstractState *state)
-{
- Q_D(QtHistoryState);
- if (state && state->parentState() != parentState()) {
- qWarning("QtHistoryState::setDefaultState: state %p does not belong "
- "to this history state's group (%p)", state, parentState());
- return;
- }
- d->defaultState = state;
-}
-
-/*!
- \reimp
-*/
-void QtHistoryState::onEntry()
-{
-}
-
-/*!
- \reimp
-*/
-void QtHistoryState::onExit()
-{
-}
-
-/*!
- \reimp
-*/
-bool QtHistoryState::event(QEvent *e)
-{
- return QtAbstractState::event(e);
-}
-
-QT_END_NAMESPACE
diff --git a/lib/qtstatemachine/src/qhistorystate.h b/lib/qtstatemachine/src/qhistorystate.h
deleted file mode 100644
index c116678..0000000
--- a/lib/qtstatemachine/src/qhistorystate.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QHISTORYSTATE_H
-#define QHISTORYSTATE_H
-
-#include "qtstatemachineglobal.h"
-#ifndef QT_STATEMACHINE_SOLUTION
-#include
-#else
-#include "qstate.h"
-#endif
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Core)
-
-class QtHistoryStatePrivate;
-class Q_STATEMACHINE_CORE_EXPORT QtHistoryState : public QtAbstractState
-{
- Q_OBJECT
-public:
- ~QtHistoryState();
-
- QtAbstractState *defaultState() const;
- void setDefaultState(QtAbstractState *state);
-
-protected:
- void onEntry();
- void onExit();
-
- bool event(QEvent *e);
-
-private:
- QtHistoryState(QtState::HistoryType type,
- QtState *parent = 0);
-
-private:
- Q_DISABLE_COPY(QtHistoryState)
- Q_DECLARE_PRIVATE(QtHistoryState)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif
diff --git a/lib/qtstatemachine/src/qhistorystate_p.h b/lib/qtstatemachine/src/qhistorystate_p.h
deleted file mode 100644
index e4acb65..0000000
--- a/lib/qtstatemachine/src/qhistorystate_p.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-#ifndef QHISTORYSTATE_P_H
-#define QHISTORYSTATE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qabstractstate_p.h"
-
-#include
-
-QT_BEGIN_NAMESPACE
-
-class QtHistoryState;
-class QtHistoryStatePrivate : public QtAbstractStatePrivate
-{
- Q_DECLARE_PUBLIC(QtHistoryState)
-
-public:
- QtHistoryStatePrivate();
-
- static QtHistoryState *create(QtState::HistoryType type,
- QtState *parent);
-
- static QtHistoryStatePrivate *get(QtHistoryState *q);
- static const QtHistoryStatePrivate *get(const QtHistoryState *q);
-
- QtAbstractState *defaultState;
- QtState::HistoryType historyType;
- QList configuration;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/lib/qtstatemachine/src/qscriptedstatemachine.cpp b/lib/qtstatemachine/src/qscriptedstatemachine.cpp
deleted file mode 100644
index d76bc53..0000000
--- a/lib/qtstatemachine/src/qscriptedstatemachine.cpp
+++ /dev/null
@@ -1,1386 +0,0 @@
-/****************************************************************************
-**
-** This file is part of a Qt Solutions component.
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Solutions Commercial License Agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** Please note Third Party Software included with Qt Solutions may impose
-** additional restrictions and it is the user's responsibility to ensure
-** that they have met the licensing requirements of the GPL, LGPL, or Qt
-** Solutions Commercial license and the relevant license of the Third
-** Party Software they are using.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-****************************************************************************/
-
-/*!
- \class QtScriptedStateMachine
- \reentrant
-
- \brief The QtScriptedStateMachine class provides a way to use scripting with the Qt State Machine Framework.
-
- \ingroup sctools
-
- Though can be used alone, QtScriptedStateMachine is mainly a runtime helper to using the
- state-machine framework with SCXML files.
-
-
- \sa QtStateMachine
-*/
-
-#include "qscriptedstatemachine.h"
-#include
-#include
-#include "qstatefinishedevent.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "qhistorystate.h"
-#include "qabstracttransition_p.h"
-#include "qfinalstate.h"
-#include "qabstractstate.h"
-#ifdef QT_GUI_LIB
-#include "qssmguiinvokers_p.h"
-#endif
-
-
-class QtScriptedStateMachinePrivate
-{
- public:
-
- enum { MaxSnapshots = 200};
-
- struct AnchorSnapshot
- {
- QtAbstractState* state;
- QString location;
- QScriptValue snapshot;
- QString anchorType;
- };
-
-
- QScriptEngine* scriptEng;
- QList invokerFactories;
- QUrl burl;
- QString sessionID;
- QString startScript;
-
-
- QStack snapshotStack;
- QMultiHash anchorTransitions;
- QHash curSnapshot;
-
-
- static QHash sessions;
-};
-QHash QtScriptedStateMachinePrivate::sessions;
-
-class QtSsmTimer : public QObject
-{
- Q_OBJECT
- public:
- QtSsmTimer(QScriptEngine* engine, const QScriptValue & scr, int delay) : QObject(engine),script(scr)
- {
- startTimer(delay);
- }
- protected:
- void timerEvent(QTimerEvent*)
- {
- if (script.isFunction())
- script.call();
- else if (script.isString())
- script.engine()->evaluate(script.toString());
- }
-
- private:
- QScriptValue script;
-
-};
-
-static QScriptValue _q_deepCopy(const QScriptValue & val)
-{
- if (val.isObject() || val.isArray()) {
- QScriptValue v = val.isArray() ? val.engine()->newArray() : val.engine()->newObject();
- v.setData(val.data());
- QScriptValueIterator it (val);
- while (it.hasNext()) {
- it.next();
- v.setProperty(it.name(), _q_deepCopy(it.value()));
- }
- return v;
- } else
- return val;
-}
-
-
-struct QtScriptedStateMachineFunctions
-{
-static QScriptValue cssTime(QScriptContext *context, QScriptEngine *engine)
-{
- QString str;
- if (context->argumentCount() > 0)
- str = context->argument(0).toString();
- if (str == "") {
- return qScriptValueFromValue(engine,0);
- }
- else if (str.endsWith("ms")) {
- return qScriptValueFromValue(engine,(str.left(str.length()-2).toInt()));
- }
- else if (str.endsWith("s")) {
- return qScriptValueFromValue(engine,(str.left(str.length()-1).toInt())*1000);
- }
- else {
- return qScriptValueFromValue(engine, (str.toInt()));
- }
-}
-static QScriptValue setTimeout(QScriptContext *context, QScriptEngine *engine)
-{
- if (context->argumentCount() < 2)
- return QScriptValue();
- int timeout = context->argument(1).toInt32();
- QtSsmTimer* tmr = new QtSsmTimer(engine,context->argument(0),timeout);
- return engine->newQObject(tmr);
-}
-static QScriptValue script_print(QScriptContext *context, QScriptEngine *)
-{
- if (context->argumentCount() > 0)
- qDebug() << context->argument(0).toString();
- return QScriptValue();
-}
-static QScriptValue clearTimeout(QScriptContext *context, QScriptEngine *)
-{
- if (context->argumentCount() > 0) {
- QObject* obj = context->argument(0).toQObject();
- obj->deleteLater();
- }
- return QScriptValue();
-}
-
-static QScriptValue deepCopy(QScriptContext *context, QScriptEngine *)
-{
- if (context->argumentCount() == 0)
- return QScriptValue();
- else
- return _q_deepCopy(context->argument(0));
-}
-
-static QScriptValue receiveSignal(QScriptContext *context, QScriptEngine *engine)
-{
- QString eventName = context->thisObject().property("e").toString();
- if (!eventName.isEmpty()) {
- QtScriptedStateMachine* ssm = qobject_cast(engine->globalObject().property("SMUTIL_stateMachine").toQObject());
- if (ssm) {
- QStringList pnames;
- QVariantList pvals;
- for (int i=0; i < context->argumentCount(); ++i) {
- pnames << QString::number(i);
- pvals << context->argument(i).toVariant();
- }
- QtScriptedEvent* ev = new QtScriptedEvent(eventName,pnames,pvals,QScriptValue());
- ev->metaData.kind = QtScriptedEvent::MetaData::Platform;
- ssm->postEvent(ev);
- }
- }
- return QScriptValue();
-}
-
-static QScriptValue postEvent(QScriptContext *context, QScriptEngine *engine)
-{
- QtScriptedStateMachine* ssm = qobject_cast(engine->globalObject().property("SMUTIL_stateMachine").toQObject());
- if (ssm) {
- QString eventName,target,type;
- QStringList pnames;
- QVariantList pvals;
- QScriptValue cnt;
- if (context->argumentCount() > 0)
- eventName = context->argument(0).toString();
- if (context->argumentCount() > 1)
- target = context->argument(1).toString();
- if (context->argumentCount() > 2)
- type = context->argument(2).toString();
-
- if (!eventName.isEmpty() || !target.isEmpty()) {
- if (context->argumentCount() > 3)
- qScriptValueToSequence(context->argument(3),pnames);
- if (context->argumentCount() > 4) {
- QScriptValueIterator it (context->argument(4));
- while (it.hasNext()) {
- it.next();
- pvals.append(it.value().toVariant());
- }
- } if (context->argumentCount() > 5)
- cnt = context->argument(5);
- QtScriptedEvent* ev = new QtScriptedEvent(eventName,pnames,pvals,cnt);
- if (type == "scxml" || type == "") {
- bool ok = true;
- if (target == "_internal") {
- ev->metaData.kind = QtScriptedEvent::MetaData::Internal;
- ssm->postInternalEvent(ev);
- } else if (target == "scxml" || target == "") {
- ev->metaData.kind = QtScriptedEvent::MetaData::External;
- ssm->postEvent(ev);
- } else if (target == "_parent") {
- QtSsmInvoker* p = qobject_cast(ssm->parent());
- if (p)
- p->postParentEvent(ev);
- else
- ok = false;
- } else {
- QtScriptedStateMachine* session = QtScriptedStateMachinePrivate::sessions[target];
- if (session) {
- session->postEvent(ev);
- } else
- ok = false;
- }
- if (!ok)
- ssm->postNamedEvent("error.targetunavailable");
-
- } else {
- ssm->postNamedEvent("error.send.typeinvalid");
- }
- }
- }
- return QScriptValue();
-}
-
-// SMUTIL_invoke (type, target, paramNames, paramValues, content)
-static QScriptValue invoke(QScriptContext *context, QScriptEngine *engine)
-{
- QtScriptedStateMachine* ssm = qobject_cast(engine->globalObject().property("SMUTIL_stateMachine").toQObject());
- if (ssm) {
- QString type,target;
- QStringList pnames;
- QVariantList pvals;
- QScriptValue cnt;
- if (context->argumentCount() > 0)
- type = context->argument(0).toString();
- if (type.isEmpty())
- type = "scxml";
- if (context->argumentCount() > 1)
- target = context->argument(1).toString();
- if (context->argumentCount() > 2)
- qScriptValueToSequence(context->argument(2),pnames);
- if (context->argumentCount() > 3) {
- QScriptValueIterator it (context->argument(3));
- while (it.hasNext()) {
- it.next();
- pvals.append(it.value().toVariant());
- }
- } if (context->argumentCount() > 4)
- cnt = context->argument(4);
-
-
-
- QtSsmInvokerFactory* invf = NULL;
- for (int i=0; i < ssm->pvt->invokerFactories.count() && invf == NULL; ++i)
- if (ssm->pvt->invokerFactories[i]->isTypeSupported(type))
- invf = ssm->pvt->invokerFactories[i];
- if (invf) {
- QtScriptedEvent* ev = new QtScriptedEvent("",pnames,pvals,cnt);
- ev->metaData.origin = ssm->baseUrl();
- ev->metaData.target = target;
- ev->metaData.targetType = type;
- ev->metaData.originType = "scxml";
- ev->metaData.kind = QtScriptedEvent::MetaData::External;
- QtSsmInvoker* inv = invf->createInvoker(ev,ssm);
- if (inv)
- inv->activate();
- return engine->newQObject(inv);
- } else {
- ssm->postNamedEvent("error.invalidtargettype");
- }
-
- }
- return QScriptValue();
-}
-
-
-static QScriptValue isInState(QScriptContext *context, QScriptEngine *engine)
-{
- QtScriptedStateMachine* ssm = qobject_cast(engine->globalObject().property("SMUTIL_stateMachine").toQObject());
- if (ssm) {
- if (context->argumentCount() > 0) {
- QString name = context->argument(0).toString();
- if (!name.isEmpty()) {
- QSet cfg = ssm->configuration();
- foreach (QtAbstractState* st, cfg) {
- if (st->objectName() == name)
- return qScriptValueFromValue(engine,true);
- }
- }
- }
- }
- return qScriptValueFromValue(engine,false);
-
-}
-
-};
-/*!
- \class QtScriptedEvent
- \brief The QtScriptedEvent class stands for a general named event with a list of parameter names and parameter values.
-
- Encapsulates an event that conforms to the SCXML definition of events.
-
- \ingroup sctools
-
-*/
-/*! \enum QtScriptedEvent::MetaData::Kind
-
- This enum specifies the kind (or context) of the event.
- \value Platform An event coming from the itself, such as a script error.
- \value Internal An event sent with a or .
- \value External An event sent from an invoker, directly from C++, or from a element.
-*/
-
-/*!
- Returns the name of the event.
- */
- QString QtScriptedEvent::eventName() const
-{
- return ename;
-}
- /*!
- Return a list containing the parameter names.
- */
-QStringList QtScriptedEvent::paramNames () const
-{
- return pnames;
-}
- /*!
- Return a list containing the parameter values.
- */
-QVariantList QtScriptedEvent::paramValues () const
-{
- return pvals;
-}
- /*!
- Return a QtScript object that can be passed as an additional parameter.
- */
-QScriptValue QtScriptedEvent::content () const
-{
- return cnt;
-}
- /*!
- Returns the parameter value equivalent to parameter \a name.
- */
-QVariant QtScriptedEvent::param (const QString & name) const
-{
- int idx = pnames.indexOf(name);
- if (idx >= 0)
- return pvals[idx];
- else
- return QVariant();
-}
-/*!
- Creates a QtScriptedEvent named \a name, with parameter names \a paramNames, parameter values \a paramValues, and
- a QtScript object \a content as an additional parameter.
-*/
-QtScriptedEvent::QtScriptedEvent(
- const QString & name,
- const QStringList & paramNames,
- const QVariantList & paramValues,
- const QScriptValue & content)
-
- : QEvent(QtScriptedEvent::eventType()),ename(name),pnames(paramNames),pvals(paramValues),cnt(content)
-{
- metaData.kind = MetaData::Internal;
-}
-
-/*! \class QtScriptedTransition
- \brief The QtScriptedTransition class stands for a transition that responds to QtScriptedEvent, and can be made conditional with a \l conditionExpression.
- Equivalent to the SCXML transition tag.
-
- \ingroup sctools
- */
-/*! \property QtScriptedTransition::eventPrefix
- The event prefix to be used when testing if the transition needs to be invoked.
- Uses SCXML prefix matching. Use * to handle any event.
- */
-/*! \property QtScriptedTransition::conditionExpression
- A QtScript expression that's evaluated to test whether the transition needs to be invoked.
- */
-
-/*!
- Creates a new QtScriptedTransition from \a state, that uses \a machine to evaluate the conditions.
- */
-QtScriptedTransition::QtScriptedTransition (QtState* state,QtScriptedStateMachine* machine)
- : QtTransition(state),ssm(machine)
-{
-}
-
-/*!
- \internal
- */
-bool QtScriptedTransition::eventTest(QEvent *e) const
-{
- QScriptEngine* engine = ssm->scriptEngine();
- QString ev;
-
- if (e) {
- if (e->type() == QtScriptedEvent::eventType()) {
- ev = ((QtScriptedEvent*)e)->eventName();
- } else if (e->type() == QEvent::Type(QEvent::User-2)) {
- ev = QString("done.state.") + ((QtStateFinishedEvent*)e)->state()->objectName();
- }
- if (!(eventPrefix() == "*" || eventPrefix() == ev || ev.startsWith(eventPrefix()+".")))
- return false;
- }
-
-
- if (!conditionExpression().isEmpty()) {
-
- QScriptValue v = engine->evaluate(conditionExpression(),ssm->baseUrl().toLocalFile());
- if (engine->hasUncaughtException()) {
-
- qDebug() << engine->uncaughtException().toString();
- QtScriptedEvent* e = new QtScriptedEvent("error.illegalcond",
- QStringList()<< "error" << "expr" << "line" << "backtrace",
- QVariantList()
- << QVariant(engine->uncaughtException().toString())
- << QVariant(conditionExpression())
- << QVariant(engine->uncaughtExceptionLineNumber())
- << QVariant(engine->uncaughtExceptionBacktrace()));
- e->metaData.kind = QtScriptedEvent::MetaData::Platform;
- ssm->postEvent(e);
- engine->clearExceptions();
- return false;
- }
- return v.toBoolean();
- }
-
- return true;
-}
-
-class QtSsmDefaultInvoker : public QtSsmInvoker
-{
- Q_OBJECT
-
- public:
- QtSsmDefaultInvoker(QtScriptedEvent* ievent, QtScriptedStateMachine* p) : QtSsmInvoker(ievent,p),childSm(0)
- {
- childSm = QtScriptedStateMachine::load (ievent->metaData.origin.resolved(ievent->metaData.target).toLocalFile(),this);
- if (childSm == NULL) {
- postParentEvent("error.targetunavailable");
- } else {
- connect(childSm,SIGNAL(finished()),this,SLOT(deleteLater()));
-
- }
-
- }
-
- static void initInvokerFactory(QtScriptedStateMachine*) {}
-
- static bool isTypeSupported(const QString & t) { return t.isEmpty() || t.toLower() == "scxml"; }
-
- public Q_SLOTS:
- void activate ()
- {
- if (childSm)
- childSm->start();
- }
-
- void cancel ()
- {
- if (childSm)
- childSm->stop();
-
- }
-
- private:
- QtScriptedStateMachine* childSm;
-};
-class QtSsmBindingInvoker : public QtSsmInvoker
-{
- Q_OBJECT
- QScriptValue content;
- QScriptValue stored;
-
- public:
- QtSsmBindingInvoker(QtScriptedEvent* ievent, QtScriptedStateMachine* p) : QtSsmInvoker(ievent,p)
- {
- }
-
- static void initInvokerFactory(QtScriptedStateMachine*) {}
-
- static bool isTypeSupported(const QString & t) { return t.toLower() == "q-bindings"; }
-
- public Q_SLOTS:
- void activate ()
- {
- QScriptEngine* engine = ((QtScriptedStateMachine*)parent())->scriptEngine();
- QScriptValue content = initEvent->content();
- if (content.isArray()) {
- stored = content.engine()->newArray(content.property("length").toInt32());
-
- QScriptValueIterator it (content);
- for (int i=0; it.hasNext(); ++i) {
- it.next();
- if (it.value().isArray()) {
- QScriptValue object = it.value().property(0);
- QString property = it.value().property(1).toString();
- QScriptValue val = it.value().property(2);
- QScriptValue arr = engine->newArray(3);
- arr.setProperty("0",it.value().property(0));
- arr.setProperty("1",it.value().property(1));
- if (object.isQObject()) {
- QObject* o = object.toQObject();
- arr.setProperty("2",engine->newVariant(o->property(property.toAscii().constData())));
- o->setProperty(property.toAscii().constData(),val.toVariant());
- } else if (object.isObject()) {
- arr.setProperty("2",object.property(property));
- object.setProperty(property,val);
- }
- stored.setProperty(i,arr);
- }
- }
- }
- }
-
- void cancel ()
- {
- if (stored.isArray()) {
- QScriptValueIterator it (stored);
- while (it.hasNext()) {
- it.next();
- if (it.value().isArray()) {
- QScriptValue object = it.value().property(0);
- QString property = it.value().property(1).toString();
- QScriptValue val = it.value().property(2);
- if (object.isQObject()) {
- QObject* o = object.toQObject();
- o->setProperty(property.toAscii().constData(),val.toVariant());
- } else if (object.isObject()) {
- object.setProperty(property,val);
- }
- }
- }
- }
- }
-};
-
-/*!
-\fn QtSsmInvoker::~QtSsmInvoker()
-*/
-
-
-/*!
-\fn QtScriptedStateMachine::eventTriggered(const QString & name)
-
-This signal is emitted when external event \a name is handled in the state machine.
-*/
-
-/*!
- Creates a new QtScriptedStateMachine object, with parent \a parent.
- */
-
-QtScriptedStateMachine::QtScriptedStateMachine(QObject* parent)
- : QtStateMachine(parent)
-{
- pvt = new QtScriptedStateMachinePrivate;
- pvt->scriptEng = new QScriptEngine(this);
- QScriptValue glob = pvt->scriptEng->globalObject();
- QScriptValue utilObj = pvt->scriptEng->newObject();
- glob.setProperty("SMUTIL_clone",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::deepCopy));
- glob.setProperty("In",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::isInState));
- glob.setProperty("_rcvSig",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::receiveSignal));
- glob.setProperty("print",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::script_print));
- glob.setProperty("SMUTIL_postEvent",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::postEvent));
- glob.setProperty("SMUTIL_invoke",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::invoke));
- glob.setProperty("SMUTIL_cssTime",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::cssTime));
- glob.setProperty("SMUTIL_stateMachine",pvt->scriptEng->newQObject(this));
- glob.setProperty("setTimeout",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::setTimeout));
- glob.setProperty("clearTimeout",pvt->scriptEng->newFunction(QtScriptedStateMachineFunctions::clearTimeout));
- QScriptValue dmObj = pvt->scriptEng->newObject();
- glob.setProperty("_data",pvt->scriptEng->newObject());
- glob.setProperty("_global",pvt->scriptEng->globalObject());
- glob.setProperty("connectSignalToEvent",pvt->scriptEng->evaluate("function(sig,ev) {sig.connect({'e':ev},_rcvSig);}"));
- static QtSsmAutoInvokerFactory _s_defaultInvokerFactory;
- static QtSsmAutoInvokerFactory _s_bindingInvokerFactory;
- registerInvokerFactory(&_s_defaultInvokerFactory);
- registerInvokerFactory(&_s_bindingInvokerFactory);
- connect(this,SIGNAL(started()),this,SLOT(registerSession()));
- connect(this,SIGNAL(stopped()),this,SLOT(unregisterSession()));
-#ifdef QT_GUI_LIB
- static QtSsmAutoInvokerFactory _s_msgboxInvokerFactory;
- static QtSsmAutoInvokerFactory _s_menuInvokerFactory;
- registerInvokerFactory(&_s_msgboxInvokerFactory);
- registerInvokerFactory(&_s_menuInvokerFactory);
-#endif
-}
-
-/*! \internal */
-void QtScriptedStateMachine::beginSelectTransitions(QEvent* ev)
-{
- QScriptValue eventObj = pvt->scriptEng->newObject();
- if (ev) {
- if (ev->type() == QtScriptedEvent::eventType()) {
- QtScriptedEvent* se = (QtScriptedEvent*)ev;
- eventObj.setProperty("name",qScriptValueFromValue(pvt->scriptEng,se->eventName()));
- eventObj.setProperty("target",qScriptValueFromValue(pvt->scriptEng,QVariant::fromValue(se->metaData.target)));
- eventObj.setProperty("targettype",qScriptValueFromValue(pvt->scriptEng,se->metaData.targetType));
- eventObj.setProperty("invokeid",qScriptValueFromValue(pvt->scriptEng,se->metaData.invokeID));
- eventObj.setProperty("origin",QScriptValue(qScriptValueFromValue(pvt->scriptEng,QVariant::fromValue(se->metaData.origin))));
- eventObj.setProperty("originType",qScriptValueFromValue(pvt->scriptEng,se->metaData.originType));
- switch (se->metaData.kind) {
- case QtScriptedEvent::MetaData::Internal:
- eventObj.setProperty("kind",qScriptValueFromValue(pvt->scriptEng, "internal"));
- break;
- case QtScriptedEvent::MetaData::External:
- eventObj.setProperty("kind",qScriptValueFromValue(pvt->scriptEng, "external"));
- break;
- case QtScriptedEvent::MetaData::Platform:
- eventObj.setProperty("kind",qScriptValueFromValue(pvt->scriptEng, "platform"));
- default:
- break;
-
- }
-
- QScriptValue dataObj = pvt->scriptEng->newObject();
- int i=0;
- foreach (QString s, se->paramNames()) {
- QScriptValue v = qScriptValueFromValue(pvt->scriptEng, se->paramValues()[i]);
- dataObj.setProperty(QString::number(i),v);
- dataObj.setProperty(s,v);
- ++i;
- }
- eventObj.setProperty("data",dataObj);
- emit eventTriggered(se->eventName());
- } else if (ev->type() == QEvent::Type(QEvent::User-2)) {
- QString n = QString("done.state.")+((QtStateFinishedEvent*)ev)->state()->objectName();
- eventObj.setProperty("name",qScriptValueFromValue(pvt->scriptEng, n));
- emit eventTriggered(n);
- }
- }
- scriptEngine()->globalObject().setProperty("_event",eventObj);
-
- QHash curTargets;
-
- for (int i = pvt->snapshotStack.size()-1; i >= 0 && curTargets.size() < pvt->anchorTransitions.keys().size(); --i) {
- if (!curTargets.contains(pvt->snapshotStack.at(i).anchorType)) {
- curTargets[pvt->snapshotStack.at(i).anchorType] = pvt->snapshotStack.at(i).state;
- }
- }
- for (QMultiHash::const_iterator it = pvt->anchorTransitions.constBegin(); it != pvt->anchorTransitions.constEnd(); ++it) {
- it.value()->setTargetState(curTargets[it.key()]);
- }
-
-}
-
-/*! \internal */
-void QtScriptedStateMachine::endMicrostep(QEvent*)
-{
- scriptEngine()->globalObject().setProperty("_event",QScriptValue());
- for (QHash::iterator
- it = pvt->curSnapshot.begin();
- it != pvt->curSnapshot.end(); ++it) {
-
- pvt->snapshotStack.push(it.value());
-
- }
- if (pvt->snapshotStack.size() > QtScriptedStateMachinePrivate::MaxSnapshots) {
- pvt->snapshotStack.remove(0,pvt->snapshotStack.size()-100);
- }
- pvt->curSnapshot.clear();
-}
-
-/*! Returns the script engine attached to the state-machine. */
-QScriptEngine* QtScriptedStateMachine::scriptEngine () const
-{
- return pvt->scriptEng;
-}
-
-/*!
- Registers object \a o to the script engine attached to the state machine.
- The object can be accessible from global variable \a name. If \a name is not provided,
- the object's name is used. If \a recursive is true, all the object's decendants are registered
- as global objects, with their respective object names as variable names.
-*/
-void QtScriptedStateMachine::registerObject (QObject* o, const QString & name, bool recursive)
-{
- QString n(name);
- if (n.isEmpty())
- n = o->objectName();
- if (!n.isEmpty())
- pvt->scriptEng->globalObject().setProperty(n,pvt->scriptEng->newQObject(o));
- if (recursive) {
- QObjectList ol = o->findChildren();
- foreach (QObject* oo, ol) {
- if (!oo->objectName().isEmpty())
- registerObject(oo);
- }
- }
-}
-
-/*!
- Posts a QtScriptedEvent named \a event, with no payload.
- \sa QtScriptedEvent
- */
-void QtScriptedStateMachine::postNamedEvent(const QString & event)
-{
- QtScriptedEvent* e = new QtScriptedEvent(event);
- e->metaData.kind = QtScriptedEvent::MetaData::External;
- postEvent(e);
-}
-/*!
- Executes script \a s in the attached script engine.
- If the script fails, a "error.illegalvalue" event is posted to the state machine.
-*/
-
-void QtScriptedStateMachine::executeScript (const QString & s)
-{
- pvt->scriptEng->evaluate (s,baseUrl().toLocalFile());
- if (pvt->scriptEng->hasUncaughtException()) {
- QtScriptedEvent* e = new QtScriptedEvent("error.illegalvalue",
- QStringList()<< "error" << "expr" << "line" << "backtrace",
- QVariantList()
- << QVariant(pvt->scriptEng->uncaughtException().toString())
- << QVariant(s)
- << QVariant(pvt->scriptEng->uncaughtExceptionLineNumber())
- << QVariant(pvt->scriptEng->uncaughtExceptionBacktrace()));
- e->metaData.kind = QtScriptedEvent::MetaData::Platform;
- postEvent(e);
- pvt->scriptEng->clearExceptions();
- }
-}
-
-/*!
- Enabled invoker factory \a f to be called from tags.
- */
-
-void QtScriptedStateMachine::registerInvokerFactory (QtSsmInvokerFactory* f)
-{
- pvt->invokerFactories << f;
- f->init(this);
-}
-
-/*! \class QtSsmInvoker
- \brief The QtSsmInvoker class an invoker, which the state-machine context can activate or cancel
- with an tag.
-
- \ingroup sctools
-
- An invoker is a object that represents an external component that the state machine
- can activate when the encompassing state is entered, or cancel when the encompassing
- state is exited from.
- */
-
-/*! \fn QtSsmInvoker::QtSsmInvoker(QtScriptedEvent* ievent, QtStateMachine* parent)
- When reimplementing the constructor, always use the two parameters (\a ievent and \a parent),
- as they're called from QtSsmInvokerFactory.
-*/
-
-/*! \fn QtSsmInvoker::activate()
- This function is called when the encompassing state is entered.
- The call to this function from the state-machine context is asynchronous, to make sure
- that the state is not exited during the same step in which it's entered.
-
-*/
-
-/*! \fn QtSsmInvoker::cancel()
- Reimplement this function to allow for asynchronous cancellation of the invoker.
- It's the invoker's responsibility to delete itself after this function has been called.
- The default implementation deletes the invoker.
-*/
-
-/*! \fn QtScriptedStateMachine* QtSsmInvoker::parentStateMachine()
- Returns the state machine encompassing the invoker.
- */
-
-/*!
- Posts an event \a e to the state machine encompassing the invoker.
- */
-void QtSsmInvoker::postParentEvent (QtScriptedEvent* e)
-{
- e->metaData.origin = initEvent->metaData.target;
- e->metaData.target = initEvent->metaData.origin;
- e->metaData.originType = initEvent->metaData.targetType;
- e->metaData.targetType = initEvent->metaData.originType;
- e->metaData.kind = QtScriptedEvent::MetaData::External;
- e->metaData.invokeID = initEvent->metaData.invokeID;
- parentStateMachine()->postEvent(e);
-}
-/*! \overload
- Posts a QtScriptedEvent named \a e to the encompassing state machine.
- */
-void QtSsmInvoker::postParentEvent(const QString & e)
-{
- QtScriptedEvent* ev = new QtScriptedEvent(e);
- ev->metaData.kind = QtScriptedEvent::MetaData::External;
- postParentEvent(ev);
-}
-/*! \internal */
-QtScriptedStateMachine::~QtScriptedStateMachine()
-{
- delete pvt;
-}
-
-QtSsmInvoker::~QtSsmInvoker()
-{
- postParentEvent("CancelResponse");
-}
-/*!
- \property QtScriptedStateMachine::baseUrl
- The url used to resolve scripts and invoke urls.
-*/
-QUrl QtScriptedStateMachine::baseUrl() const
-{
- return pvt->burl;
-}
-
-void QtScriptedStateMachine::setBaseUrl(const QUrl & u)
-{
- pvt->burl = u;
-}
-
-void QtScriptedStateMachine::registerSession()
-{
- pvt->sessionID = QUuid::createUuid().toString();
- pvt->sessions[pvt->sessionID] = this;
- pvt->scriptEng->globalObject().setProperty("_sessionid",qScriptValueFromValue(scriptEngine(), pvt->sessionID));
- executeScript(pvt->startScript);
-}
-
-void QtScriptedStateMachine::unregisterSession()
-{
- pvt->scriptEng->globalObject().setProperty("_sessionid",QScriptValue());
- pvt->sessions.remove(pvt->sessionID);
-}
-
-/*!
- Returns a statically-generated event type to be used by SCXML events.
-*/
-QEvent::Type QtScriptedEvent::eventType()
-{
- static QEvent::Type _t = (QEvent::Type)QEvent::registerEventType(QEvent::User+200);
- return _t;
-}
-const char SCXML_NAMESPACE [] = "http://www.w3.org/2005/07/scxml";
-
-
-
-struct ScTransitionInfo
-{
-
- QtScriptedTransition* transition;
- QStringList targets;
- QString anchor;
- QtStateAction* action;
- ScTransitionInfo() : action(0) {}
-};
-
-struct ScStateInfo
-{
- QString initial;
-};
-
-struct ScHistoryInfo
-{
- QtHistoryState* hstate;
- QString defaultStateID;
-};
-
-struct ScExecContext
-{
- QtScriptedStateMachine* sm;
- QString script;
- enum {None, StateEntry,StateExit,Transition } type;
- QtScriptedTransition* trans;
- QtActionState* state;
- ScExecContext() : sm(NULL),type(None),trans(NULL),state(NULL)
- {
- }
-
- void applyScript()
- {
- if (!script.isEmpty()) {
- QtStateAction* a = new QtStateInvokeMethodAction(sm,"executeScript",QVariantList()<