[DEV] update lutin naming

This commit is contained in:
Edouard DUPIN 2013-12-23 22:38:46 +01:00
parent c1ab11e532
commit 6f8a4f8510
5 changed files with 62 additions and 58 deletions

View File

@ -11,7 +11,7 @@
const etk::convertionTable_ts etk::constConvertionTable[] = { const struct etk::convertionTable etk::constConvertionTable[] = {
// haveBackSlash, inputValue, newValue // haveBackSlash, inputValue, newValue
{ false , '(' , 0 , REGEXP_OPCODE_PTHESE_IN}, { false , '(' , 0 , REGEXP_OPCODE_PTHESE_IN},
{ true , '(' , '(' , REGEXP_OPCODE_ERROR}, { true , '(' , '(' , REGEXP_OPCODE_ERROR},
@ -62,13 +62,12 @@ const etk::convertionTable_ts etk::constConvertionTable[] = {
{ true , '0' , '\0', REGEXP_OPCODE_ERROR}, { true , '0' , '\0', REGEXP_OPCODE_ERROR},
{ true , '@' , 0 , REGEXP_OPCODE_NO_CHAR}, { true , '@' , 0 , REGEXP_OPCODE_NO_CHAR},
}; };
const int64_t etk::constConvertionTableSize = sizeof(etk::constConvertionTable) / sizeof(etk::convertionTable_ts) ; const int64_t etk::constConvertionTableSize = sizeof(etk::constConvertionTable) / sizeof(struct etk::convertionTable) ;
void etk::displayElem(const std::vector<char32_t>& _data, int64_t _start, int64_t _stop) { void etk::displayElem(const std::vector<char32_t>& _data, int64_t _start, int64_t _stop) {
etk::cout<< ETK_BASH_COLOR_NORMAL; etk::cout<< ETK_BASH_COLOR_NORMAL;
for (int64_t iii=_start; iii<(int64_t)_data.size() && iii<_stop ; iii++) { for (int64_t iii=_start; iii<(int64_t)_data.size() && iii<_stop ; iii++) {
switch(_data[iii]) switch(_data[iii]) {
{
case REGEXP_OPCODE_PTHESE_IN: etk::cout<<ETK_BASH_COLOR_RED << (char*)"(" << ETK_BASH_COLOR_NORMAL; break; case REGEXP_OPCODE_PTHESE_IN: etk::cout<<ETK_BASH_COLOR_RED << (char*)"(" << ETK_BASH_COLOR_NORMAL; break;
case REGEXP_OPCODE_PTHESE_OUT: etk::cout<<ETK_BASH_COLOR_RED << (char*)")" << ETK_BASH_COLOR_NORMAL; break; case REGEXP_OPCODE_PTHESE_OUT: etk::cout<<ETK_BASH_COLOR_RED << (char*)")" << ETK_BASH_COLOR_NORMAL; break;
case REGEXP_OPCODE_BRACKET_IN: etk::cout<<ETK_BASH_COLOR_YELLOW << (char*)"[" << ETK_BASH_COLOR_NORMAL; break; case REGEXP_OPCODE_BRACKET_IN: etk::cout<<ETK_BASH_COLOR_YELLOW << (char*)"[" << ETK_BASH_COLOR_NORMAL; break;
@ -100,8 +99,7 @@ void etk::displayElem(const std::vector<char32_t>& _data, int64_t _start, int64_
} }
char * etk::levelSpace(uint32_t _level) { char * etk::levelSpace(uint32_t _level) {
switch(_level) switch(_level) {
{
case 0: return (char*)""; case 0: return (char*)"";
case 1: return (char*)" "; case 1: return (char*)" ";
case 2: return (char*)" "; case 2: return (char*)" ";

View File

@ -15,14 +15,12 @@
#include <etk/UString.h> #include <etk/UString.h>
#include <math.h> #include <math.h>
namespace etk namespace etk {
{ template <typename T> class Vector2D {
template <typename T> class Vector2D
{
public: public:
T m_floats[2]; T m_floats[2];
public: public:
/***************************************************** /* ****************************************************
* Constructor * Constructor
*****************************************************/ *****************************************************/
Vector2D(void) { Vector2D(void) {
@ -43,7 +41,7 @@ namespace etk
Vector2D(const std::string& str); Vector2D(const std::string& str);
Vector2D(const std::u32string& str); Vector2D(const std::u32string& str);
~Vector2D(void) { }; ~Vector2D(void) { };
/***************************************************** /* ****************************************************
* = assigment * = assigment
*****************************************************/ *****************************************************/
const Vector2D<T>& operator= (const Vector2D<T>& obj ) { const Vector2D<T>& operator= (const Vector2D<T>& obj ) {
@ -56,21 +54,21 @@ namespace etk
m_floats[1] = val; m_floats[1] = val;
return *this; return *this;
} }
/***************************************************** /* ****************************************************
* == operator * == operator
*****************************************************/ *****************************************************/
bool operator== (const Vector2D<T>& obj) const { bool operator== (const Vector2D<T>& obj) const {
return ( (T)obj.m_floats[0] == m_floats[0] return ( (T)obj.m_floats[0] == m_floats[0]
&& (T)obj.m_floats[1] == m_floats[1]); && (T)obj.m_floats[1] == m_floats[1]);
} }
/***************************************************** /* ****************************************************
* != operator * != operator
*****************************************************/ *****************************************************/
bool operator!= (const Vector2D<T>& obj) const { bool operator!= (const Vector2D<T>& obj) const {
return ( (T)obj.m_floats[0] != m_floats[0] return ( (T)obj.m_floats[0] != m_floats[0]
|| (T)obj.m_floats[1] != m_floats[1]); || (T)obj.m_floats[1] != m_floats[1]);
} }
/***************************************************** /* ****************************************************
* += operator * += operator
*****************************************************/ *****************************************************/
const Vector2D<T>& operator+= (const Vector2D<T>& obj) { const Vector2D<T>& operator+= (const Vector2D<T>& obj) {
@ -83,7 +81,7 @@ namespace etk
m_floats[1] += val; m_floats[1] += val;
return *this; return *this;
} }
/***************************************************** /* ****************************************************
* + operator * + operator
*****************************************************/ *****************************************************/
Vector2D<T> operator+ (const Vector2D<T>& obj) const { Vector2D<T> operator+ (const Vector2D<T>& obj) const {
@ -98,7 +96,7 @@ namespace etk
tmpp.m_floats[1] += val; tmpp.m_floats[1] += val;
return tmpp; return tmpp;
} }
/***************************************************** /* ****************************************************
* -= operator * -= operator
*****************************************************/ *****************************************************/
const Vector2D<T>& operator-= (const Vector2D<T>& obj) { const Vector2D<T>& operator-= (const Vector2D<T>& obj) {
@ -111,7 +109,7 @@ namespace etk
m_floats[1] -= val; m_floats[1] -= val;
return *this; return *this;
} }
/***************************************************** /* ****************************************************
* - operator * - operator
*****************************************************/ *****************************************************/
Vector2D<T> operator- (const Vector2D<T>& obj) const { Vector2D<T> operator- (const Vector2D<T>& obj) const {
@ -126,7 +124,7 @@ namespace etk
tmpp.m_floats[1] -= val; tmpp.m_floats[1] -= val;
return tmpp; return tmpp;
} }
/***************************************************** /* ****************************************************
* *= operator * *= operator
*****************************************************/ *****************************************************/
const Vector2D<T>& operator*= (const Vector2D<T>& obj) { const Vector2D<T>& operator*= (const Vector2D<T>& obj) {
@ -139,7 +137,7 @@ namespace etk
m_floats[1] *= val; m_floats[1] *= val;
return *this; return *this;
} }
/***************************************************** /* ****************************************************
* * operator * * operator
*****************************************************/ *****************************************************/
Vector2D<T> operator* (const Vector2D<T>& obj) const { Vector2D<T> operator* (const Vector2D<T>& obj) const {
@ -154,7 +152,7 @@ namespace etk
tmpp.m_floats[1] *= val; tmpp.m_floats[1] *= val;
return tmpp; return tmpp;
} }
/***************************************************** /* ****************************************************
* / operator * / operator
*****************************************************/ *****************************************************/
Vector2D<T> operator/ (const Vector2D<T>& obj) const{ Vector2D<T> operator/ (const Vector2D<T>& obj) const{
@ -169,10 +167,10 @@ namespace etk
tmpp.m_floats[1] /= val; tmpp.m_floats[1] /= val;
return tmpp; return tmpp;
} }
/***************************************************** /* ****************************************************
* ++ operator * ++ operator
*****************************************************/ *****************************************************/
Vector2D<T>& operator++() { Vector2D<T>& operator++(void) {
++m_floats[0]; ++m_floats[0];
++m_floats[1]; ++m_floats[1];
return *this; return *this;
@ -182,10 +180,10 @@ namespace etk
++(*this); ++(*this);
return result; return result;
} }
/***************************************************** /* ****************************************************
* -- operator * -- operator
*****************************************************/ *****************************************************/
Vector2D<T>& operator--() { Vector2D<T>& operator--(void) {
--m_floats[0]; --m_floats[0];
--m_floats[1]; --m_floats[1];
return *this; return *this;
@ -272,13 +270,13 @@ namespace etk
/** /**
* @brief Return the x value * @brief Return the x value
*/ */
const T& getX() const { const T& getX(void) const {
return m_floats[0]; return m_floats[0];
} }
/** /**
* @brief Return the y value * @brief Return the y value
*/ */
const T& getY() const { const T& getY(void) const {
return m_floats[1]; return m_floats[1];
} }
/** /**
@ -296,19 +294,19 @@ namespace etk
/** /**
* @brief Return the x value * @brief Return the x value
*/ */
const T& x() const { const T& x(void) const {
return m_floats[0]; return m_floats[0];
} }
/** /**
* @brief Return the y value * @brief Return the y value
*/ */
const T& y() const { const T& y(void) const {
return m_floats[1]; return m_floats[1];
} }
operator T *() { operator T *(void) {
return &m_floats[0]; return &m_floats[0];
} }
operator const T *() const { operator const T *(void) const {
return &m_floats[0]; return &m_floats[0];
} }
/** /**
@ -348,8 +346,6 @@ namespace etk
etk::CCout& operator <<(etk::CCout &os, const etk::Vector2D<float>& obj); etk::CCout& operator <<(etk::CCout &os, const etk::Vector2D<float>& obj);
etk::CCout& operator <<(etk::CCout &os, const etk::Vector2D<uint32_t>& obj); etk::CCout& operator <<(etk::CCout &os, const etk::Vector2D<uint32_t>& obj);
etk::CCout& operator <<(etk::CCout &os, const etk::Vector2D<bool>& obj); etk::CCout& operator <<(etk::CCout &os, const etk::Vector2D<bool>& obj);
}; };
// To siplify the writing of the code ==> this permit to have the same name with the glsl language... // To siplify the writing of the code ==> this permit to have the same name with the glsl language...
typedef etk::Vector2D<float> vec2; typedef etk::Vector2D<float> vec2;

View File

@ -1,14 +1,18 @@
#!/usr/bin/python #!/usr/bin/python
import lutinModule import lutinModule as module
import lutinTools import lutinTools as tools
def Create(target): def get_desc():
return "e-tk : Ewol tool kit"
def create(target):
# module name is 'edn' and type binary. # module name is 'edn' and type binary.
myModule = lutinModule.module(__file__, 'etk', 'LIBRARY') myModule = module.Module(__file__, 'etk', 'LIBRARY')
# add extra compilation flags : # add extra compilation flags :
myModule.add_extra_compile_flags() myModule.add_extra_compile_flags()
# add the file to compile: # add the file to compile:
myModule.AddSrcFile([ myModule.add_src_file([
'etk/debugGeneric.cpp', 'etk/debugGeneric.cpp',
'etk/debug.cpp', 'etk/debug.cpp',
'etk/unicode.cpp', 'etk/unicode.cpp',
@ -31,35 +35,35 @@ def Create(target):
'etk/archive/Zip.cpp']) 'etk/archive/Zip.cpp'])
if target.name=="Windows": if target.name=="Windows":
myModule.AddSrcFile('etk/os/Mutex.Windows.cpp') myModule.add_src_file('etk/os/Mutex.Windows.cpp')
myModule.AddSrcFile('etk/os/Semaphore.Windows.cpp') myModule.add_src_file('etk/os/Semaphore.Windows.cpp')
else: else:
myModule.AddSrcFile('etk/os/Mutex.Generic.cpp') myModule.add_src_file('etk/os/Mutex.Generic.cpp')
myModule.AddSrcFile('etk/os/Semaphore.Generic.cpp') myModule.add_src_file('etk/os/Semaphore.Generic.cpp')
# name of the dependency # name of the dependency
myModule.AddModuleDepend('linearmath') myModule.add_module_depend('linearmath')
myModule.AddModuleDepend('minizip') myModule.add_module_depend('minizip')
if target.buildMode == "release": if target.buildMode == "release":
# TODO : The other way is to remove this ... # TODO : The other way is to remove this ...
# TODO : Fore release mode : the etk folder are absolutly not at the same position in the tree ... # TODO : Fore release mode : the etk folder are absolutly not at the same position in the tree ...
myModule.CompileFlags_CC("-DMODE_RELEASE") myModule.compile_flags_CC("-DMODE_RELEASE")
else: else:
myModule.AddExportFlag_CC("-DDEBUG_LEVEL=3") myModule.add_export_flag_CC("-DDEBUG_LEVEL=3")
myModule.AddExportFlag_CC("-DDEBUG=1") myModule.add_export_flag_CC("-DDEBUG=1")
# Bor backtrace display : # Bor backtrace display :
if target.name!="Windows": if target.name!="Windows":
myModule.AddExportflag_LD("-ldl -rdynamic") myModule.add_export_flag_LD("-ldl -rdynamic")
if target.name=="Windows": if target.name=="Windows":
None None
elif target.name=="Android": elif target.name=="Android":
None None
else: else:
myModule.AddExportflag_LD("-lpthread") myModule.add_export_flag_LD("-lpthread")
myModule.AddExportPath(lutinTools.GetCurrentPath(__file__)) myModule.add_export_path(tools.get_current_path(__file__))
# add the currrent module at the # add the currrent module at the
return myModule return myModule

View File

@ -1,17 +1,21 @@
#!/usr/bin/python #!/usr/bin/python
import lutinModule import lutinModule as module
import lutinTools import lutinTools as tools
import datetime import datetime
def Create(target): def get_desc():
return "e-tk test software"
def create(target):
# module name is 'edn' and type binary. # module name is 'edn' and type binary.
myModule = lutinModule.module(__file__, 'etktest', 'BINARY') myModule = module.Module(__file__, 'etktest', 'BINARY')
# add the file to compile: # add the file to compile:
myModule.AddSrcFile([ myModule.add_src_file([
'test/main.cpp']) 'test/main.cpp'])
myModule.AddModuleDepend(['etk']) myModule.add_module_depend(['etk'])
# add the currrent module at the system # add the currrent module at the system
return myModule return myModule

View File

@ -2,6 +2,10 @@
import monkModule as module import monkModule as module
import monkTools as tools import monkTools as tools
def get_desc():
return "e-tk : Ewol tool kit"
def create(): def create():
# module name is 'edn' and type binary. # module name is 'edn' and type binary.
myModule = module.Module(__file__, 'etk', 'LIBRARY') myModule = module.Module(__file__, 'etk', 'LIBRARY')
@ -11,5 +15,3 @@ def create():
# add the currrent module at the # add the currrent module at the
return myModule return myModule
def get_desc():
return ""