diff --git a/build b/build
index 0e6c61e2..2ab328a1 160000
--- a/build
+++ b/build
@@ -1 +1 @@
-Subproject commit 0e6c61e2ed2dafa6bc6eaa67df095808f56c5bb4
+Subproject commit 2ab328a164b3c4b39df2f9b93fa0da64faf98783
diff --git a/doc/tutorial/000_Build.bb b/doc/tutorial/000_Build.bb
index d79d7485..e81c1b1a 100644
--- a/doc/tutorial/000_Build.bb
+++ b/doc/tutorial/000_Build.bb
@@ -102,3 +102,9 @@ It will create a tree like this :
:::** souces
::::** ewol
::** example
+::** youApplication_1
+::** youApplication_2
+::** youOtherLib_1
+::** youOtherLib_2
+::** out
+
diff --git a/doc/tutorial/001_HelloWord.bb b/doc/tutorial/001_HelloWord.bb
index 96a97f68..127942a2 100644
--- a/doc/tutorial/001_HelloWord.bb
+++ b/doc/tutorial/001_HelloWord.bb
@@ -1,6 +1,6 @@
=?= Tutorial 1: Hello Word =?=
__________________________________________________
-[left][tutorial[000_Build | Previous: Download & Build]][/left] [right][tutorial[002_HelloWord | Next: Hello Word]][/right]
+[left][tutorial[000_Build | Previous: Download & Build]][/left] [right][tutorial[010_ObjectModel | Next: Object model]][/right]
=== Objectif ===
:** Understand basis of ewol
@@ -8,18 +8,13 @@ __________________________________________________
=== Application Sources: ===
-==== Main Windows: ====
-
-==== Application "main()": ====
-
-=== Build declaration: ===
+==== Application Main: ====
-=== Build your application ===
-
-
-
-In all the application we need to have a main, for some reason this main is stored by the application and only call the EWOL main:
+In all the application we need to have a main()
+In This version the main neen only to call the ewol::run(void) that is the basic interface.
+To be portable on Android, that have a java main the User might not set other things in this main.
+[note]This basic main will change in the future to be more generic!!![/note]
[code style=c++]
int main(int argc, const char *argv[]) {
@@ -28,7 +23,7 @@ In all the application we need to have a main, for some reason this main is stor
}
[/code]
-Then the first question, is where is the input of the application:
+Then the first question, is where is the start and stop of the application:
[code style=c++]
// application start:
@@ -37,28 +32,41 @@ Then the first question, is where is the input of the application:
}
// application stop:
void APP_UnInit(ewol::Context& _context) {
+ // nothing to do.
}
[/code]
The input [class[ewol::eContext]] is the main application context.
-All the application globals have a reference in this element.
-It is important to note that the system can call you some time in parallele, the basic exemple of this is the Wallpaper on Android.
+All the application globals have a reference in this element (and can get it everyware).
+[note]
+It is important to know that the system can call your application in parallele, the basic exemple of this is the Wallpaper on Android.
When selected, it create an intance and when it is apply Android create a new instance and remove the previous one...
+[/note]
+
+==== Some configuration are needed ====
+
+In your application you can use many configuration,
+none of them are set in static for compilation and interface reason,
+then you will to set it on dynamic.
+Select fonts:
-Now we will create some generic property:
+This can be a problem when you design an application for some other operating system (OS),
+They do not have the same default font.
-In first: set the font availlagle on the global font property (system font).
-This can be a problem when you designe an application for some other operating system (OS), They do not have the same default font.
-and we select an order to search the font names and the system basic size.
+And we select an order to search the font names and the system basic size.
[code style=c++]
+ // Use External font depending on the system (for specific application, it is better to provide fonts)
_context.getFontDefault().setUseExternal(true);
+ // Select font in order you want : if Ewol find FreeSerif, it selected it ...
_context.getFontDefault().set("FreeSerif;DejaVuSansMono", 19);
[/code]
-In second: we will create a windows.
+==== Main Windows: ====
+
+Create the main Windows:
For this point we will create a class that herited form the basic windows class:
@@ -73,7 +81,7 @@ For this point we will create a class that herited form the basic windows class:
class Windows : public ewol::widget::Windows {
public:
Windows(void);
- public:
+ virtual ~Windows(void) {};
};
};
#endif
@@ -95,7 +103,7 @@ For this point we will create a class that herited form the basic windows class:
if (NULL == tmpWidget) {
APPL_ERROR("Can not allocate widget ==> display might be in error");
} else {
- tmpWidget->setLabel("Hello Word");
+ tmpWidget->setLabel("Hello Word");
tmpWidget->setExpand(bvec2(true,true));
setSubWidget(tmpWidget);
}
@@ -125,8 +133,12 @@ I will take a really long time to create a real html parser, the the availlable
:** [b] ... [/b] : Set the text on the right.
:** [b] ... [/b] : Set the text mode in justify.
-[note] The xml parser is a little strict on the case and end node, but it support to not have a main node.[/note]
-
+[note]
+The xml parser is a little strict on the case and end node (!! !!),
+but it support to:
+:** Not have a main node.
+:** replace '"' with ''' to simplify xml writing in C code.
+[/note]
The last step is to add the widget on the windows :
[code style=c++]
@@ -134,6 +146,8 @@ The last step is to add the widget on the windows :
[/code]
+==== Configure Ewol to have display the windows ====
+
At this point we have created the basic windows.
But the system does not know it.
Then we create windows and set it in the main contect main (in the APPL_init()):
@@ -143,7 +157,6 @@ Then we create windows and set it in the main contect main (in the APPL_init()):
_context.setWindows(basicWindows);
[/code]
-
Then the init fuction is :
[code style=c++]
bool APP_Init(ewol::Context& _context) {
@@ -165,3 +178,101 @@ void APP_UnInit(ewol::Context& _context) {
// The main windows will be auto-remove after this call if it is not done...
}
[/code]
+
+
+[note]
+You can use many windows and select the one you want to display, but I do not think it is the best design.
+[/note]
+
+=== Build declaration: ===
+
+ewol commonly use the [b]lutin.py[/b] build system.
+
+Then we need to add a "lutin_YourApplicationName.py", then for this example: [b]lutin_001_HelloWord.py[/b]
+
+
+[code style=python]
+#!/usr/bin/python
+import lutinModule as module
+import lutinTools as tools
+
+# optionnal : Describe in the "lutin.py --help"
+def get_desc():
+ return "Tutorial 001 : Hello Word"
+
+# Module creation instance (not optionnal)
+def create(target):
+ # module name is '001_HelloWord' and type binary.
+ myModule = module.Module(__file__, '001_HelloWord', 'BINARY')
+ # add the file to compile:
+ myModule.add_src_file([
+ 'appl/Main.cpp',
+ 'appl/debug.cpp',
+ 'appl/Windows.cpp',
+ ])
+ # add Library dependency name
+ myModule.add_module_depend(['ewol'])
+ # add application C flags
+ myModule.compile_flags_CC([
+ "-DPROJECT_NAME=\"\\\""+myModule.name+"\\\"\""])
+ # Add current include Path
+ myModule.add_path(tools.get_current_path(__file__))
+ return the created module
+ return myModule
+[/code]
+
+show lutin doc for more information...
+
+[note]
+I do not explain again the lutin file, for next tutorial, show example sources ...
+[/note]
+
+=== Build your application ===
+
+go to your workspace folder and launch
+[code style=shell]
+ ./ewol/build/lutin.py -C -mdebug -p 001_HelloWord
+[/code]
+
+Your program example will build correctly...
+
+Launch it :
+[code style=shell]
+ ./out/Linux/debug/staging/gcc/001_HelloWord/usr/bin/001_HelloWord -l6
+[/code]
+
+The [b]-l6[/b] is used to specify the Log level of the application display (this log is synchronous)
+
+The output compile in a separate folder depending on the compilation tool (gcc or clang)
+
+It create a complete final tree in the ./out/Linux/debug/staging/gcc/001_HelloWord/ folder
+
+The final folder contain the package generated
+
+tree of the output
+:** out
+::** MacOs
+::** Android
+::** Windows
+::** ...
+::** Linux
+:::** release
+:::** debug
+::::** build
+:::::** clang
+:::::** gcc
+::::::** ewol
+::::::** exml
+::::::** ejson
+::::::** 001_HelloWord
+::::::** ...
+::::** staging
+:::::** clang
+:::::** gcc
+::::::** 001_HelloWord
+:::::::** usr
+::::::::** bin
+::::::::** share
+::::** final
+:::::** 001_HelloWord.deb
+
diff --git a/doc/tutorial/010_ObjectModel.bb b/doc/tutorial/010_ObjectModel.bb
new file mode 100644
index 00000000..82d57996
--- /dev/null
+++ b/doc/tutorial/010_ObjectModel.bb
@@ -0,0 +1,135 @@
+=?= Tutorial 2: Object Model =?=
+__________________________________________________
+[left][tutorial[001_HelloWord | Previous: Hello Word]][/left] [right][tutorial[011_ObjectConfig | Next: Object config]][/right]
+
+=== Objectif ===
+:** Understand ewol basic object
+:** Use ewol::Object correctly
+
+== Basis of the Object ==
+
+An object in Ewol is a simple class : [class[ewol::Object]] This object is the basis of all element in the ewol system.
+This is designed to manage basis element of complexe structure:
+
+:** Unique ID
+:** Name
+:** Config
+:** Event generation and receving
+:** Xml configuration
+:** Delayed removing
+
+[note]
+Please do not compare with the gObject basic class...
+[/note]
+
+
+== Create an Object: ==
+
+This is a really simple way to create an Object, simply generate a new on it :
+[code style=c++]
+ widget::Label* tmpObject = new widget::Label();
+ if (tmpObject == NULL) {
+ APPL_ERROR("An error occured");
+ return;
+ }
+[/code]
+
+The object register itself on the object manager, now it will have a specific Id and no name
+
+Force the set of the name :
+
+[code style=c++]
+ tmpObject->setName("my widget name");
+ APPL_INFO("We just create an Object with ID=" << tmpObject->getId() << " name='" << tmpObject->getName() << "'");
+[/code]
+
+
+== Remove an Object: ==
+
+This is important to note that many element can have a reference on the Object.
+
+And we did not use "ref-counting" for philosophic reasons ...
+
+Then we need to use the fuction:
+[b]removeObject()[/b] to remove the Object, This will notify avery object in the system that this
+specific object has been removed.
+
+
+Then to remove an object call:
+[code style=c++]
+ tmpObject->removeObject();
+[/code]
+
+On every object we can have an herited function: [b]virtual void onObjectRemove(ewol::Object * _removeObject);[/b]
+
+
+We need to implement this fuction to be notify an object is removed:
+[code style=c++]
+ void namespeceName::ClassName::onObjectRemove(ewol::Object * _removeObject) {
+ if (_removeObject == m_object) {
+ m_object = NULL;
+ markToRedraw(); // set only for graphical object ...
+ }
+ }
+[/code]
+
+[note]
+If you have well follow the idea, you will never declare an object in local, just use pointer on them.
+[/note]
+
+=== Particularity ===
+
+An object can remove itself, just use the function:
+[code style=c++]
+ autoDestroy();
+[/code]
+
+
+== Retrieve an Object: ==
+
+In Ewol this is possible to get a widget with his name.
+This is really simple.
+
+=== In an Object ===
+
+Call a simple function define in the Object:
+
+[code style=c++]
+ #include
+
+ ...
+
+ ewol::Object* tmpObject = getObjectManager().get("name of the object");
+ if (tmpObject == NULL) {
+ APPL_ERROR("The Object does not exist");
+ }
+[/code]
+
+=== Not in an Object ===
+
+In this case, we need to get the context manager and after the object manager:
+
+[code style=c++]
+ #include
+ #include
+
+ ...
+
+ ewol::Object* tmpObject = ewol::getContext().getObjectManager().get("name of the object");
+ if (tmpObject == NULL) {
+ APPL_ERROR("The Object does not exist");
+ }
+[/code]
+
+
+
+== conclusion ==
+
+If you follow these rules, you will not have memory leek and no segmentation fault on the ewol system.
+
+[note]
+To be sure that the name is unique, just add the current creator object Id in the name.
+[/note]
+
+
+
diff --git a/doc/tutorial/011_ObjectConfig.bb b/doc/tutorial/011_ObjectConfig.bb
new file mode 100644
index 00000000..280c0a8d
--- /dev/null
+++ b/doc/tutorial/011_ObjectConfig.bb
@@ -0,0 +1,153 @@
+=?= Tutorial 3: Object Config =?=
+__________________________________________________
+[left][tutorial[010_ObjectModel | Previous: Object model]][/left] [right][tutorial[012_ObjectMessage | Next: Object message]][/right]
+
+=== Objectif ===
+:** Understand ewol::Object configuration parameter
+:** Create an configurable object
+
+== Use of Configuration ==
+
+Configuration are parameters to set some property on an object,
+this is a really generic use in many system,
+this is the reason why we implement one.
+
+
+This is a generic interface to set and get parameter,
+when you did not really know it,
+but it generate many convertion to string search and many other things...
+
+If you know the object just interact with it with his own accessors (faster ond conpilation check).
+
+
+=== Set config ===
+
+When you have the pointer on the object:
+[code style=c++]
+ if (tmpObject->setConfig("name", "new name of object") == false) {
+ APPL_ERROR("Can not set object property");
+ }
+[/code]
+
+A second methode is to request the name with his direct config name:
+[code style=c++]
+ // to be sure that the name exist:
+ if (tmpObject->setConfig(ewol::Object::configName, "new name of object") == false) {
+ APPL_ERROR("Can not set object property");
+ }
+[/code]
+The only aventage here is to have an automatic update on the name of the parameter.
+
+It is possible to configure an object whitout knowing his name:
+[code style=c++]
+ // in an ewol::Object only ...
+ if (setConfigNamed("object name", "ewol::Object::configName, "new name of object") == false) {
+ APPL_ERROR("Can not set object property");
+ }
+[/code]
+
+
+=== Get config ===
+
+Direct get the configuration:
+[code style=c++]
+ std::string val = tmpObject->getConfig("name");
+ APPL_INFO("Get Object property : name='" << val << "'");
+[/code]
+
+Get with his direct definition name:
+[code style=c++]
+ std::string val = tmpObject->getConfig(ewol::Object::configName);
+ APPL_INFO("Get Object property : " << ewol::Object::configName << "'" << val << "'");
+[/code]
+
+
+== Implement configuration ==
+
+=== Declare config ===
+
+In the header file:
+[code style=c++]
+#include
+namespace appl {
+ class MyObj : public ewol::Object {
+ public:
+ // Config list of properties
+ static const char* const configValue;
+ public:
+ //! @brief Constructor
+ MyObj(void);
+ //! @brief Destructor
+ virtual ~MyObj(void);
+ private:
+ bool m_value; //!< Internal Object value
+ public:
+ //! @brief Setter
+ void setValue(bool _val) {
+ m_value = _val;
+ }
+ //! @brief Getter
+ bool getValue(void) const {
+ return m_value;
+ }
+ public: // herited function:
+ bool onSetConfig(const ewol::object::Config& _conf);
+ }
+}
+[/code]
+
+[note]
+By convention declare config started with "configXXXXXX"
+[/note]
+
+In the source file:
+[code style=c++]
+// Declare the configuration Name:
+const char* const appl::MyObj::configValue = "value";
+
+appl::MyObj::MyObj(void) {
+ // declare the configuration on this object:
+ registerConfig(configValue, "bool", NULL, "object configuration description");
+ // Note : This API is not compleately define ...
+}
+appl::MyObj::~MyObj(void) {
+ // nothing to do ...
+}
+[/code]
+Now an extern Object can register configure these parameter, otherwise, they will be rejected!!!
+
+
+=== Get and Set config ===
+
+You can see in these implementation that we not compare the string but just the pointer.
+The ewol::Object convert the string in the correct pointer to be faster in many case.
+
+==== Set configuration ====
+
+[code style=c++]
+bool appl::MyObj::onSetConfig(const ewol::object::Config& _conf) {
+ APPL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} set config : " << _conf);
+ if (_conf.getConfig() == configValue) {
+ setValue(std::stob(_conf.getData()));
+ return true;
+ }
+ return false;
+}
+[/code]
+
+==== Get configuration ====
+
+[code style=c++]
+bool appl::MyObj::onGetConfig(const char* _config, std::string& _result) const {
+ if (_config == configValue) {
+ _result = std::to_string(getValue());
+ return true;
+ }
+ return false;
+}
+[/code]
+
+== Conclusion ==
+
+Now you can choice the methode you want in your application to implement your basic configuration feature.
+
diff --git a/doc/tutorial/012_ObjectMessage.bb b/doc/tutorial/012_ObjectMessage.bb
new file mode 100644
index 00000000..9f62f5d6
--- /dev/null
+++ b/doc/tutorial/012_ObjectMessage.bb
@@ -0,0 +1,133 @@
+=?= Tutorial 4: Object Message =?=
+__________________________________________________
+[left][tutorial[011_ObjectConfig | Previous: Object config]][/left] [right][tutorial[020_FileAccess | Next: File Access]][/right]
+
+=== Objectif ===
+:** Understand ewol::Object Messaging system
+:** Create extern message and receive Object message
+
+== Message system ==
+
+The message system is a simple message sending between Object.
+This is composed with a pointer (const char* const) that represent the mesage ID (pointer, then unique)
+and a value (std::string)
+
+The message are broadcast or multicast on object watcher.
+
+== Receive Message from other object ==
+
+=== Register on message ===
+
+We will se an example on the widget : [class[ewol::widget::Button]]
+
+By default the messageID is the event generated, But to overwrite this message Id just create a new one:
+[code style=c++]
+// on the global on the file or in private class member:
+static const char* const g_backMessage = "local-event-button-pressed";
+static const char* const g_backMessageValue = "local-event-button-value";
+static const char* const g_backMessageDataOverWritte = "local-event-button-data";
+[/code]
+
+
+Register with his name:
+[code style=c++]
+registerOnEvent(this, "pressed", g_backMessage);
+[/code]
+
+Register with his direct name:
+[code style=c++]
+registerOnEvent(this, ewol::widget::Button::eventValue, g_backMessageValue);
+[/code]
+
+It is possible to overwrote the data send by the Object :
+[code style=c++]
+registerOnEvent(this, ewol::widget::Button::eventPressed, g_backMessageDataOverWritte, "Data we want to receive");
+[/code]
+
+
+=== Receive message ===
+
+To receive message from other widget, just implement this function:
+
+[code style=c++]
+
+void appl::ObjectName::onReceiveMessage(const ewol::object::Message& _msg) {
+ APPL_INFO("Receive Event : " << _msg);
+ if (_msg.getMessage() == g_backMessage) {
+ // process here
+ return;
+ }
+ if (_msg.getMessage() == g_backMessageValue) {
+ APPL_INFO("message value: '" << _msg.getData() << "'");
+ return;
+ }
+ if (_msg.getMessage() == g_backMessageDataOverWritte) {
+ APPL_INFO("Overwrite message data: '" << _msg.getData() << "'");
+ return;
+ }
+}
+[/code]
+
+
+== Declare Extern Message ==
+
+=== Declare Message ===
+
+In the header file:
+[code style=c++]
+#include
+namespace appl {
+ class MyObj : public ewol::Object {
+ public:
+ // Event list of properties
+ static const char* const eventValue;
+ public:
+ //! @brief Constructor
+ MyObj(void);
+ //! @brief Destructor
+ virtual ~MyObj(void);
+ }
+}
+[/code]
+
+[note]
+By convention declare events started with "eventXXXXXX"
+[/note]
+
+In the source file:
+[code style=c++]
+// Declare the configuration Name:
+const char* const appl::MyObj::eventValue = "value";
+
+appl::MyObj::MyObj(void) {
+ // declare Event generated on this object:
+ addEventId(eventValue);
+}
+appl::MyObj::~MyObj(void) {
+ // nothing to do ...
+}
+[/code]
+Now an extern Object can register event on this object, otherwise, they will be rejected!!!
+
+
+=== Generate Message ===
+
+Now we have register object message, We need to have generated it, This is really simple :
+
+[code style=c++]
+ // with no data:
+ generateEventId(eventValue);
+ // With a custom data:
+ generateEventId(eventValue, "My sring custom data ...");
+[/code]
+
+
+== Conclusion ==
+
+You will now able to generate event between objects...
+
+
+
+
+
+
diff --git a/doc/tutorial/020_FileAccess.bb b/doc/tutorial/020_FileAccess.bb
new file mode 100644
index 00000000..c8becf9d
--- /dev/null
+++ b/doc/tutorial/020_FileAccess.bb
@@ -0,0 +1,134 @@
+=?= Tutorial 5: File Access =?=
+__________________________________________________
+[left][tutorial[012_ObjectMessage | Previous: Object message]][/left] [right][tutorial[021_Resources | Next: Resources management]][/right]
+
+=== Objectif ===
+:** Understand why we wrap interface on file system
+
+== Limitation ==
+
+Application generation is really simple, but package management can create some problems...
+
+For example :
+:** Android does not permit access on the file system, but we need data that is named assets, thes data in contained in a zip file.
+:** Linux set his own application data in a special path : /usr/shared/applName/
+:** MacOs create a bundle (*.app) that is a folder with all application data.
+:** ...
+
+For all tese reason we need to wrap standard application interface. (you can acces directly but it could be tricky and depend on the target)
+
+== Generic Properties ==
+
+By default we dertermine some basics for files.
+
+Then we need to determine file in the tree with :
+:** "DATA:XXX" Application internal data
+:** "USERDATA:XXX" User save data (like game save)
+:** "HOME:XXX" User home folder
+:** "/XXX" Direct acces on a file in the fileSystem
+:** ...
+
+When you will call a file, you need to just call it with the starting name.
+
+For example if I want to acces at an application data I will call the file : "DATA:myImage.png"
+
+== Integrate a file in a package ==
+
+In your lutin_xxx.py file add:
+[code style=python]
+ # to copy a single file:
+ myModule.copy_file("relative/path/file.svg","destination/folder/file.svg")
+ # to copy an entire patern path
+ myModule.copy_folder("relative/path/start*.png","destination/folder/")
+[/code]
+
+And now you can acces on these file with : "DATA:destination/folder/file.svg"
+
+
+== Read a file ==
+
+[code style=c++]
+ #include
+
+ ...
+
+ etk::FSNode file("DATA:destination/folder/file.svg");
+ if (file.exist() == false) {
+ APPL_ERROR("Can not read the file (Does not exist)");
+ return;
+ }
+ APPL_INFO("open :" << file << " with size=" << file.fileSize());
+ if (file.fileOpenRead() == false) {
+ APPL_ERROR("Can not open in read mode the file: " << file);
+ return;
+ }
+ // get a char
+ APPL_INFO("read in: " << file << " the first char='" << file.fileGet() << "'");
+ // Get a line
+ std::string output;
+ file.fileGets(output);
+ APPL_INFO("and the end of the line ='" << output << "'");
+ // close the file (note : if you did not do it, it will be close automaticly with an error)
+ file.fileClose();
+[/code]
+
+== Write a file ==
+
+[code style=c++]
+ #include
+
+ ...
+
+ etk::FSNode file("USERDATA:exmple.txt");
+ APPL_INFO("open :" << file);
+ if (file.fileOpenWrite() == false) {
+ APPL_ERROR("Can not open in write mode the file: " << file);
+ return;
+ }
+ // put a char
+ file.filePut('A');
+ // write a line
+ file.filePuts(" other string to put in the file ... \n");
+ // close the file (note : if you did not do it, it will be close automaticly with an error)
+ file.fileClose();
+[/code]
+
+== 'Theme' management ==
+
+The theme management is a subset a file selected by a main key.
+For example The basic theme of an API can be manage with only 2 commands (set the theme, and request upate of GUI)
+
+At the start of the program, you might specify the default path theme:
+
+[code style=c++]
+ etk::theme::setNameDefault("GUI_COLOR", "theme/black");
+ etk::theme::setNameDefault("GUI_SHAPE", "theme/rounded");
+[/code]
+
+And when you want to change the theme, just call:
+
+[code style=c++]
+ // change the theme :
+ etk::theme::setName("GUI_COLOR", "theme/white");
+ // force reload of all the resources :
+ ewol::getContext().getResourcesManager().reLoadResources();
+ ewol::getContext().forceRedrawAll();
+[/code]
+
+[note]
+This is not done automaticly, because reloading the resources can have a real cost of time.
+[/note]
+
+You can acces on your theme with accessing the filename: "THEME:GUI_COLOR:your/sub/path/file.xx"
+
+An important think is that the theme file is searching in many path in the order:
+:** USERDATA:GUI_COLOR:your/sub/path/file.xx
+:** DATA:GUI_COLOR:your/sub/path/file.xx
+:** USERDATA:GUI_COLOR(default):your/sub/path/file.xx
+:** DATA:GUI_COLOR(default):your/sub/path/file.xx
+
+
+Like this a user can overload the application theme...
+
+
+
diff --git a/doc/tutorial/021_Resources.bb b/doc/tutorial/021_Resources.bb
new file mode 100644
index 00000000..e69de29b
diff --git a/doc/tutorial/030_ConplexeXmlGui.bb b/doc/tutorial/030_ConplexeXmlGui.bb
new file mode 100644
index 00000000..e69de29b
diff --git a/doc/tutorial/050_CreateCustomWidget.bb b/doc/tutorial/050_CreateCustomWidget.bb
new file mode 100644
index 00000000..0477cd9e
--- /dev/null
+++ b/doc/tutorial/050_CreateCustomWidget.bb
@@ -0,0 +1,32 @@
+=?=Create a custum widget=?=
+
+To create a custum widget, this is as simple as complex.
+The first things to do is to choice a methode to display you widget:
+:** [b]Direct mode:[/b] display on openGL engine with your prefered methode (some help for shaders)
+:** [b]Compositing:[/b] display with a toolbox for drawing on openGL
+:** [b]Shaper:[/b] this is a special mode of compositing
+:** [b]Add capacity:[/b] this could be interesting to increase some capacity of a widget...
+
+==Create the widget structure==
+===Header===
+[code style=c++]
+ #include
+ namespace appl {
+ class myWidget : public ewol::Widget {
+ public:
+ myWidget(void) {};
+ ~myWidget(void) {};
+ public: // herited function
+ void draw(void);
+ void onRegenerateDisplay(void);
+ }
+ }
+[/code]
+
+We can show that we had two function, the first is call every time we render the widget (as the number of fps) "draw()".
+And the second that is call only when we need to redraw the widget (after the user call markToRedraw() ) "onRegenerateDisplay()".
+
+
+
+
+
diff --git a/doc/tutorial/051_AddWidgetCustumInXML.bb b/doc/tutorial/051_AddWidgetCustumInXML.bb
new file mode 100644
index 00000000..33094160
--- /dev/null
+++ b/doc/tutorial/051_AddWidgetCustumInXML.bb
@@ -0,0 +1,18 @@
+
+
+
+
+== Declare object in XML ==
+
+Object can be declared in some XML, (like gui decription), then we need to declare the Object in the system recognition.
+
+=== Declare Object ===
+
+The fist step is to add a methode to create the object
+
+=== Declare on XML and configuration ===
+
+=== Special case SubParsing XML element ===
+
+
+
diff --git a/external/agg b/external/agg
index cd7251e1..db262613 160000
--- a/external/agg
+++ b/external/agg
@@ -1 +1 @@
-Subproject commit cd7251e11267419cda8dec02c227856a93be21b7
+Subproject commit db2626136bd35e974a24c64b1b50c4187de30bdf
diff --git a/external/date/CMakeLists.txt b/external/date/CMakeLists.txt
index 0638b46a..89566271 100644
--- a/external/date/CMakeLists.txt
+++ b/external/date/CMakeLists.txt
@@ -28,10 +28,19 @@ include_directories(.)
#Create src file list
set(src_files
date/date.cpp
+ date/date.h
)
add_definitions( -DDEBUG_LEVEL=3 )
add_definitions( -DDEBUG=1 )
+if (APPLE)
+ add_definitions( -D__TARGET_OS__MacOs )
+elseif (UNIX)
+ add_definitions( -D__TARGET_OS__Linux )
+elseif (WIN32)
+ add_definitions( -D__TARGET_OS__Windows )
+endif ()
+
if (WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE RESULT)
diff --git a/external/edtaa3/CMakeLists.txt b/external/edtaa3/CMakeLists.txt
index 3509b52c..bbfe78df 100644
--- a/external/edtaa3/CMakeLists.txt
+++ b/external/edtaa3/CMakeLists.txt
@@ -15,6 +15,14 @@ set(src_files
add_definitions( -DDEBUG_LEVEL=3 )
add_definitions( -DDEBUG=1 )
+if (APPLE)
+ add_definitions( -D__TARGET_OS__MacOs )
+elseif (UNIX)
+ add_definitions( -D__TARGET_OS__Linux )
+elseif (WIN32)
+ add_definitions( -D__TARGET_OS__Windows )
+endif ()
+
#Create a static Lib:
add_library(edtaa3 STATIC ${src_files} )
diff --git a/external/egami b/external/egami
index 3d6f7d02..4c336334 160000
--- a/external/egami
+++ b/external/egami
@@ -1 +1 @@
-Subproject commit 3d6f7d02238ba4b080ae0a9c568d0697eaf602b5
+Subproject commit 4c336334a8643fdfda6ab5b2627369cacf1fb487
diff --git a/external/ejson b/external/ejson
index e1c83192..74f13fd9 160000
--- a/external/ejson
+++ b/external/ejson
@@ -1 +1 @@
-Subproject commit e1c8319249b3ed3e8eb1d2d9ed15a8ab22ca6619
+Subproject commit 74f13fd91904cf52b4545440bfc13f5aaa827355
diff --git a/external/esvg b/external/esvg
index eceec1d9..92298865 160000
--- a/external/esvg
+++ b/external/esvg
@@ -1 +1 @@
-Subproject commit eceec1d9289fc3234ad97842b4bfb3dddd3a858b
+Subproject commit 9229886513957a175637e84eadc0a4ffda7d8a14
diff --git a/external/etk b/external/etk
index 041266c5..d431e72b 160000
--- a/external/etk
+++ b/external/etk
@@ -1 +1 @@
-Subproject commit 041266c5f968460c07758938bb6cca92fd295db1
+Subproject commit d431e72b0916391c011830a5db9d8f756c510405
diff --git a/external/exml b/external/exml
index c9097dca..a231aa23 160000
--- a/external/exml
+++ b/external/exml
@@ -1 +1 @@
-Subproject commit c9097dcae712c4a2df984251ac355ce4951ac2ee
+Subproject commit a231aa2305055f739ce2f81f3e4b9b631b5a0551
diff --git a/external/png b/external/png
index c0d9b148..f56c9fdf 160000
--- a/external/png
+++ b/external/png
@@ -1 +1 @@
-Subproject commit c0d9b148c08d28a1707959f6d425bc8bb93da895
+Subproject commit f56c9fdf7d9d186554d13a9f7f5b7d906ed127c1
diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt
index a624219f..cebb793c 100644
--- a/sources/CMakeLists.txt
+++ b/sources/CMakeLists.txt
@@ -28,93 +28,202 @@ include_directories(.)
#Create src file list
set(src_files
ewol/ewol.cpp
+ ewol/ewol.h
ewol/debug.cpp
+ ewol/debug.h
ewol/Dimension.cpp
+ ewol/Dimension.h
ewol/compositing/Compositing.cpp
+ ewol/compositing/Compositing.h
ewol/compositing/TextBase.cpp
+ ewol/compositing/TextBase.h
ewol/compositing/Text.cpp
+ ewol/compositing/Text.h
ewol/compositing/TextDF.cpp
+ ewol/compositing/TextDF.h
ewol/compositing/Drawing.cpp
+ ewol/compositing/Drawing.h
ewol/compositing/Image.cpp
+ ewol/compositing/Image.h
ewol/compositing/Sprite.cpp
+ ewol/compositing/Sprite.h
ewol/compositing/Shaper.cpp
+ ewol/compositing/Shaper.h
ewol/compositing/Area.cpp
+ ewol/compositing/Area.h
ewol/context/clipBoard.cpp
+ ewol/context/clipBoard.h
ewol/context/commandLine.cpp
+ ewol/context/commandLine.h
ewol/context/ConfigFont.cpp
+ ewol/context/ConfigFont.h
ewol/context/Context.cpp
+ ewol/context/Context.h
ewol/context/cursor.cpp
+ ewol/context/cursor.h
ewol/context/InputManager.cpp
- ewol/context/X11/Context.cpp
+ ewol/context/InputManager.h
ewol/event/Entry.cpp
+ ewol/event/Entry.h
ewol/event/Time.cpp
+ ewol/event/Time.h
ewol/event/Input.cpp
+ ewol/event/Input.h
ewol/key/keyboard.cpp
+ ewol/key/keyboard.h
ewol/key/Special.cpp
+ ewol/key/Special.h
ewol/key/status.cpp
+ ewol/key/status.h
ewol/key/type.cpp
+ ewol/key/type.h
ewol/object/Config.cpp
+ ewol/object/Config.h
ewol/object/ConfigElement.cpp
+ ewol/object/ConfigElement.h
ewol/object/Manager.cpp
+ ewol/object/Manager.h
ewol/object/Message.cpp
+ ewol/object/Message.h
ewol/object/MultiCast.cpp
+ ewol/object/MultiCast.h
ewol/object/Object.cpp
+ ewol/object/Object.h
ewol/openGL/openGL.cpp
+ ewol/openGL/openGL.h
ewol/resource/Colored3DObject.cpp
+ ewol/resource/Colored3DObject.h
ewol/resource/ColorFile.cpp
+ ewol/resource/ColorFile.h
ewol/resource/ConfigFile.cpp
+ ewol/resource/ConfigFile.h
ewol/resource/FontFreeType.cpp
+ ewol/resource/FontFreeType.h
ewol/resource/Image.cpp
+ ewol/resource/Image.h
ewol/resource/ImageDF.cpp
+ ewol/resource/ImageDF.h
ewol/resource/Manager.cpp
+ ewol/resource/Manager.h
ewol/resource/Program.cpp
+ ewol/resource/Program.h
ewol/resource/Resource.cpp
+ ewol/resource/Resource.h
ewol/resource/Shader.cpp
+ ewol/resource/Shader.h
ewol/resource/Texture.cpp
+ ewol/resource/Texture.h
ewol/resource/TexturedFont.cpp
+ ewol/resource/TexturedFont.h
ewol/resource/DistanceFieldFont.cpp
+ ewol/resource/DistanceFieldFont.h
ewol/resource/VirtualBufferObject.cpp
+ ewol/resource/VirtualBufferObject.h
ewol/widget/ButtonColor.cpp
+ ewol/widget/ButtonColor.h
ewol/widget/Button.cpp
+ ewol/widget/Button.h
ewol/widget/CheckBox.cpp
+ ewol/widget/CheckBox.h
ewol/widget/ColorBar.cpp
+ ewol/widget/ColorBar.h
ewol/widget/Composer.cpp
+ ewol/widget/Composer.h
ewol/widget/Container.cpp
+ ewol/widget/Container.h
ewol/widget/Container2.cpp
+ ewol/widget/Container2.h
ewol/widget/ContainerN.cpp
+ ewol/widget/ContainerN.h
ewol/widget/ContextMenu.cpp
+ ewol/widget/ContextMenu.h
ewol/widget/Entry.cpp
+ ewol/widget/Entry.h
ewol/widget/Gird.cpp
+ ewol/widget/Gird.h
ewol/widget/Image.cpp
+ ewol/widget/Image.h
ewol/widget/Joystick.cpp
+ ewol/widget/Joystick.h
ewol/widget/Label.cpp
+ ewol/widget/Label.h
ewol/widget/Layer.cpp
+ ewol/widget/Layer.h
ewol/widget/List.cpp
+ ewol/widget/List.h
ewol/widget/ListFileSystem.cpp
+ ewol/widget/ListFileSystem.h
ewol/widget/Manager.cpp
+ ewol/widget/Manager.h
ewol/widget/Menu.cpp
+ ewol/widget/Menu.h
ewol/widget/meta/ColorChooser.cpp
+ ewol/widget/meta/ColorChooser.h
ewol/widget/meta/FileChooser.cpp
+ ewol/widget/meta/FileChooser.h
ewol/widget/meta/Parameter.cpp
+ ewol/widget/meta/Parameter.h
ewol/widget/meta/ParameterList.cpp
+ ewol/widget/meta/ParameterList.h
ewol/widget/meta/StdPopUp.cpp
+ ewol/widget/meta/StdPopUp.h
ewol/widget/PopUp.cpp
+ ewol/widget/PopUp.h
ewol/widget/ProgressBar.cpp
+ ewol/widget/ProgressBar.h
ewol/widget/Scroll.cpp
+ ewol/widget/Scroll.h
ewol/widget/Sizer.cpp
+ ewol/widget/Sizer.h
ewol/widget/Slider.cpp
+ ewol/widget/Slider.h
ewol/widget/Spacer.cpp
+ ewol/widget/Spacer.h
ewol/widget/Widget.cpp
+ ewol/widget/Widget.h
ewol/widget/WidgetScrolled.cpp
+ ewol/widget/WidgetScrolled.h
ewol/widget/Windows.cpp
+ ewol/widget/Windows.h
ewol/widget/WSlider.cpp
+ ewol/widget/WSlider.h
)
add_definitions( -DDEBUG_LEVEL=3 )
add_definitions( -DDEBUG=1 )
+message(STATUS "APPLE=${APPLE}")
+message(STATUS "UNIX=${UNIX}")
+
+if (APPLE)
+ add_definitions( -D__TARGET_OS__MacOs )
+ set(src_files-specific
+ ewol/context/MacOs/Context.cpp
+ ewol/context/MacOs/Context.h
+ ewol/context/MacOs/Interface.mm
+ ewol/context/MacOs/Interface.h
+ ewol/context/MacOs/Windows.mm
+ ewol/context/MacOs/Windows.h
+ ewol/context/MacOs/OpenglView.mm
+ ewol/context/MacOs/OpenglView.h
+ ewol/context/MacOs/AppDelegate.mm
+ ewol/context/MacOs/AppDelegate.h
+ )
+elseif (UNIX)
+ add_definitions( -D__TARGET_OS__Linux )
+ set(src_files-specific
+ ewol/context/X11/Context.cpp
+ ewol/context/X11/Context.h
+ )
+elseif (WIN32)
+ add_definitions( -D__TARGET_OS__Windows )
+ set(src_files-specific
+ ewol/context/Windows/Context.cpp
+ ewol/context/Windows/Context.h
+ )
+endif ()
#Create a static Lib:
-add_library(ewol STATIC ${src_files} )
+add_library(ewol STATIC ${src_files} ${src_files-specific})
include_directories(${zlib_SOURCE_DIR}/contrib/)
include_directories(${linearmath_SOURCE_DIR}/bullet/src/)
@@ -135,7 +244,6 @@ target_link_libraries(ewol linearmath zlib etk freetype exml ejson egami edtaa3
# read version :
file (STRINGS "tag" BUILD_VERSION)
add_definitions( -DEWOL_VERSION="${BUILD_VERSION}" )
-add_definitions( -D__TARGET_OS__Linux )
# display all variable ...
#get_cmake_property(_variableNames VARIABLES)
diff --git a/sources/ewol/compositing/Image.cpp b/sources/ewol/compositing/Image.cpp
index 0569261e..2e02f11b 100644
--- a/sources/ewol/compositing/Image.cpp
+++ b/sources/ewol/compositing/Image.cpp
@@ -303,6 +303,7 @@ vec2 ewol::compositing::Image::getRealSize(void) {
if (m_resourceDF != NULL) {
return m_resourceDF->getRealSize();
}
+ return vec2(0,0);
}
diff --git a/sources/ewol/key/Special.cpp b/sources/ewol/key/Special.cpp
index bab28ffe..a6465e3e 100644
--- a/sources/ewol/key/Special.cpp
+++ b/sources/ewol/key/Special.cpp
@@ -52,6 +52,8 @@ void ewol::key::Special::update(enum ewol::key::keyboard _move, bool _isDown) {
case keyboardNumLock:
setNumLock(_isDown);
break;
+ default:
+ break;
}
}
diff --git a/sources/ewol/object/Object.cpp b/sources/ewol/object/Object.cpp
index 984d9880..02c97be5 100644
--- a/sources/ewol/object/Object.cpp
+++ b/sources/ewol/object/Object.cpp
@@ -26,7 +26,7 @@ ewol::Object::Object(void) :
m_uniqueId = m_valUID++;
EWOL_DEBUG("new Object : [" << m_uniqueId << "]");
getObjectManager().add(this);
- registerConfig(ewol::Object::configName, "string", NULL, "Object name, might be a unique reference in all the program");
+ registerConfig(configName, "string", NULL, "Object name, might be a unique reference in all the program");
}
ewol::Object::Object(const std::string& _name) :
m_static(false),
@@ -36,7 +36,7 @@ ewol::Object::Object(const std::string& _name) :
m_uniqueId = m_valUID++;
EWOL_DEBUG("new Object : [" << m_uniqueId << "]");
getObjectManager().add(this);
- registerConfig(ewol::Object::configName, "string", NULL, "Object name, might be a unique reference in all the program");
+ registerConfig(configName, "string", NULL, "Object name, might be a unique reference in all the program");
}
ewol::Object::~Object(void) {
@@ -319,7 +319,7 @@ bool ewol::Object::storeXML(exml::Element* _node) const {
bool ewol::Object::onSetConfig(const ewol::object::Config& _conf) {
EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} set config : " << _conf);
- if (_conf.getConfig() == ewol::Object::configName) {
+ if (_conf.getConfig() == configName) {
EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} set config name : \"" << _conf.getData() << "\"");
setName(_conf.getData());
return true;
@@ -328,7 +328,7 @@ bool ewol::Object::onSetConfig(const ewol::object::Config& _conf) {
}
bool ewol::Object::onGetConfig(const char* _config, std::string& _result) const {
- if (_config == ewol::Object::configName) {
+ if (_config == configName) {
_result = getName();
return true;
}
diff --git a/sources/ewol/resource/ConfigFile.h b/sources/ewol/resource/ConfigFile.h
index 6b68daf6..da2bc04b 100644
--- a/sources/ewol/resource/ConfigFile.h
+++ b/sources/ewol/resource/ConfigFile.h
@@ -10,6 +10,7 @@
#define __SIMPLE_CONFIG_FILE_H__
#include
+#include
#include
#include
#include
diff --git a/sources/ewol/widget/Button.cpp b/sources/ewol/widget/Button.cpp
index 807ca9f1..8359ac09 100644
--- a/sources/ewol/widget/Button.cpp
+++ b/sources/ewol/widget/Button.cpp
@@ -171,7 +171,6 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) {
if(ewol::widget::Button::lockAccess == m_lock) {
return false;
}
- bool previousHoverState = m_mouseHover;
if( ewol::key::statusLeave == _event.getStatus()
|| ewol::key::statusAbort == _event.getStatus()) {
m_mouseHover = false;
@@ -189,7 +188,6 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) {
m_mouseHover = true;
}
}
- bool previousPressed = m_buttonPressed;
EWOL_VERBOSE("Event on BT ... mouse hover : " << m_mouseHover);
if (true == m_mouseHover) {
if (1 == _event.getId()) {
diff --git a/sources/ewol/widget/meta/FileChooser.cpp b/sources/ewol/widget/meta/FileChooser.cpp
index 09dbd5e4..0d7b3192 100644
--- a/sources/ewol/widget/meta/FileChooser.cpp
+++ b/sources/ewol/widget/meta/FileChooser.cpp
@@ -49,21 +49,7 @@ ewol::widget::FileChooser::FileChooser(void) {
addEventId(eventCancel);
addEventId(eventValidate);
- ewol::widget::Sizer * mySizerVert = NULL;
- ewol::widget::Sizer * mySizerHori = NULL;
- ewol::widget::Spacer * mySpacer = NULL;
- //ewol::widget::Label * myLabel = NULL;
- ewol::widget::Image * myImage = NULL;
m_folder = etk::getUserHomeFolder();
- /*
- #if defined(__TARGET_OS__Android)
- setMinSize(ewol::Dimension(vec2(90,90),ewol::Dimension::Pourcent));;
- #elif defined(__TARGET_OS__Windows)
- setMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));;
- #else
- setMinSize(ewol::Dimension(vec2(80,80),ewol::Dimension::Pourcent));;
- #endif
- */
m_file = "";
std::string myDescription = std::string("")
+ "\n"