[DEV] write basic documantation
This commit is contained in:
65
doc/build.md
Normal file
65
doc/build.md
Normal file
@@ -0,0 +1,65 @@
|
||||
Build lib & build sample {#eproperty_build}
|
||||
========================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
Download: {#eproperty_build_download}
|
||||
=========
|
||||
|
||||
eproperty use some tools to manage source and build it:
|
||||
|
||||
lutin (build-system): {#eproperty_build_download_lutin}
|
||||
---------------------
|
||||
|
||||
```{.sh}
|
||||
pip install lutin --user
|
||||
# optionnal dependency of lutin (manage image changing size for application release
|
||||
pip install pillow --user
|
||||
```
|
||||
|
||||
|
||||
dependency: {#eproperty_build_download_dependency}
|
||||
-----------
|
||||
|
||||
```{.sh}
|
||||
mkdir framework
|
||||
cd framework
|
||||
git clone https://github.com/atria-soft/elog.git
|
||||
git clone https://github.com/atria-soft/etk.git
|
||||
cd ..
|
||||
```
|
||||
|
||||
sources: {#eproperty_build_download_sources}
|
||||
--------
|
||||
|
||||
```{.sh}
|
||||
cd framework
|
||||
git clone https://github.com/atria-soft/eproperty.git
|
||||
cd ..
|
||||
```
|
||||
|
||||
Build: {#eproperty_build_build}
|
||||
======
|
||||
|
||||
|
||||
library: {#eproperty_build_build_library}
|
||||
--------
|
||||
|
||||
```{.sh}
|
||||
lutin -mdebug eproperty
|
||||
```
|
||||
|
||||
Sample: {#eproperty_build_build_sample}
|
||||
-------
|
||||
|
||||
```{.sh}
|
||||
lutin -mdebug eproperty-sample
|
||||
```
|
||||
|
||||
|
||||
Run sample: {#eproperty_build_run_sample}
|
||||
===========
|
||||
|
||||
```{.sh}
|
||||
lutin -mdebug eproperty-sample?run
|
||||
```
|
@@ -1,30 +1,33 @@
|
||||
EPROPERTY library {#mainpage}
|
||||
=================
|
||||
|
||||
What is EPROPERTY, and how can I use it?
|
||||
----------------------------------------
|
||||
@tableofcontents
|
||||
|
||||
EPROPERTY, or Ewol signal engine is a simple messaging layer, managing multiple connection and manage disconnection
|
||||
What is EPROPERTY: {#eproperty_mainpage_what}
|
||||
==================
|
||||
|
||||
EPROPERTY, or Ewol property interface is a simple property API to set and get generic APIS
|
||||
|
||||
EPROPERTY is designed for
|
||||
- Expose property on generic class
|
||||
- Call class when the parameter change
|
||||
- permit to set value throw string (good for XML configurations)
|
||||
|
||||
|
||||
What languages are supported?
|
||||
-----------------------------
|
||||
What languages are supported? {#eproperty_mainpage_language}
|
||||
=============================
|
||||
|
||||
EPROPERTY is written in C++.
|
||||
|
||||
|
||||
Are there any licensing restrictions?
|
||||
-------------------------------------
|
||||
Are there any licensing restrictions? {#eproperty_mainpage_license_restriction}
|
||||
=====================================
|
||||
|
||||
EPROPERTY is **FREE software** and _all sub-library are FREE and staticly linkable !!!_
|
||||
|
||||
|
||||
License (APACHE-2.0)
|
||||
--------------------
|
||||
License (APACHE-2.0) {#eproperty_mainpage_license}
|
||||
====================
|
||||
|
||||
Copyright EPROPERTY Edouard DUPIN
|
||||
|
||||
@@ -40,3 +43,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Other pages {#eproperty_mainpage_sub_page}
|
||||
===========
|
||||
|
||||
- @ref eproperty_build
|
||||
- @ref eproperty_tutorial
|
||||
- [**ewol coding style**](http://atria-soft.github.io/ewol/ewol_coding_style.html)
|
||||
|
||||
|
||||
|
138
doc/tutorial.md
Normal file
138
doc/tutorial.md
Normal file
@@ -0,0 +1,138 @@
|
||||
Tutorial {#eproperty_tutorial}
|
||||
========
|
||||
|
||||
@tableofcontents
|
||||
|
||||
What is a property: {#eproperty_tutorial_what}
|
||||
===================
|
||||
|
||||
A property is a generic interface to manage parameter of a class whithout redeclare all the time the setter and getter (that is a little boring)
|
||||
|
||||
Calling a property car mermit to be notify when the value change and to control the values range of list ...
|
||||
|
||||
A property can use agreator interface eproperty::interface that declare a **"properties"** variablke that permit to acces at all the property declared.
|
||||
|
||||
Declare a class that have this interface:
|
||||
@snippet sampleAll.cpp eproperty_sample_declare_class_with_interface
|
||||
|
||||
|
||||
Declare property: {#eproperty_tutorial_declare}
|
||||
=================
|
||||
|
||||
We have some basic properties:
|
||||
- eproperty::Value Simple store of a unique Value
|
||||
- eproperty::Range Store a value inside an authorized range
|
||||
- eproperty::List Store a value inside a list of values (set in constructor)
|
||||
|
||||
Declare a Value property: {#eproperty_tutorial_declare_value}
|
||||
-------------------------
|
||||
|
||||
Do the correct include:
|
||||
@snippet sampleAll.cpp eproperty_sample_declare_value
|
||||
|
||||
Declare your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_declare_class_property_value
|
||||
|
||||
Construct the property with eproperty::Interface:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_value
|
||||
|
||||
Construct the property with **NO** eproperty::Interface:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_value2
|
||||
|
||||
Configure your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_use_set_value_1
|
||||
|
||||
Use your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_get_value_value
|
||||
|
||||
|
||||
Declare a Range property: {#eproperty_tutorial_declare_range}
|
||||
-------------------------
|
||||
|
||||
Do the correct include:
|
||||
@snippet sampleAll.cpp eproperty_sample_declare_range
|
||||
|
||||
Declare your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_declare_class_property_range
|
||||
|
||||
Construct the property with eproperty::Interface:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_range
|
||||
|
||||
Construct the property with **NO** eproperty::Interface:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_range2
|
||||
|
||||
Configure your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_use_set_range_1
|
||||
|
||||
Use your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_get_value_range
|
||||
|
||||
|
||||
Declare a List property: {#eproperty_tutorial_declare_list}
|
||||
------------------------
|
||||
|
||||
Do the correct include:
|
||||
@snippet sampleAll.cpp eproperty_sample_declare_list
|
||||
|
||||
Declare your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_declare_class_property_list
|
||||
|
||||
Construct the property with eproperty::Interface:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_list
|
||||
|
||||
Construct the property with **NO** eproperty::Interface:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_list2
|
||||
|
||||
Special case for the List is adding the value with their string assiciated:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_list_add
|
||||
|
||||
Configure your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_use_set_list_1
|
||||
|
||||
Use your property:
|
||||
@snippet sampleAll.cpp eproperty_sample_get_value_list
|
||||
|
||||
|
||||
|
||||
Particularity: {#eproperty_tutorial_particularity}
|
||||
==============
|
||||
|
||||
Define a callback: {#eproperty_tutorial_particularity_callback}
|
||||
------------------
|
||||
|
||||
All property can define a callback, it is used to update class property with special settings.
|
||||
|
||||
The callback is set in the construction instruction like:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_value
|
||||
|
||||
The fucntion define is like:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_value_callback
|
||||
|
||||
It is called every time the Value change, if the value is identical the callback is not called.
|
||||
|
||||
|
||||
Set value without calling the callback: {#eproperty_tutorial_particularity_direct_set}
|
||||
---------------------------------------
|
||||
|
||||
To set a value in a property without calling the nitifiction function, you might use:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_set_direct
|
||||
|
||||
Please do not use it ouside the internal class that define the peoperty (call me if you have an api to control it at the compilation time)
|
||||
|
||||
Heritage and callback: {#eproperty_tutorial_particularity_heritage}
|
||||
----------------------
|
||||
|
||||
When you herit from an other class with theire property you can prefer changing the default value or set an other list of parameter.
|
||||
|
||||
To set value without calling the callback (that can be virtual then ==0 in the initialisation state), you need to call:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_set_direct
|
||||
|
||||
For the eproperty::List, you chan rename enumeration or remove values:
|
||||
@snippet sampleAll.cpp eproperty_sample_initialize_class_property_list_rename
|
||||
|
||||
|
||||
All sample Code: {#eproperty_tutorial_all_code}
|
||||
================
|
||||
|
||||
This Will generate this simple sample code:
|
||||
@snippet sampleAll.cpp eproperty_sample_all
|
Reference in New Issue
Block a user