diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..b39d117b6
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2020 Martín Lucas Golini
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/README.md b/README.md
index 31bb15558..8cc6d1a77 100644
--- a/README.md
+++ b/README.md
@@ -233,7 +233,8 @@ UITextView::New()->setText( "Text on test 1" )
Element styling can be done with a custom implementation of Cascading Style
Sheets, most common CSS2 rules are available, plus several CSS3 rules (some
-examples: [transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions),
+examples: [animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/),
+[transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions),
[custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties),
[media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries),
[@font-face at rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face),
@@ -522,8 +523,6 @@ Keep improving the UI system, adding new widgets and layouts and improving the C
Simplify and improve the UI widgets skinning/theming support.
-Add [CSS animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations) support.
-
Improve/create documentation for the UI module.
Add more examples and some tools.
@@ -532,7 +531,7 @@ Add Scripting support ( first I would like to stabilize the library, but I'm get
Add 2D skeletal animations support ( probably Spine2D, shouldn't be much work to implement ).
-Probably deprecate the Maps module, since i will focus my efforts on the UI system.
+Probably deprecate the Maps module, since I will focus my efforts on the UI system.
## Acknowledgements
diff --git a/bin/assets/layouts/test.css b/bin/assets/layouts/test.css
index 84c645438..0c9c65c8a 100644
--- a/bin/assets/layouts/test.css
+++ b/bin/assets/layouts/test.css
@@ -184,7 +184,7 @@ CheckBox:checked {
background-color: #221122;
}
to {
- background-color: #332233;
+ background-color: #110011;
}
}
@@ -456,6 +456,16 @@ TabWidget {
animation: 0.5s infinite alternate pulse;
}
+#rttv {
+ animation: 0.5s infinite alternate paused ease-in pulse;
+}
+
+#rttv:hover {
+ /** This rule should be ignored. */
+ foreground-color: red;
+ animation-play-state: running;
+}
+
@media screen and (max-width: 1024px) {
#lvbox {
diff --git a/docs/articles/uiintroduction.md b/docs/articles/uiintroduction.md
index 3762f70a3..99537c638 100644
--- a/docs/articles/uiintroduction.md
+++ b/docs/articles/uiintroduction.md
@@ -1,30 +1,27 @@
-UI Introduction
-===============
+# UI Introduction
+## Introduction
-Introduction
-------------
eepp UI is designed to be flexible and efficient. Inspired in
[Android Layouts structure](https://developer.android.com/guide/topics/ui/declaring-layout)
and [CSS standards](https://developer.mozilla.org/en-US/docs/Web/CSS).
It's still a work in progress so several features are still not stable, but
already provides a very solid foundation to create rich and interactive UIs.
+## Layout
-Layout
-------
A layout defines the structure for a user interface in your app.
For constructing layouts in eepp we have two options: instantiate layout
elements at runtime or declare UI elements in XML.
- * **Declare UI elements in XML.** eepp provides a straightforward XML
- vocabulary that corresponds to the UI Widget classes and subclasses.
- There are two kinds of widgets: normal widgets and layouts. The difference
- between this two is that layouts are the ones in charge of arranging their
- child in a particular way.
+* **Declare UI elements in XML.** eepp provides a straightforward XML
+vocabulary that corresponds to the UI Widget classes and subclasses.
+There are two kinds of widgets: normal widgets and layouts. The difference
+between this two is that layouts are the ones in charge of arranging their
+child in a particular way.
- * **Instantiate layout elements at runtime.** Your app can create Widget and
- Layout objects (and manipulate their properties) programmatically.
+* **Instantiate layout elements at runtime.** Your app can create Widget and
+Layout objects (and manipulate their properties) programmatically.
Declaring your UI in XML allows you to separate the presentation of your app
from the code that controls its behavior. Using XML files in conjunction with
@@ -35,9 +32,8 @@ The framework gives you the flexibility to use either or both of these methods
to build your app's UI. For example, you can declare your app's default
layouts in XML, and then modify the layout at runtime.
+## Write the XML
-Write the XML
--------------
Using eepp XML vocabulary, you can quickly design UI layouts and the screen
elements they contain, in the same way you create web pages in HTML — with a
series of nested elements.
@@ -67,9 +63,8 @@ and a EE::UI::UIPushButton:
After you've declared your layout in XML, save the file with the `.xml`
extension into a project accessible path and you're done.
+## Initializing the UI
-Initializing the UI
--------------------
The library does not assume that the user is going to use the UI at all, so you
must initialize it manually. This usually comes right after the main
EE::Window::Window initialization.
@@ -79,6 +74,7 @@ EE::UI::UISceneNode. Setting the font as the default scene node. And finally,
adding this scene node to the EE::Scene::SceneManager.
For example:
+
```cpp
// ... after window creation
// Load a font to use as the default font in our UI.
@@ -98,13 +94,13 @@ SceneManager::instance()->add( uiSceneNode );
And that's all we need for a basic initialization.
+## Updating the UI
-Updating the UI
----------------
Updating the UI consist in two simple steps: updating and drawing the UI scene
node contained by the EE::Scene::SceneManager.
So we just need to do in our main loop:
+
```cpp
// Update the UI scene
SceneManager::instance()->update();
@@ -130,9 +126,8 @@ the scene on every update or only when is needed. There are several options
regarding this topic, since each scene node can be drawn into a separated
frame buffer, in order to be able to control when to redraw a scene.
+## Load the XML Layout Resource
-Load the XML Layout Resource
-----------------------------
XML layout resources can be loaded from any file system path,
EE::UI::Pack accessible path or a hard-coded string.
@@ -142,6 +137,7 @@ root scene node will be used.
Following the [Write the XML](#write-the-xml) layout and the
[Initializing the UI](#initializing-the-ui) code:
+
```cpp
uiSceneNode->loadLayoutFromString( R"xml(
loadLayoutFromString( R"xml(
This will load and create the widgets into the root element of the UI scene
node.
+## Cascading Style Sheets
-Cascading Style Sheets
-----------------------
[CSS (Cascading Style Sheets)](https://developer.mozilla.org/en-US/docs/Web/CSS)
is the code you use to style the UI. It's very heavily based on the
[CSS 2.1](https://www.w3.org/TR/CSS21/) standards with a good amount of CSS 3
features. Some of the main current differences are: eepp CSS properties don't
-support inheritance (except for
-[Custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties),
+support inheritance (except for the case
+[custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties),
and `*` is supported), eepp also adds new properties oriented to decoration
related and layout control stuffs, and CSS layout properties differ from the
-standard since we use a different layout model. But you can learn how style the
+standard since we use a different layout model. But you can learn how to style the
UI following the CSS standards and then reading about the specific eepp UI
features.
Important CSS3 features that are currently supported:
- * [Transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions)
+* [Animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/)
- * [Custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)
+* [Transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions)
- * [Media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries)
+* [Custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)
- * [@font-face at rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face)
+* [Media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries)
- * [:root element](https://developer.mozilla.org/en-US/docs/Web/CSS/:root)
+* [@font-face at rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face)
- * [Most of the background properties](https://developer.mozilla.org/en-US/docs/Web/CSS/background)
+* [:root element](https://developer.mozilla.org/en-US/docs/Web/CSS/:root)
+* [Most of the background properties](https://developer.mozilla.org/en-US/docs/Web/CSS/background)
+
+## Write the CSS
-Write the CSS
--------------
Following [Load the XML Layout Resource](#load-the-xml-layout-resource) we are
going to write a very simple style to our UI. In order to that we can create a
new CSS file (with `.css` extension) in our file system and save it in an
@@ -200,6 +196,7 @@ accesible path to our project, or we can simply write the CSS in a string in our
code.
This is how our CSS could look like:
+
```css
* {
font-size: 22dp;
@@ -223,8 +220,8 @@ pixel](https://en.wikipedia.org/wiki/Device-independent_pixel), that allow us to
keep our layout consistent between different screen densities. This concept was
taken from the [Android pixel density implementation](https://developer.android.com/guide/practices/screens_support.html#density).
-Loading the CSS Resource
-------------------------
+## Loading the CSS Resource
+
Following [Load the XML Layout Resource](#load-the-xml-layout-resource) and
[Write the CSS](#write-the-css) we are going to load our CSS from a string:
@@ -252,13 +249,14 @@ To load a CSS from a file we need to first parse it with the
EE::UI::CSS::StyleSheetParser.
It will look like:
+
```cpp
CSS::StyleSheetParser parser;
parser.loadFromFile( "path/to/our/stylesheet.css" );
uiSceneNode->setStyleSheet( parser.getStyleSheet() );
```
-Example
--------
+## Example
+
For a complete example of this introduction you can look into:
[src/examples/ui_hello_world/ui_hello_world.cpp](https://github.com/SpartanJ/eepp/blob/develop/src/examples/ui_hello_world/ui_hello_world.cpp).
diff --git a/include/eepp/scene/actionmanager.hpp b/include/eepp/scene/actionmanager.hpp
index a30cea45f..488f88763 100644
--- a/include/eepp/scene/actionmanager.hpp
+++ b/include/eepp/scene/actionmanager.hpp
@@ -49,7 +49,6 @@ class EE_API ActionManager {
protected:
std::list mActions;
std::list mActionsRemoveList;
- Mutex mMutex;
bool mUpdating;
};
diff --git a/include/eepp/scene/node.hpp b/include/eepp/scene/node.hpp
index 0b48eb35d..f9e1c58e5 100644
--- a/include/eepp/scene/node.hpp
+++ b/include/eepp/scene/node.hpp
@@ -329,7 +329,7 @@ class EE_API Node : public Transformable {
bool invalidated() const;
- void invalidate();
+ virtual void invalidate( Node* invalidator );
Uint32 getChildCount() const;
diff --git a/include/eepp/ui/css/animationdefinition.hpp b/include/eepp/ui/css/animationdefinition.hpp
index 315ce595c..0033eab60 100644
--- a/include/eepp/ui/css/animationdefinition.hpp
+++ b/include/eepp/ui/css/animationdefinition.hpp
@@ -4,7 +4,7 @@
#include
#include
#include
-#include
-
+
-
+
-
+
-
+
-